@ringko-ai/rkh 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +56 -2
  4. package/bin/rkh.mjs +128408 -0
  5. package/bin/terminal-bridge.mjs +67 -0
  6. package/package.json +29 -4
  7. package/webui/assets/_basePickBy-QJXUw_pr.js +1 -0
  8. package/webui/assets/_baseUniq-DR4vVjyC.js +1 -0
  9. package/webui/assets/abap-CLvhMVsD.js +1 -0
  10. package/webui/assets/abnfDiagram-O67JEVCF-Ch4YxsDq.js +1 -0
  11. package/webui/assets/actionscript-3--17pq3dv.js +1 -0
  12. package/webui/assets/ada-C5qYipkI.js +1 -0
  13. package/webui/assets/andromeeda-vGVdxbeo.js +1 -0
  14. package/webui/assets/angular-html-CDngiajI.js +1 -0
  15. package/webui/assets/angular-ts-BtT37Us9.js +1 -0
  16. package/webui/assets/apache-U0d_L8uA.js +1 -0
  17. package/webui/assets/apex-CGTLDQj6.js +1 -0
  18. package/webui/assets/apl-BvMMMvlM.js +1 -0
  19. package/webui/assets/applescript-CCn79oCD.js +1 -0
  20. package/webui/assets/ara-4CJ0cIlV.js +1 -0
  21. package/webui/assets/arc-DZXi4mKy.js +1 -0
  22. package/webui/assets/architecture-7GRP2DOG-d7cuU_YV.js +1 -0
  23. package/webui/assets/architectureDiagram-NJMV4G6O-DMYAXZLu.js +36 -0
  24. package/webui/assets/array-BifhSqXX.js +1 -0
  25. package/webui/assets/asciidoc-DE70LPWp.js +1 -0
  26. package/webui/assets/asm-Cmm7eHzH.js +1 -0
  27. package/webui/assets/astro-5GH4n63k.js +1 -0
  28. package/webui/assets/aurora-x-CDeNXAV0.js +1 -0
  29. package/webui/assets/awk-BWXHIvNe.js +1 -0
  30. package/webui/assets/ayu-dark-DluEY0Gj.js +1 -0
  31. package/webui/assets/ayu-light-C3h-C4tm.js +1 -0
  32. package/webui/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  33. package/webui/assets/ballerina-B7ZEbQpA.js +1 -0
  34. package/webui/assets/bat-Bo4NYOV-.js +1 -0
  35. package/webui/assets/beancount-D-usSTwE.js +1 -0
  36. package/webui/assets/berry-DKpUyyne.js +1 -0
  37. package/webui/assets/bibtex-Ci_nEsc7.js +1 -0
  38. package/webui/assets/bicep-CUHmPFLl.js +1 -0
  39. package/webui/assets/bird2-C2hNVINV.js +1 -0
  40. package/webui/assets/blade-FVyx8_pi.js +1 -0
  41. package/webui/assets/blockDiagram-BEXU5L5S-42sQ-AEH.js +140 -0
  42. package/webui/assets/bsl-BkkzgIyY.js +1 -0
  43. package/webui/assets/c-DaWGyzOq.js +1 -0
  44. package/webui/assets/c3-CnJL0r0V.js +1 -0
  45. package/webui/assets/c4Diagram-YGBWAQC7-C4LohzTc.js +38 -0
  46. package/webui/assets/cadence-CQ2zXKGN.js +1 -0
  47. package/webui/assets/cairo-DLTphjLi.js +1 -0
  48. package/webui/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
  49. package/webui/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
  50. package/webui/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
  51. package/webui/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
  52. package/webui/assets/channel-Dfzpi6qb.js +1 -0
  53. package/webui/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  54. package/webui/assets/chunk-3FUC2YCW-BaCXPQ5f.js +2 -0
  55. package/webui/assets/chunk-5DYCD2WN-Dymfs607.js +1 -0
  56. package/webui/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  57. package/webui/assets/chunk-742MDFTN-Bp0YWssF.js +1 -0
  58. package/webui/assets/chunk-7INBJB4K-DxjXTyxf.js +62 -0
  59. package/webui/assets/chunk-7M6MHVWA-CHMAJZF0.js +213 -0
  60. package/webui/assets/chunk-7PRAP22T-goNAa0SG.js +1 -0
  61. package/webui/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  62. package/webui/assets/chunk-FOHPRMQF-DzxwRta7.js +161 -0
  63. package/webui/assets/chunk-GTNCS2PH-CtDEW3I5.js +88 -0
  64. package/webui/assets/chunk-GWA4HPMP-ChZiEIcV.js +1 -0
  65. package/webui/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  66. package/webui/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  67. package/webui/assets/chunk-MBY4JIJT-Cm_QlcR_.js +72 -0
  68. package/webui/assets/chunk-NETBCI7D-CqofXBB5.js +1 -0
  69. package/webui/assets/chunk-O7XYJQB3-BvAi6lqO.js +128 -0
  70. package/webui/assets/chunk-UA2S7LBM-CQaD7SEi.js +1 -0
  71. package/webui/assets/chunk-WEXAMYUT-X4F-1EYQ.js +1 -0
  72. package/webui/assets/chunk-XXDRQBXY-B3rPgRRN.js +1 -0
  73. package/webui/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  74. package/webui/assets/chunk-Z7XXMR3K-u1Fym3iI.js +10 -0
  75. package/webui/assets/chunk-ZIGJFQKS-CdlwxgjL.js +2 -0
  76. package/webui/assets/clarity-SemFz856.js +1 -0
  77. package/webui/assets/classDiagram-v2-NBCMYWYE-BtlXjvY-.js +217 -0
  78. package/webui/assets/clojure-DqKBuwfJ.js +1 -0
  79. package/webui/assets/cmake-Bj61d0ZC.js +1 -0
  80. package/webui/assets/cobol-BR4hIuAS.js +1 -0
  81. package/webui/assets/codeowners-C8r90Shi.js +1 -0
  82. package/webui/assets/codeql-oeQT6MSM.js +1 -0
  83. package/webui/assets/coffee-CV_krZ_v.js +1 -0
  84. package/webui/assets/common-lisp-Cv5bFMCO.js +1 -0
  85. package/webui/assets/coq-BrsZFFmf.js +1 -0
  86. package/webui/assets/cose-bilkent-JH36ORCC-BfFvevks.js +1 -0
  87. package/webui/assets/cpp-BcL5kNR1.js +1 -0
  88. package/webui/assets/crystal-uM0LOVx9.js +1 -0
  89. package/webui/assets/csharp-Ct8U2NOr.js +1 -0
  90. package/webui/assets/css-0UGFDVhs.js +1 -0
  91. package/webui/assets/csv-Dx-8-gkx.js +1 -0
  92. package/webui/assets/cue-CE9AQfxI.js +1 -0
  93. package/webui/assets/cynefin-OW5HDTMX-Degkbi5B.js +1 -0
  94. package/webui/assets/cynefinDiagram-VND7K2PF-DA-Z8cNm.js +62 -0
  95. package/webui/assets/cypher-ClKdZ_lG.js +1 -0
  96. package/webui/assets/cytoscape.esm-Yq6u8L66.js +321 -0
  97. package/webui/assets/d-qD-0Kul2.js +1 -0
  98. package/webui/assets/dagre-6A5THRUB-MeXLwlRl.js +4 -0
  99. package/webui/assets/dark-plus-Cs2F2srj.js +1 -0
  100. package/webui/assets/dart-DkHntEIa.js +1 -0
  101. package/webui/assets/dax-BkyTk9wS.js +1 -0
  102. package/webui/assets/defaultLocale-BFoDCU3G.js +1 -0
  103. package/webui/assets/desktop-Dlh5hvp9.js +1 -0
  104. package/webui/assets/diagram-22UHCM2B-DAyp7XVq.js +200 -0
  105. package/webui/assets/diagram-3UASUU5V-HTPoHC_8.js +24 -0
  106. package/webui/assets/diagram-ATOU4E4O-Bs8Rqpgq.js +3 -0
  107. package/webui/assets/diagram-CDSNMT55-B7cCsW6r.js +30 -0
  108. package/webui/assets/diagram-MLGK6HIB-D2Fqz3oF.js +24 -0
  109. package/webui/assets/diagram-MPIPVDR6-C935FXQB.js +41 -0
  110. package/webui/assets/diff-woXpYk--.js +1 -0
  111. package/webui/assets/dist-j4SBNV0D.js +1 -0
  112. package/webui/assets/docker-IyjqRm3v.js +1 -0
  113. package/webui/assets/dotenv-_5a1GRtc.js +1 -0
  114. package/webui/assets/dracula-BHWKrbxM.js +1 -0
  115. package/webui/assets/dracula-soft-5eyTD99u.js +1 -0
  116. package/webui/assets/dream-maker-DW3nJb8Q.js +1 -0
  117. package/webui/assets/ebnfDiagram-ZINNZB2B-D5y1xfQh.js +1 -0
  118. package/webui/assets/edge-D0oESfMY.js +1 -0
  119. package/webui/assets/elixir-CaEILBcp.js +1 -0
  120. package/webui/assets/elk-276RUBZZ-DXZV01Dz.js +27 -0
  121. package/webui/assets/elm-ZyUnRSna.js +1 -0
  122. package/webui/assets/emacs-lisp-C9PiwqqW.js +1 -0
  123. package/webui/assets/erDiagram-OPXOYQCR-Bw_jOq1D.js +99 -0
  124. package/webui/assets/erb-BEOXg7uE.js +1 -0
  125. package/webui/assets/erlang-Cphh6RMH.js +1 -0
  126. package/webui/assets/eventmodeling-NTZA5JFV-aWjBO4_S.js +1 -0
  127. package/webui/assets/everforest-dark-sB-x3p7T.js +1 -0
  128. package/webui/assets/everforest-light-Df2xbC6M.js +1 -0
  129. package/webui/assets/fennel-DQxkIbk2.js +1 -0
  130. package/webui/assets/fish-BJitypiv.js +1 -0
  131. package/webui/assets/flowDiagram-KWPJA3E3-4fWwqGiA.js +1 -0
  132. package/webui/assets/fluent-C03EYrpw.js +1 -0
  133. package/webui/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  134. package/webui/assets/fortran-free-form-CYNrtFtB.js +1 -0
  135. package/webui/assets/fsharp-D13ZGOAj.js +1 -0
  136. package/webui/assets/ganttDiagram-FUAMR5RP-BnIuHb_b.js +292 -0
  137. package/webui/assets/gdresource-C0sCabJj.js +1 -0
  138. package/webui/assets/gdscript-Cp2uCuqX.js +1 -0
  139. package/webui/assets/gdshader-CBce3t8t.js +1 -0
  140. package/webui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  141. package/webui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  142. package/webui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  143. package/webui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  144. package/webui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  145. package/webui/assets/genie-CV2tkWYe.js +1 -0
  146. package/webui/assets/gherkin-DExj1W_8.js +1 -0
  147. package/webui/assets/git-commit-BSykSTBG.js +1 -0
  148. package/webui/assets/git-rebase-LAaHyDt5.js +1 -0
  149. package/webui/assets/gitGraph-4MIJSDKK-CvE7died.js +1 -0
  150. package/webui/assets/gitGraphDiagram-X574FWY7-g2qnK3e0.js +106 -0
  151. package/webui/assets/github-dark-C-LZuMrd.js +1 -0
  152. package/webui/assets/github-dark-default-DXG-b-1a.js +1 -0
  153. package/webui/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  154. package/webui/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  155. package/webui/assets/github-light-EUqPIrTm.js +1 -0
  156. package/webui/assets/github-light-default-BXViO-2h.js +1 -0
  157. package/webui/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  158. package/webui/assets/gleam-CSRkHgEL.js +1 -0
  159. package/webui/assets/glimmer-js-DnRAU-8r.js +1 -0
  160. package/webui/assets/glimmer-ts-B_9lY4Cg.js +1 -0
  161. package/webui/assets/glsl-Bzz9G3Ya.js +1 -0
  162. package/webui/assets/gn-ilITqXS6.js +1 -0
  163. package/webui/assets/gnuplot-7GGW24-e.js +1 -0
  164. package/webui/assets/go-BJwz_mda.js +1 -0
  165. package/webui/assets/graphlib-C9Tl7QrK.js +1 -0
  166. package/webui/assets/graphql-CFv-7q2r.js +1 -0
  167. package/webui/assets/groovy-CacY0gHj.js +1 -0
  168. package/webui/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  169. package/webui/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  170. package/webui/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  171. package/webui/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  172. package/webui/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  173. package/webui/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  174. package/webui/assets/hack-BQq89007.js +1 -0
  175. package/webui/assets/haml-B3JO2g53.js +1 -0
  176. package/webui/assets/handlebars-BVxFlQdu.js +1 -0
  177. package/webui/assets/haskell-D8IpX4py.js +1 -0
  178. package/webui/assets/haxe-OTjmBuCE.js +1 -0
  179. package/webui/assets/hcl-Dh228itO.js +1 -0
  180. package/webui/assets/hjson-CxZEssPk.js +1 -0
  181. package/webui/assets/hlsl-Cvrh5tZx.js +1 -0
  182. package/webui/assets/horizon-CE9ld1lL.js +1 -0
  183. package/webui/assets/horizon-bright-Br1oVSNq.js +1 -0
  184. package/webui/assets/houston-CsvMBhTu.js +1 -0
  185. package/webui/assets/html-CwlSby6Y.js +1 -0
  186. package/webui/assets/html-derivative-Bp9FFIai.js +1 -0
  187. package/webui/assets/http-OxvOel0d.js +1 -0
  188. package/webui/assets/hurl-BR8OTQDL.js +1 -0
  189. package/webui/assets/hxml-B0Qn7Nwc.js +1 -0
  190. package/webui/assets/hy-CZbG8q4J.js +1 -0
  191. package/webui/assets/imba-DsUTQ-LC.js +1 -0
  192. package/webui/assets/index-CfB4ehB4.css +2 -0
  193. package/webui/assets/index-mp9KCuIH.js +110 -0
  194. package/webui/assets/info-A6RAGUB7-DnALeCl5.js +1 -0
  195. package/webui/assets/infoDiagram-VRGFBTTK-DVypMwhO.js +2 -0
  196. package/webui/assets/ini-B5eOa1yu.js +1 -0
  197. package/webui/assets/init-C-OQMol4.js +1 -0
  198. package/webui/assets/ishikawaDiagram-OU5B5YK6-ZtAD0SKH.js +70 -0
  199. package/webui/assets/java-DLdU51RX.js +1 -0
  200. package/webui/assets/javascript-BOoDksQA.js +1 -0
  201. package/webui/assets/jinja-JHLjBiC-.js +1 -0
  202. package/webui/assets/jison-MADSp4PV.js +1 -0
  203. package/webui/assets/journeyDiagram-ZHPQQLJL-CEI0CkZ8.js +139 -0
  204. package/webui/assets/json-BP2JFEth.js +1 -0
  205. package/webui/assets/json5-BR5RXkoi.js +1 -0
  206. package/webui/assets/jsonc-CYpm1nAK.js +1 -0
  207. package/webui/assets/jsonl-CmCQp5Yx.js +1 -0
  208. package/webui/assets/jsonnet-CJTPZ8u_.js +1 -0
  209. package/webui/assets/jssm-DXw9l8Rf.js +1 -0
  210. package/webui/assets/jsx-WD857QYb.js +1 -0
  211. package/webui/assets/julia-DFzHTS-P.js +1 -0
  212. package/webui/assets/just-Cr1WcUSw.js +1 -0
  213. package/webui/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
  214. package/webui/assets/kanagawa-lotus-BN08jTvb.js +1 -0
  215. package/webui/assets/kanagawa-wave-CTweb8Dz.js +1 -0
  216. package/webui/assets/kanban-definition-PNTS6WVX-CWyhCfXV.js +89 -0
  217. package/webui/assets/katex-ZlcWpGUi.js +257 -0
  218. package/webui/assets/kdl-CsD5j6eV.js +1 -0
  219. package/webui/assets/kotlin-DhhofPvG.js +1 -0
  220. package/webui/assets/kusto-BUv0MjJC.js +1 -0
  221. package/webui/assets/laserwave-C_8bwKvT.js +1 -0
  222. package/webui/assets/latex-C4Jp4eq5.js +1 -0
  223. package/webui/assets/lean-CewbzKMR.js +1 -0
  224. package/webui/assets/less-DVTAwKKz.js +1 -0
  225. package/webui/assets/light-plus-DVQuIRkW.js +1 -0
  226. package/webui/assets/line-C5_ag20i.js +1 -0
  227. package/webui/assets/linear-BysMTe_U.js +1 -0
  228. package/webui/assets/liquid-BOlUcl5B.js +1 -0
  229. package/webui/assets/llvm-Cm23YOpf.js +1 -0
  230. package/webui/assets/log-BNLmms1o.js +1 -0
  231. package/webui/assets/logo-Cluzi2Zq.js +1 -0
  232. package/webui/assets/lua-Bt6jto6s.js +1 -0
  233. package/webui/assets/luau-CNKltnaQ.js +1 -0
  234. package/webui/assets/make-Dixweg8N.js +1 -0
  235. package/webui/assets/markdown-BYOwaDjH.js +1 -0
  236. package/webui/assets/marko-B4gbbHnu.js +1 -0
  237. package/webui/assets/material-theme-Bm3Qr25_.js +1 -0
  238. package/webui/assets/material-theme-darker-2IIEA8gg.js +1 -0
  239. package/webui/assets/material-theme-lighter-uhdI0v04.js +1 -0
  240. package/webui/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  241. package/webui/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  242. package/webui/assets/matlab-D7qyCx1q.js +1 -0
  243. package/webui/assets/mdc-D4PTgKs-.js +1 -0
  244. package/webui/assets/mdx-DQZ5AkYe.js +1 -0
  245. package/webui/assets/mermaid-Bk4SNUv9.js +1 -0
  246. package/webui/assets/mermaid-parser.core-DRF3jMfH.js +7 -0
  247. package/webui/assets/mermaid.core-CqYAvE1t.js +44 -0
  248. package/webui/assets/min-dark-BSWPekZh.js +1 -0
  249. package/webui/assets/min-light-DDpmG2fV.js +1 -0
  250. package/webui/assets/mindmap-definition-NLK3R4M7-DcyHcc-8.js +96 -0
  251. package/webui/assets/mipsasm-BMqwQI7S.js +1 -0
  252. package/webui/assets/mojo-BgCJLMeH.js +1 -0
  253. package/webui/assets/monokai-CdkpiU2Y.js +1 -0
  254. package/webui/assets/moonbit-CaWjb8XO.js +1 -0
  255. package/webui/assets/move-B1IS1UjX.js +1 -0
  256. package/webui/assets/narrat-_X_XdTYD.js +1 -0
  257. package/webui/assets/nextflow-Bbiyy34d.js +1 -0
  258. package/webui/assets/nextflow-groovy-Dc_ddanL.js +1 -0
  259. package/webui/assets/nginx-CTDO1ewa.js +1 -0
  260. package/webui/assets/night-owl-DhmEMT88.js +1 -0
  261. package/webui/assets/night-owl-light-eJ-hLW7d.js +1 -0
  262. package/webui/assets/nim-BOQk_yKn.js +1 -0
  263. package/webui/assets/nix-IvuFDN5E.js +1 -0
  264. package/webui/assets/nord-Cb4Vim4T.js +1 -0
  265. package/webui/assets/nushell-DcLAeLz5.js +1 -0
  266. package/webui/assets/objective-c-D1A_Heim.js +1 -0
  267. package/webui/assets/objective-cpp-BsSzOQcm.js +1 -0
  268. package/webui/assets/ocaml-O90oeIOV.js +1 -0
  269. package/webui/assets/odin-B1RWQWA5.js +1 -0
  270. package/webui/assets/one-dark-pro-CLwyXe_n.js +1 -0
  271. package/webui/assets/one-light-D7Lr4KcI.js +1 -0
  272. package/webui/assets/openscad-BUDT5pXO.js +1 -0
  273. package/webui/assets/ordinal-BDEzSJ7C.js +1 -0
  274. package/webui/assets/packet-AYTQ26CC-DRj99eu-.js +1 -0
  275. package/webui/assets/pascal-4ZHwLPI5.js +1 -0
  276. package/webui/assets/path-fybaL0A-.js +1 -0
  277. package/webui/assets/pegDiagram-GJSIUBJH-C6upGoOM.js +1 -0
  278. package/webui/assets/perl-vPUc98Xz.js +1 -0
  279. package/webui/assets/php-DeCmiyAV.js +1 -0
  280. package/webui/assets/pie-WAS4IAKB-BFoQbsV3.js +1 -0
  281. package/webui/assets/pieDiagram-5QR66LMP-C9_M53YF.js +39 -0
  282. package/webui/assets/pkl-ot-7Btpt.js +1 -0
  283. package/webui/assets/plastic-DQwYfKfQ.js +1 -0
  284. package/webui/assets/plsql-DGHpHOYJ.js +1 -0
  285. package/webui/assets/po-BiJDBrnU.js +1 -0
  286. package/webui/assets/poimandres-DRFjx7u4.js +1 -0
  287. package/webui/assets/polar-C7UOKdEL.js +1 -0
  288. package/webui/assets/postcss-BXeXVLqQ.js +1 -0
  289. package/webui/assets/powerquery-DNMTfnFr.js +1 -0
  290. package/webui/assets/powershell-DshXNtvi.js +1 -0
  291. package/webui/assets/prisma-BsRQq5mF.js +1 -0
  292. package/webui/assets/prolog-iXnhIJG7.js +1 -0
  293. package/webui/assets/proto-DB4EqR-F.js +1 -0
  294. package/webui/assets/pug-DrCcomsb.js +1 -0
  295. package/webui/assets/puppet-CDv2pdJW.js +1 -0
  296. package/webui/assets/purescript-9MfHhQsQ.js +1 -0
  297. package/webui/assets/python-gzcpVVnB.js +1 -0
  298. package/webui/assets/qml-BYMwIH9I.js +1 -0
  299. package/webui/assets/qmldir-DCQb3MpD.js +1 -0
  300. package/webui/assets/qss-Fe1Jh2GI.js +1 -0
  301. package/webui/assets/quadrantDiagram-O4NWA36T-BhjEBakd.js +7 -0
  302. package/webui/assets/r-lYZIQvFq.js +1 -0
  303. package/webui/assets/racket-DcIDlBhZ.js +1 -0
  304. package/webui/assets/radar-RG4KPBEZ-EBd0t7A7.js +1 -0
  305. package/webui/assets/railroad-74A4TZTK-lGb6hTAc.js +1 -0
  306. package/webui/assets/railroad-abnf-HS5TGJTU-CrKkzOSP.js +1 -0
  307. package/webui/assets/railroad-ebnf-LZEXJU2U-BivN-Ak_.js +1 -0
  308. package/webui/assets/railroad-peg-WCYAUIDC-DmX8gYYw.js +1 -0
  309. package/webui/assets/railroadDiagram-XR7U4H2S-Ct5KCXFS.js +1 -0
  310. package/webui/assets/raku-B3gFvitq.js +1 -0
  311. package/webui/assets/razor-BsZLkc5_.js +1 -0
  312. package/webui/assets/red-CJ3rzSJv.js +1 -0
  313. package/webui/assets/reg-CRGYupPL.js +1 -0
  314. package/webui/assets/regexp-CuieyCDo.js +1 -0
  315. package/webui/assets/rel-BtDbiS_P.js +1 -0
  316. package/webui/assets/requirementDiagram-PLB6GJNP-hNjM-lU7.js +84 -0
  317. package/webui/assets/riscv-Ckw8ddFX.js +1 -0
  318. package/webui/assets/ron-VUp2lXgN.js +1 -0
  319. package/webui/assets/rose-pine-BthvhNj6.js +1 -0
  320. package/webui/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
  321. package/webui/assets/rose-pine-moon-hon4tzzS.js +1 -0
  322. package/webui/assets/rosmsg-CAekHB0j.js +1 -0
  323. package/webui/assets/rough.esm-Dy-Kn_BL.js +1 -0
  324. package/webui/assets/rst-Buwxy6i8.js +1 -0
  325. package/webui/assets/ruby-Dbe_ekvV.js +1 -0
  326. package/webui/assets/rust-Cfkwpbl8.js +1 -0
  327. package/webui/assets/sankeyDiagram-IPEJSGJF-BoRhoFO4.js +40 -0
  328. package/webui/assets/sas-P1b9K4Ys.js +1 -0
  329. package/webui/assets/sass-DXrisJhu.js +1 -0
  330. package/webui/assets/scala-DKOlJaKm.js +1 -0
  331. package/webui/assets/scheme-DQCgrYNe.js +1 -0
  332. package/webui/assets/scss-C_sc8enw.js +1 -0
  333. package/webui/assets/sdbl-bTVj8UrX.js +1 -0
  334. package/webui/assets/sequenceDiagram-PO4LG4MO-DQjXoBbb.js +169 -0
  335. package/webui/assets/shaderlab-TOUzSsQk.js +1 -0
  336. package/webui/assets/shellscript-BJkeugYw.js +1 -0
  337. package/webui/assets/shellsession-BQdMaoZE.js +1 -0
  338. package/webui/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
  339. package/webui/assets/slack-dark-DnToyrRv.js +1 -0
  340. package/webui/assets/slack-ochin-B2OO5cIa.js +1 -0
  341. package/webui/assets/smalltalk-B16xEiuN.js +1 -0
  342. package/webui/assets/snazzy-light-4G7pJPwS.js +1 -0
  343. package/webui/assets/solarized-dark-DV17i1UV.js +1 -0
  344. package/webui/assets/solarized-light-DSh2HLQt.js +1 -0
  345. package/webui/assets/solidity-CKzVLygQ.js +1 -0
  346. package/webui/assets/soy-CnADQkBx.js +1 -0
  347. package/webui/assets/sparql-D_iOobhT.js +1 -0
  348. package/webui/assets/splunk-BC2Px7Mm.js +1 -0
  349. package/webui/assets/sql-tNQIlitF.js +1 -0
  350. package/webui/assets/src-BhNX2bDa.js +1 -0
  351. package/webui/assets/ssh-config-BgfXC-Er.js +1 -0
  352. package/webui/assets/stata-Dbj2lGXX.js +1 -0
  353. package/webui/assets/stateDiagram-v2-GCMORJYK-0v5JRNEv.js +291 -0
  354. package/webui/assets/stylus-B6D30XZt.js +1 -0
  355. package/webui/assets/surrealql-CUlk2o6E.js +1 -0
  356. package/webui/assets/svelte-BnEKKmXX.js +1 -0
  357. package/webui/assets/swift-DonLKvLd.js +1 -0
  358. package/webui/assets/swimlanes-2SLR337P-DNTbWOPR.js +1 -0
  359. package/webui/assets/swimlanesDiagram-TC7HE7FX-CLnfRdWi.js +8 -0
  360. package/webui/assets/synthwave-84-nFMaYfgc.js +1 -0
  361. package/webui/assets/system-verilog-DJ5XKQeo.js +1 -0
  362. package/webui/assets/systemd-BxMlprV5.js +1 -0
  363. package/webui/assets/talonscript-CohzipZa.js +1 -0
  364. package/webui/assets/tasl-DMoTqEGO.js +1 -0
  365. package/webui/assets/tcl-CZd0xW_V.js +1 -0
  366. package/webui/assets/templ-DGjxt26F.js +1 -0
  367. package/webui/assets/terraform-DswuEJGm.js +1 -0
  368. package/webui/assets/tex-BlMK__2U.js +1 -0
  369. package/webui/assets/timeline-definition-EJHVYXUP-Da8JAJNb.js +120 -0
  370. package/webui/assets/tokyo-night-oM2G3aXe.js +1 -0
  371. package/webui/assets/toml-CcmNWLt0.js +1 -0
  372. package/webui/assets/treeView-Q6P3EWNA-C9DFFE55.js +1 -0
  373. package/webui/assets/treemap-WGGIJYW6-CXGgmu8g.js +1 -0
  374. package/webui/assets/ts-tags-C3cZCmwl.js +1 -0
  375. package/webui/assets/tsv-sltzmVWM.js +1 -0
  376. package/webui/assets/tsx-BYhombzc.js +1 -0
  377. package/webui/assets/turtle-ByJddavk.js +1 -0
  378. package/webui/assets/twig-BCBpfD3_.js +1 -0
  379. package/webui/assets/typescript-C0I5qU9Q.js +1 -0
  380. package/webui/assets/typespec-B88KGewJ.js +1 -0
  381. package/webui/assets/typst-DI99ib-x.js +1 -0
  382. package/webui/assets/usecaseDiagram-POWQR4AR-D2JRgP6M.js +328 -0
  383. package/webui/assets/v-DETTlOr0.js +1 -0
  384. package/webui/assets/vala-zf12oZj6.js +1 -0
  385. package/webui/assets/vb-Djn5o6TS.js +1 -0
  386. package/webui/assets/vennDiagram-UO4OBE2U-fybZ7hrG.js +34 -0
  387. package/webui/assets/verilog-CiiDBU1e.js +1 -0
  388. package/webui/assets/vesper-D5bVUKB1.js +1 -0
  389. package/webui/assets/vhdl-BroJfC0k.js +1 -0
  390. package/webui/assets/viml-DvXPmvsu.js +1 -0
  391. package/webui/assets/vitesse-black-fwtXNY1n.js +1 -0
  392. package/webui/assets/vitesse-dark-BZCL-v6S.js +1 -0
  393. package/webui/assets/vitesse-light-VbXTXTou.js +1 -0
  394. package/webui/assets/vue-Ba5J_YU2.js +1 -0
  395. package/webui/assets/vue-html-CMnkOyKm.js +1 -0
  396. package/webui/assets/vue-vine-BLdNBabV.js +1 -0
  397. package/webui/assets/vyper-CgoNMtux.js +1 -0
  398. package/webui/assets/wardley-WFR3VGLG-BnMrNMcZ.js +1 -0
  399. package/webui/assets/wardleyDiagram-VNRHLVJA-C-ICPJgL.js +78 -0
  400. package/webui/assets/wasm-BnjxR4X6.js +1 -0
  401. package/webui/assets/wasm-ByWQv1Qj.js +1 -0
  402. package/webui/assets/wenyan-C8pVoKbM.js +1 -0
  403. package/webui/assets/wgsl-BsKzXJz4.js +1 -0
  404. package/webui/assets/wikitext-ClFFjSW2.js +1 -0
  405. package/webui/assets/wit-DdvCle-K.js +1 -0
  406. package/webui/assets/wolfram-DLL8P-h_.js +1 -0
  407. package/webui/assets/xml-CGYBKmq2.js +1 -0
  408. package/webui/assets/xsl-CJoMbcve.js +1 -0
  409. package/webui/assets/xychartDiagram-PMCCYNJV-BX6gx32T.js +7 -0
  410. package/webui/assets/yaml-UlGSIJg6.js +1 -0
  411. package/webui/assets/zenscript-BnlCZFoB.js +1 -0
  412. package/webui/assets/zig-CMLA9XwU.js +1 -0
  413. package/webui/favicon.svg +1 -0
  414. package/webui/icons.svg +24 -0
  415. package/webui/index.html +14 -0
@@ -0,0 +1,110 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CDngiajI.js","assets/html-CwlSby6Y.js","assets/javascript-BOoDksQA.js","assets/css-0UGFDVhs.js","assets/angular-ts-BtT37Us9.js","assets/scss-C_sc8enw.js","assets/apl-BvMMMvlM.js","assets/xml-CGYBKmq2.js","assets/java-DLdU51RX.js","assets/json-BP2JFEth.js","assets/astro-5GH4n63k.js","assets/typescript-C0I5qU9Q.js","assets/postcss-BXeXVLqQ.js","assets/tsx-BYhombzc.js","assets/blade-FVyx8_pi.js","assets/html-derivative-Bp9FFIai.js","assets/sql-tNQIlitF.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-BR4hIuAS.js","assets/coffee-CV_krZ_v.js","assets/cpp-BcL5kNR1.js","assets/regexp-CuieyCDo.js","assets/glsl-Bzz9G3Ya.js","assets/c-DaWGyzOq.js","assets/crystal-uM0LOVx9.js","assets/shellscript-BJkeugYw.js","assets/edge-D0oESfMY.js","assets/elixir-CaEILBcp.js","assets/elm-ZyUnRSna.js","assets/erb-BEOXg7uE.js","assets/ruby-Dbe_ekvV.js","assets/haml-B3JO2g53.js","assets/graphql-CFv-7q2r.js","assets/jsx-WD857QYb.js","assets/lua-Bt6jto6s.js","assets/yaml-UlGSIJg6.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-LAaHyDt5.js","assets/glimmer-js-DnRAU-8r.js","assets/glimmer-ts-B_9lY4Cg.js","assets/hack-BQq89007.js","assets/handlebars-BVxFlQdu.js","assets/http-OxvOel0d.js","assets/hurl-BR8OTQDL.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-JHLjBiC-.js","assets/jison-MADSp4PV.js","assets/julia-DFzHTS-P.js","assets/r-lYZIQvFq.js","assets/just-Cr1WcUSw.js","assets/perl-vPUc98Xz.js","assets/latex-C4Jp4eq5.js","assets/tex-BlMK__2U.js","assets/liquid-BOlUcl5B.js","assets/marko-B4gbbHnu.js","assets/less-DVTAwKKz.js","assets/mdc-D4PTgKs-.js","assets/nextflow-Bbiyy34d.js","assets/nextflow-groovy-Dc_ddanL.js","assets/nginx-CTDO1ewa.js","assets/nim-BOQk_yKn.js","assets/php-DeCmiyAV.js","assets/pug-DrCcomsb.js","assets/qml-BYMwIH9I.js","assets/razor-BsZLkc5_.js","assets/csharp-Ct8U2NOr.js","assets/rst-Buwxy6i8.js","assets/cmake-Bj61d0ZC.js","assets/sas-P1b9K4Ys.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-BQdMaoZE.js","assets/soy-CnADQkBx.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-Dbj2lGXX.js","assets/surrealql-CUlk2o6E.js","assets/svelte-BnEKKmXX.js","assets/templ-DGjxt26F.js","assets/go-BJwz_mda.js","assets/ts-tags-C3cZCmwl.js","assets/twig-BCBpfD3_.js","assets/vue-Ba5J_YU2.js","assets/vue-html-CMnkOyKm.js","assets/vue-vine-BLdNBabV.js","assets/stylus-B6D30XZt.js","assets/xsl-CJoMbcve.js","assets/mermaid.core-CqYAvE1t.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BhNX2bDa.js","assets/chunk-O7XYJQB3-BvAi6lqO.js","assets/chunk-ZIGJFQKS-CdlwxgjL.js","assets/dist-j4SBNV0D.js","assets/chunk-742MDFTN-Bp0YWssF.js","assets/chunk-MBY4JIJT-Cm_QlcR_.js","assets/chunk-DUW6YSOI-Dgx8z5s3.js","assets/chunk-7PRAP22T-goNAa0SG.js","assets/chunk-7INBJB4K-DxjXTyxf.js","assets/chunk-J5ZVWO5B-oDCd-gWO.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-5DYCD2WN-Dymfs607.js","assets/chunk-Z7XXMR3K-u1Fym3iI.js","assets/line-C5_ag20i.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-UA2S7LBM-CQaD7SEi.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=h(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),L=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),se=Symbol.for(`react.recoverable`),ce=Symbol.iterator;function le(e){return typeof e!=`object`||!e?null:(e=ce&&e[ce]||e[`@@iterator`],typeof e==`function`?e:null)}var ue=Symbol.for(`react.client.reference`);function de(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case ee:return`Suspense`;case L:return`SuspenseList`;case re:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var fe=Array.isArray,R=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function ve(e,t){he++,me[he]=e.current,e.current=t}var ye=ge(null),be=ge(null),xe=ge(null),Se=ge(null);function Ce(e,t){switch(ve(xe,t),ve(be,e),ve(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vp(t),e=yp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ye),ve(ye,e)}function we(){_e(ye),_e(be),_e(xe)}function Te(e){var t=e.memoizedState;t!==null&&(hh._currentValue=t.memoizedState,ve(Se,e)),t=ye.current;var n=yp(t,e.type);t!==n&&(ve(be,e),ve(ye,n))}function Ee(e){be.current===e&&(_e(ye),_e(be)),Se.current===e&&(_e(Se),hh._currentValue=pe)}var De,Oe;function ke(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+De+e+Oe}var Ae=!1;function je(e,t){if(!e||Ae)return``;Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ke(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke(`Lazy`);case 13:return e.child!==t&&t!==null?ke(`Suspense Fallback`):ke(`Suspense`);case 19:return ke(`SuspenseList`);case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return ke(`Activity`);case 30:return ke(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,ze=t.unstable_now,Be=t.unstable_getCurrentPriorityLevel,Ve=t.unstable_ImmediatePriority,He=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,We=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,qe=t.unstable_setDisableYieldValue,Je=null,Ye=null;function Xe(e){if(typeof Ke==`function`&&qe(e),Ye&&typeof Ye.setStrictMode==`function`)try{Ye.setStrictMode(Je,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function at(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function st(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lt(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=z.p;return e===0?(e=window.event,e===void 0?32:jh(e.type)):e}function yt(e,t){var n=z.p;try{return z.p=e,t()}finally{z.p=n}}var bt=Math.random().toString(36).slice(2),xt=`__reactFiber$`+bt,St=`__reactProps$`+bt,Ct=`__reactContainer$`+bt,wt=`__reactEvents$`+bt,Tt=`__reactListeners$`+bt,Et=`__reactHandles$`+bt,Dt=`__reactResources$`+bt,Ot=`__reactMarker$`+bt,kt=`__reactLoad$`+bt;function At(e){delete e[xt],delete e[St],delete e[Tt],delete e[Et]}function jt(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bm(e);e!==null;){if(n=e[xt])return n;e=bm(e)}return t}e=n,n=e.parentNode}return null}function Mt(e){if(e=e[xt]||e[Ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Nt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Pt(e){var t=e[Dt];return t||=e[Dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ft(e){e[Ot]=!0}function It(e){e[kt]=void 0}var Lt=new Set,Rt={};function zt(e,t){Bt(e,t),Bt(e+`Capture`,t)}function Bt(e,t){for(Rt[e]=t,e=0;e<t.length;e++)Lt.add(t[e])}var Vt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ht={},Ut={};function Wt(e){return Pe.call(Ut,e)?!0:Pe.call(Ht,e)?!1:Vt.test(e)?Ut[e]=!0:(Ht[e]=!0,!1)}var Gt=!1;function Kt(){var e=Gt;return Gt=!1,e}function qt(e,t,n){if(Wt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Yt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Qt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $t(e){if(!e._valueTracker){var t=Zt(e)?`checked`:`value`;e._valueTracker=Qt(e,t,``+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var tn=/[\n"\\]/g;function nn(e){return e.replace(tn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function rn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):on(e,Xt(n)):o===`number`&&e.value==t?on(e,Xt(e.value)):on(e,Xt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Xt(s):e.removeAttribute(`name`)}function an(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){$t(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),$t(e)}function on(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function sn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Xt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cn(e,t,n){if(t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Xt(n)}function ln(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(fe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),$t(e)}function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function fn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||dn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function pn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Gt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(fn(e,a,r),Gt=!0)}else for(var o in t)t.hasOwnProperty(o)&&fn(e,o,t[o])}function mn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var hn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),gn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _n(e){return gn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function vn(){}var yn=null;function bn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xn=null,Sn=null;function Cn(e){var t=Mt(e);if(t&&(e=t.stateNode)){var n=e[St]||null;a:switch(e=t.stateNode,t.type){case`input`:if(rn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+nn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[St]||null;if(!a)throw Error(i(90));rn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&en(r)}break a;case`textarea`:cn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&sn(e,!!n.multiple,t,!1)}}}var wn=!1;function Tn(e,t,n){if(wn)return e(t,n);wn=!0;try{return e(t)}finally{if(wn=!1,(xn!==null||Sn!==null)&&(Wd(),xn&&(t=xn,e=Sn,Sn=xn=null,Cn(t),e)))for(t=0;t<e.length;t++)Cn(e[t])}}function En(e,t){var n=e.stateNode;if(n===null)return null;var r=n[St]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,On=!1;if(Dn)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){On=!0}}),window.addEventListener(`test`,kn,kn),window.removeEventListener(`test`,kn,kn)}catch{On=!1}var An=null,jn=null,Mn=null;function Nn(){if(Mn)return Mn;var e,t=jn,n=t.length,r,i=`value`in An?An.value:An.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Mn=i.slice(e,1<r?1-r:void 0)}function Pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fn(){return!0}function In(){return!1}function Ln(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Fn:In,this.isPropagationStopped=In,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Fn)},persist:function(){},isPersistent:Fn}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zn=Ln(Rn),Bn=D({},Rn,{view:0,detail:0}),Vn=Ln(Bn),Hn,Un,Wn,Gn=D({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Wn&&(Wn&&e.type===`mousemove`?(Hn=e.screenX-Wn.screenX,Un=e.screenY-Wn.screenY):Un=Hn=0,Wn=e),Hn)},movementY:function(e){return`movementY`in e?e.movementY:Un}}),Kn=Ln(Gn),qn=Ln(D({},Gn,{dataTransfer:0})),Jn=Ln(D({},Bn,{relatedTarget:0})),Yn=Ln(D({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Ln(D({},Rn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Ln(D({},Rn,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Ln(D({},Bn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Ln(D({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Ln(D({},Rn,{submitter:0})),or=Ln(D({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),sr=Ln(D({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),cr=Ln(D({},Gn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),lr=Ln(D({},Rn,{newState:0,oldState:0,source:0})),ur=[9,13,27,32],dr=Dn&&`CompositionEvent`in window,fr=null;Dn&&`documentMode`in document&&(fr=document.documentMode);var pr=Dn&&`TextEvent`in window&&!fr,mr=Dn&&(!dr||fr&&8<fr&&11>=fr),hr=` `,gr=!1;function _r(e,t){switch(e){case`keyup`:return ur.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function B(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var vr=!1;function yr(e,t){switch(e){case`compositionend`:return B(t);case`keypress`:return t.which===32?(gr=!0,hr):null;case`textInput`:return e=t.data,e===hr&&gr?null:e;default:return null}}function br(e,t){if(vr)return e===`compositionend`||!dr&&_r(e,t)?(e=Nn(),Mn=jn=An=null,vr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return mr&&t.locale!==`ko`?null:t.data;default:return null}}var xr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!xr[e.type]:t===`textarea`}function Cr(e,t,n,r){xn?Sn?Sn.push(r):Sn=[r]:xn=r,t=tp(t,`onChange`),0<t.length&&(n=new zn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var wr=null,Tr=null;function Er(e){qf(e,0)}function Dr(e){if(en(Nt(e)))return e}function Or(e,t){if(e===`change`)return t}var kr=!1;if(Dn){var Ar;if(Dn){var jr=`oninput`in document;if(!jr){var Mr=document.createElement(`div`);Mr.setAttribute(`oninput`,`return;`),jr=typeof Mr.oninput==`function`}Ar=jr}else Ar=!1;kr=Ar&&(!document.documentMode||9<document.documentMode)}function Nr(){wr&&(wr.detachEvent(`onpropertychange`,Pr),Tr=wr=null)}function Pr(e){if(e.propertyName===`value`&&Dr(Tr)){var t=[];Cr(t,Tr,e,bn(e)),Tn(Er,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),wr=t,Tr=n,wr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Dr(Tr)}function Lr(e,t){if(e===`click`)return Dr(t)}function Rr(e,t){if(e===`input`||e===`change`)return Dr(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Pe.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hr(e.document)}return t}function Kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var qr=Dn&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Hr(r)||(r=Jr,`selectionStart`in r&&Kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xr&&Vr(Xr,r)||(Xr=r,r=tp(Yr,`onSelect`),0<r.length&&(t=new zn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};Dn&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),di=new Map,fi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);fi.push(`scrollEnd`);function pi(e,t){di.set(e,t),zt(t,[e])}var mi=0;function hi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=mi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function gi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function _i(e,t){return e=gi(e),t=gi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var vi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},yi=[],bi=0,xi=0;function Si(){for(var e=bi,t=xi=bi=0;t<e;){var n=yi[t];yi[t++]=null;var r=yi[t];yi[t++]=null;var i=yi[t];yi[t++]=null;var a=yi[t];if(yi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ei(n,i,a)}}function Ci(e,t,n,r){yi[bi++]=e,yi[bi++]=t,yi[bi++]=n,yi[bi++]=r,xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function wi(e,t,n,r){return Ci(e,t,n,r),Di(e)}function Ti(e,t){return Ci(e,null,null,t),Di(e)}function Ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Di(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function ki(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(e,t,n,r){return new ki(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,t){var n=e.alternate;return n===null?(n=Ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ni(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ji(r)&&(s=1);else if(typeof r==`string`)s=th(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case re:return e=Ai(31,n,t,a),e.elementType=re,e.lanes=o,e;case j:return Fi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ai(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case ee:return e=Ai(13,n,t,a),e.elementType=ee,e.lanes=o,e;case L:return e=Ai(19,n,t,a),e.elementType=L,e.lanes=o,e;case ie:case oe:return e=a|32,e=Ai(30,n,t,e),e.elementType=oe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case te:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function Ii(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Li(e){var t=Ai(18,null,null,0);return t.stateNode=e,t}function Ri(e,t,n){return t=Ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zi=new WeakMap;function Bi(e,t){if(typeof e==`object`&&e){var n=zi.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},zi.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var Vi=[],Hi=0,Ui=null,Wi=0,Gi=[],Ki=0,qi=null,Ji=1,Yi=``;function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Ui,Ui=e,Wi=t}function Zi(e,t,n){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,qi=e;var r=Ji;e=Yi;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ji=1<<32-Ze(t)+i|n<<i|r,Yi=a+e}else Ji=1<<a|n<<i|r,Yi=e}function Qi(e){e.return!==null&&(Xi(e,1),Zi(e,1,0))}function $i(e){for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null;for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Yi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null}function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,Ji=t.id,Yi=t.overflow,qi=e}var ta=null,na=null,ra=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[xt]=e,t[St]=r,n){case`dialog`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),an(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`invalid`,t),ln(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||sp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`scrollend`,t),r.onClick!=null&&(t.onclick=vn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:ta=ta.return}}function ua(e){if(e!==ta)return!1;if(!ra)return la(e),ra=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||xp(e.type,e.memoizedProps)),n=!n),n&&na&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=ym(e)}else t===27?(t=na,Ap(e.type)?(e=vm,vm=null,na=e):na=t):na=ta?_m(e.stateNode.nextSibling):null;return!0}function da(){na=ta=null,ra=!1}function fa(){var e=ia;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=ge(null),ha=null,ga=null;function _a(e,t,n){ve(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,_e(ma)}function ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ba(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ya(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function xa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[hh]:e.push(hh))}a=a.return}return e!==null&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Bf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ua=R.S;R.S=function(e,t){if(bd=ze(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=Ef;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=ge(null);function Ga(){var e=Wa.current;return e===null?td.pooledCache:e}function Ka(e,t){t===null?ve(Wa,Wa.current):ve(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function H(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vn,vn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(vn,vn);else{if(e=td,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e}throw eo=t,Ja}}function $a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(eo=e,Ja):e}}var eo=null;function to(){if(eo===null)throw Error(i(459));var e=eo;return eo=null,e}function no(e){if(e===Ja||e===Xa)throw Error(i(483))}var ro=null,io=0;function ao(e){var t=io;return io+=1,ro===null&&(ro=[]),H(ro,e,t)}function oo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function so(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function co(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Mi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),oo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&$a(i)===t.type)?(t=a(t,n.props),oo(t,n),t.return=e,t):(t=Pi(n.type,n.key,n.props,null,e.mode,r),oo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Pi(t.type,t.key,t.props,null,e.mode,n),oo(n,t),n.return=e,n;case A:return t=Ri(t,e.mode,n),t.return=e,t;case ne:return t=$a(t),f(e,t,n)}if(fe(t)||le(t))return t=Fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ao(t),n);if(t.$$typeof===F)return f(e,Ta(e,t),n);so(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ne:return n=$a(n),p(e,t,n,r)}if(fe(n)||le(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ao(n),r);if(n.$$typeof===F)return p(e,t,Ta(e,n),r);so(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=$a(r),m(e,t,n,r,i)}if(fe(r)||le(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ao(r),i);if(r.$$typeof===F)return m(e,t,n,Ta(t,r),i);so(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ra&&Xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ra&&Xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ra&&Xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ra&&Xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ra&&Xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ra&&Xi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),oo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&$a(l)===r.type){n(e,r.sibling),c=a(r,o.props),oo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Fi(o.props.children,e.mode,c,o.key),oo(c,o),c.return=e,e=c):(c=Pi(o.type,o.key,o.props,null,e.mode,c),oo(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ri(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=$a(o),_(e,r,o,c)}if(fe(o))return h(e,r,o,c);if(le(o)){if(l=le(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ao(o),c);if(o.$$typeof===F)return _(e,r,Ta(e,o),c);so(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{io=0;var i=_(e,t,n,r);return ro=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=Ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var lo=co(!0),uo=co(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ed&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Di(e),Ei(e,null,n),t}return Ci(e,r,t,n),Di(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function vo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function bo(){if(yo){var e=za;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(rd&f)===f:(r&f)===f){f!==0&&f===Ra&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Co(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var wo=ge(null),To=ge(0);function Eo(e,t){e=ld,ve(To,e),ve(wo,t),ld=e|t.baseLanes}function Do(){ve(To,ld),ve(wo,wo.current)}function Oo(){ld=To.current,_e(wo),_e(To)}var ko=ge(null),Ao=null;function jo(e){var t=e.alternate;ve(Io,Io.current&1),ve(ko,e),Ao===null&&(t===null||wo.current!==null||t.memoizedState!==null)&&(Ao=e)}function Mo(e){ve(Io,Io.current),ve(ko,e),Ao===null&&(Ao=e)}function No(e){e.tag===22?(ve(Io,Io.current),ve(ko,e),Ao===null&&(Ao=e)):Po()}function Po(){ve(Io,Io.current),ve(ko,ko.current)}function Fo(e){_e(ko),Ao===e&&(Ao=null),_e(Io)}var Io=ge(0);function Lo(e,t){ve(ko,ko.current),ve(Io,t)}function Ro(e){_e(Io),_e(ko),Ao===e&&(Ao=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mm(n)||hm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Bo=0,U=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,W=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Bo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?pc:mc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){R.H=fc;var t=Vo!==null&&Vo.next!==null;if(Bo=0,Ho=Vo=U=null,Uo=!1,W=0,qo=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&Sa(e)&&(jc=!0))}function $o(e,t,n,r){U=e;var a=0;do{if(Wo&&(qo=null),W=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}R.H=hc,o=t(n,r)}while(Wo);return o}function es(){var e=R.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(U.flags|=1024),t}function ts(){var e=Ko!==0;return Ko=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}Bo=0,Ho=Vo=U=null,Wo=!1,W=Ko=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function as(){if(Vo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?U.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=W;return W+=1,qo===null&&(qo=[]),e=H(qo,e,t),t=U,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?pc:mc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===se)return;if(e.$$typeof===F)return wa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=os(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),Vo,e)}function fs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Bo&f)===f:(rd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ra&&(d=!0);else if((Bo&p)===p){u=u.next,p===Ra&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,dd|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(jc=!0,d&&(n=za,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ps(e){var t=as(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Br(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=U,a=as(),o=ra;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Bo&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=os(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function ys(e){var t=Ti(e,2);t!==null&&zd(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Go){Xe(!0);try{n()}finally{Xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,Vo,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(lc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};R.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=R.T,o={};o.types=a===null?null:a.types,R.T=o;try{var s=n(i,r),c=R.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),R.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(ra){var n=td.formState;if(n!==null){a:{var r=U;if(ra){if(na){b:{for(var i=na,a=aa;i.nodeType!==8;){if(!a){i=null;break b}if(i=_m(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){na=_m(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=oc.bind(null,U,r),r.dispatch=n,r=bs(!1),a=cc.bind(null,U,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),Vo,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=Vo;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=os(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();U.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Xo(r,Vo.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(U.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=os(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function G(e,t){return Ls(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Go){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Bo&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),U.lanes|=e,dd|=e,n)}function Ys(e,t,n,r){return Br(n,t)?n:wo.current===null?!(Bo&106)||Bo&1073741824&&!(rd&261930)?(jc=!0,e.memoizedState=n):(e=Ld(),U.lanes|=e,dd|=e,t):(e=Js(e,n,r),Br(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=z.p;z.p=a!==0&&8>a?a:8;var o=R.T,s={};s.types=o===null?null:o.types,R.T=s,cc(e,!1,t,n);try{var c=i(),l=R.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Ha(c,r),Id(e)):sc(e,t,r,Id(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{z.p=a,o!==null&&s.types!==null&&(o.types=s.types),R.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,pe,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Id())}function tc(){return wa(hh)}function nc(){return as().memoizedState}function rc(){return as().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=ho(n);var r=go(t,e,n);r!==null&&(zd(r,t,n),_o(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=wi(e,t,n,r),n!==null&&(zd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Id())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Br(s,o))return Ci(e,t,i,0),td===null&&Si(),!1}catch{}if(n=wi(e,t,i,r),n!==null)return zd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=wi(e,n,r,2),t!==null&&zd(t,e,2)}function lc(e){var t=e.alternate;return e===U||t!==null&&t===U}function uc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var fc={readContext:wa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},pc={readContext:wa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Go){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Go){Xe(!0);try{n(t)}finally{Xe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=oc.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Xs.bind(null,U,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=is();if(ra){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=td.identifierPrefix;if(ra){var n=Yi,r=Ji;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ic.bind(null,U)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:wa,use:cs,useCallback:Ks,useContext:wa,useEffect:zs,useImperativeHandle:Ws,useInsertionEffect:Hs,useLayoutEffect:G,useMemo:qs,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(as(),Vo.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:nc,useHostTransitionStatus:tc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),Vo,e,t)},useMemoCache:ls,useCacheRefresh:rc,useEffectEvent:Vs},hc={readContext:wa,use:cs,useCallback:Ks,useContext:wa,useEffect:zs,useImperativeHandle:Ws,useInsertionEffect:Hs,useLayoutEffect:G,useMemo:qs,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=as();return Vo===null?Js(n,e,t):Ys(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:nc,useHostTransitionStatus:tc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,Vo,e,t)},useMemoCache:ls,useCacheRefresh:rc,useEffectEvent:Vs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(zd(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(zd(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(zd(t,e,n),_o(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vr(n,r)||!Vr(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){vi(e)}function Sc(e){console.error(e)}function Cc(e){vi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=ho(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=ko.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ao===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(ra)return t=ko.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Bi(r,n),a=Ec(e.stateNode,r,a),vo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Bi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),vo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),vo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?uo(t,null,n,r):lo(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ca(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!jc?(ns(e,t,i),sl(e,t,i)):(ra&&s&&Qi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ji(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Do():Eo(t,a),No(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Do(),Po()):(Ka(t,a.cachePool),Eo(t,a),Po(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Do(),No(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return lo(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ra){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Mo(t),(e=na)?(e=pm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(wo.current===null){if(r=td,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ti(e,s),zd(r,e,s),Ac;Zd()}t=Bc(e,t,n)}else e=o.treeContext,na=_m(s.nextSibling),ta=t,ra=!0,ia=null,aa=!1,e!==null&&ea(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return Ca(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!jc?(ns(e,t,i),sl(e,t,i)):(ra&&r&&Qi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!jc?(ns(e,t,a),sl(e,t,a)):(ra&&r&&Qi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=Oi,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):Oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Oi,typeof u==`object`&&u&&(o=wa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=fo||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Oi,typeof l==`object`&&l&&(c=wa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=fo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=lo(t,e.child,null,i),t.child=lo(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return da(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:qa()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ra){if(i?jo(t):Po(),(e=na)?(e=pm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw sa(t);return t.lanes=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Fi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(jo(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Mi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Fi(i,a,n,null),i.flags|=2):i=Mi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=Mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Ai(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return lo(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=Fi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,lo(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),hm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(wo.current!==null)return $c(e,t,c);if(r=td,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ti(e,a),zd(r,e,a),Ac;return mm(o)||Zd(),$c(e,t,c)}return mm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,na=_m(o.nextSibling),ta=t,ra=!0,ia=null,aa=!1,e!==null&&ea(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=ra?Wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function ll(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:Te(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(jo(t),e=sl(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,ra&&t.flags&1048576&&Zi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=$a(t.elementType),t.type=e,typeof e==`function`)ji(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===te){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=de(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(e,t,r,a,n);case 3:a:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,mo(e,t),xo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),bo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==a){a=Bi(Error(i(424)),t),pa(a),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(na=_m(e.firstChild),ta=t,ra=!0,ia=null,aa=!0,n=uo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ra||(t.stateNode=bp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&ra&&(r=t.stateNode=Cm(t.type,t.pendingProps,xe.current),ta=t,aa=!0,a=na,Ap(t.type)?(vm=a,na=_m(r.firstChild)):na=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ra&&((a=r=na)&&(r=dm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,ta=t,na=_m(r.firstChild),aa=!1,a=!0)),a||sa(t)),Te(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,xp(a,o)?r=null:s!==null&&xp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),hh._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&ra&&((e=n=na)&&(n=fm(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,ta=t,na=null,e=!0)),e||sa(t)),null;case 13:return Xc(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=td,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},po(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ra&&Qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?nh(t,r):nh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Jd())e.flags|=8192;else throw eo=Za,Ya}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t)){if(Jd())e.flags|=8192;else throw eo=Za,Ya}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,hd|=t)}function hl(e,t){if(!ra)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch($i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),we(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,a,e,r,n)),null;case 27:if(Ee(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=ye.current,ua(t)?ca(t,e):(e=Cm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ee(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=ye.current,ua(t))ca(t,o);else{var s=_p(xe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[xt]=t,o[St]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(up(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ta,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||sp(e.nodeValue,n)),e||sa(t,!0)}else e=_p(e).createTextNode(r),e[xt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[xt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[xt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return we(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return va(t.type),gl(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ni(n,e),n=n.sibling;return Lo(t,Io.current&1|2),ra&&Xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ze()>xd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ra)return gl(t),null}else 2*ze()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ra?Lo(t,o):(n=o,ve(ko,t),ve(Io,n),Ao===null&&(Ao=t)),ra&&Xi(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Fo(t),Oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_e(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(e,t){switch($i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),we(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ee(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return we(),null;case 10:return va(t.type),null;case 22:case 23:return Fo(t),Oo(),e!==null&&_e(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function yl(e,t){switch($i(t),t.tag){case 3:va(Aa),we();break;case 26:case 27:case 5:Ee(t);break;case 4:we();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:va(t.type);break;case 22:case 23:Fo(t),Oo(),e!==null&&_e(Wa);break;case 24:va(Aa)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){yf(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Co(t,n)}catch(t){yf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=hi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);p(e.child,!1,om,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){yf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){yf(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)cm(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&cm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&lm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){yf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[St]=t}catch(t){yf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ap(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vn)),El(e,r),Gt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),Gt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[xt]=e,t[St]=n}catch(t){yf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ip(o);r.push(s),s.view&&(a=!0)}else a||Ip(o).view&&(a=!0);Rl=!0,Np(o,Ul===0?t:t+`_`+Ul,n),Ul++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Kl(e.child,t)),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=_i(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=hi(r,n),a=_i(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Rd(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=_i(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=_i(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Rd(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode);t=_i(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Ip(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Np(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=hi(n,r),a=_i(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Lp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,hp=wh,e=V(e),Kr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(gp={focusedElem:e,selectionRange:r},wh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}zl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)um(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:um(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=hi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=_i(a.default,a.update),a!==`none`&&Wl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&bl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Co(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Fu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),ru=t,iu=i}break;case 30:Fu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){yf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Gt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&At(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount==`function`)try{Ye.onCommitFiberUnmount(Je,n)}catch{}switch(n.tag){case 26:iu||Tl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||Tl(n,t),Ol(n);var r=bu,i=xu;Ap(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:iu||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),Gt=!0}catch(e){yf(n,t,e)}else try{bu.removeChild(n.stateNode),Gt=!0}catch(e){yf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xh(e)):jp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),iu||xl(4,n,t),Su(e,t,n);break;case 1:iu||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,Su(e,t,n),iu=r;break;case 30:Tl(n,t),Su(e,t,n);break;case 7:iu||Tl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xh(e)}catch(e){yf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xh(e)}catch(e){yf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ap(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ku,Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=bp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ot]||r[xt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),up(r,t,n),r[xt]=e,Ft(r),t=r;break a;case`link`:if(o=$m(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=$m(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[xt]=e,Ft(r),t=r}e.stateNode=t}}else ru||eh(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||eh(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Ou(t,e,n),au=o,ju(e),a&512&&(iu||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{un(t,``),Gt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Gt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Gt=!1,Qm=null,o=ku,ku=Om(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xh(t.containerInfo)}catch(t){yf(e,e.return,t)}ou&&(ou=!1,Mu(e)),Gt=!1;break;case 4:a=au,au=ru,r=Kt(),o=ku,ku=Om(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Gt&&uu&&(du=!0),Gt=r,au=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=ze()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Ou(t,e,n),iu=l,au=u,ru=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Iu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(iu||r===null||Tl(r,r.return)),a=Kt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&_i(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Gt&&(e.flags|=4),uu=o,Gt=a;break;case 21:break;case 7:a&512&&(iu||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(un(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,wh=!0,t.reset(),wh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else nu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Nu(t,e),!lu&&!du){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Pp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Vl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Nu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=hi(a,o),o=hi(n.memoizedProps,o);var s=_i(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Iu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Iu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Iu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Tl(n,n.return),Iu(n,r);break;case 7:Tl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),bl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||eh(Om(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),wl(a,a.return);break;case 30:Lu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ma(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&bl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){yf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ah(n,e)):oh(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&ah(n,e));break;case 3:case 4:var r=ku;ku=Om(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,ed=0,td=null,nd=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return ed&2&&rd!==0?rd&-rd:R.T===null?vt():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||ra){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),md=e}else md=536870912}return e=ko.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(hi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===td&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,rd,md,!1)),dt(e,n),(!(ed&2)||e!==td)&&(e===td&&(!(ed&2)&&(fd|=n),ud===4&&Ud(e,rd,md,!1)),Mf(e))}function Bd(e,t,n){if(ed&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-ze(),10<a)){if(Ud(r,t,md,!od),at(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=wp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vn},zl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=uh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-ze():(a&4194048)===a?bd-ze():0,m=ch(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=st(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Wd(){return ed&6?!0:(Nf(0,!1),!1)}function Gd(){if(nd!==null){if(id===0)var e=nd.return;else e=nd,ga=ha=null,rs(e),ro=null,io=0,e=nd;for(;e!==null;)yl(e.alternate,e),e=e.return;nd=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),td=e,nd=n=Mi(e.current,null),rd=t,id=0,ad=null,od=!1,sd=ot(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=st(e,t),Si(),n}function qd(e,t){U=null,R.H=fc,t===Ja||t===Xa?(t=to(),id=3):t===Ya?(t=to(),id=4):id=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,wc(e,Bi(t,e.current)))}function Jd(){var e=ko.current;return e===null?!0:(rd&4194048)===rd?Ao===null:(rd&62914560)===rd||rd&536870912?e===Ao:!1}function Yd(){var e=R.H;return R.H=fc,e===null?fc:e}function Xd(){var e=R.A;return R.A=Qu,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&ko.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||td===null||Ud(td,rd,md,!1)}function Qd(e,t,n){var r=ed;ed|=2;var i=Yd(),a=Xd();(td!==e||rd!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&nd!==null){var s=nd,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:ko.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,ed=r,R.H=i,R.A=a,nd===null&&(td=null,rd=0,Si()),o}function $d(){for(;nd!==null;)nf(nd)}function ef(e,t){var n=ed;ed|=2;var r=Yd(),a=Xd();td!==e||rd!==t?(Sd=null,xd=ze()+500,Kd(e,t)):sd=ot(e,t);a:do try{if(id!==0&&nd!==null){t=nd;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(Qa(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||td!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Qa(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(nd.tag){case 26:s=nd.memoizedState;case 5:case 27:var c=nd;if(s?rh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)nd=l;else{var u=c.return;u===null?nd=null:(nd=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return ga=ha=null,R.H=r,R.A=a,ed=n,nd===null?(td=null,rd=0,Si(),ud):0}function tf(){for(;nd!==null&&!Le();)nf(nd)}function nf(e){var t=ul(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:rs(t);var r=t;r===ta&&(ra?(la(r),r.tag===5&&r.stateNode!=null&&(na=r.stateNode)):(la(r),ra=!0));default:yl(n,t),t=nd=Ni(t,ld),t=ul(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function af(e,t,n,r){ga=ha=null,rs(t),ro=null,io=0;var i=t.return;try{if(kc(e,i,t,n,rd)){ud=1,wc(e,Bi(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,wc(e,Bi(n,e.current)),nd=null;return}t.flags&32768?(ra||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=ko.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=_l(t.alternate,t,ld);if(n!==null){nd=n;return}if(t=t.sibling,t!==null){nd=t;return}nd=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,nd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nd=e;return}nd=e=n}while(e!==null);ud=6,nd=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(ed&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(nd=td=null,rd=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=xi,ft(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Fa(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ue,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=R.T,R.T=null,i=z.p,z.p=2,a=ed,ed|=4;try{pu(e,t,n)}finally{ed=a,z.p=i,R.T=r}}wd=1,Rl?jd=Bp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Pu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=R.T,R.T=null;var i=z.p;z.p=2;var a=ed;ed|=4;try{uu=du=!1,Au(t,e,n),n=gp;var o=V(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&Kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Wr(s,h),v=Wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}wh=!!hp,gp=hp=null}finally{ed=a,z.p=i,R.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=R.T,R.T=null;var r=z.p;z.p=2;var i=ed;ed|=4;try{hu(e,t.alternate,t)}finally{ed=i,z.p=r,R.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Re();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),_t(r),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot==`function`)try{Ye.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=R.T,a=z.p,z.p=2,R.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{R.T=n,z.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=_t(Dd),r=R.T,a=z.p;try{z.p=32>n?32:n,R.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,ed&6)throw Error(i(331));var c=ed;if(ed|=4,Yu(o.current),Vu(o,o.current,s,n),ed=c,Nf(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot==`function`)try{Ye.onPostCommitFiberRoot(Je,o)}catch{}return!0}finally{z.p=a,R.T=r,hf(e,t)}}function vf(e,t,n){t=Bi(n,t),t=Ec(e.stateNode,t,2),e=go(e,t,2),e!==null&&(dt(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Bi(n,e),n=Dc(2),r=go(t,n,2),r!==null&&(Oc(n,r,t,e),dt(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>ze()-yd?ed&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=lt()),e=Ti(e,t),e!==null&&(dt(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Fe(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=rd,a=at(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Cp()&&(e=jf);for(var t=ze(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=td,n=rd,n=at(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),_t(n)){case 2:case 8:n=He;break;case 32:n=Ue;break;case 268435456:n=Ge;break;default:n=Ue}return r=Lf.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=rd;return r=at(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,ze()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Op(function(){ed&6?Fe(Ve,Pf):Ff()})}function Bf(){if(jf===0){var e=Ra;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[St]||null).action),o=r.submitter;o&&(t=(t=o[St]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new zn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<fi.length;Uf++){var Wf=fi[Uf];pi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}pi(ii,`onAnimationEnd`),pi(ai,`onAnimationIteration`),pi(oi,`onAnimationStart`),pi(`dblclick`,`onDoubleClick`),pi(`focusin`,`onFocus`),pi(`focusout`,`onBlur`),pi(si,`onTransitionRun`),pi(ci,`onTransitionStart`),pi(li,`onTransitionCancel`),pi(ui,`onTransitionEnd`),Bt(`onMouseEnter`,[`mouseout`,`mouseover`]),Bt(`onMouseLeave`,[`mouseout`,`mouseover`]),Bt(`onPointerEnter`,[`pointerout`,`pointerover`]),Bt(`onPointerLeave`,[`pointerout`,`pointerover`]),zt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),zt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),zt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),zt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}}}}function Jf(e,t){var n=t[wt];n===void 0&&(n=t[wt]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,Lt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(jh(t)){case 2:var i=Th;break;case 8:i=Eh;break;default:i=Dh}n=i.bind(null,t,n,e),i=void 0,!On||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function $f(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=jt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Tn(function(){var r=a,i=bn(n),s=[];a:{var c=di.get(e);if(c!==void 0){var l=zn,u=e;switch(e){case`keypress`:if(Pn(n)===0)break a;case`keydown`:case`keyup`:l=rr;break;case`focusin`:u=`focus`,l=Jn;break;case`focusout`:u=`blur`,l=Jn;break;case`beforeblur`:case`afterblur`:l=Jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=or;break;case ii:case ai:case oi:l=Yn;break;case ui:l=sr;break;case`scroll`:case`scrollend`:l=Vn;break;case`wheel`:l=cr;break;case`copy`:case`cut`:case`paste`:l=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ir;break;case`submit`:l=ar;break;case`toggle`:case`beforetoggle`:l=lr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=En(m,p),g!=null&&d.push(ep(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==yn&&(u=n.relatedTarget||n.fromElement)&&(jt(u)||u[Ct]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?jt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ir,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Nt(c),h=l==null?u:Nt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,jt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,np):null,c!==null&&rp(s,u,c,d,!1),l!==null&&f!==null&&rp(s,f,l,d,!0)))}a:{if(c=r?Nt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Or;else if(Sr(c)){if(kr)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&mn(r.elementType)&&(_=Or):_=Lr;if(_&&=_(e,r)){Cr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Nt(r):window,e){case`focusin`:(Sr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(s,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(s,n,i)}var y;if(dr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else vr?_r(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(mr&&n.locale!==`ko`&&(vr||b!==`onCompositionStart`?b===`onCompositionEnd`&&vr&&(y=Nn()):(An=i,jn=`value`in An?An.value:An.textContent,vr=!0)),v=tp(r,b),0<v.length&&(b=new Zn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=B(n),y!==null&&(b.data=y)))),(y=pr?yr(e,n):br(e,n))&&(b=tp(r,`onBeforeInput`),0<b.length&&(v=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function ep(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=En(e,n),i!=null&&r.unshift(ep(e,i,a)),i=En(e,t),i!=null&&r.push(ep(e,i,a))),e.tag===3)return r;e=e.return}return[]}function np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=En(n,a),l!=null&&o.unshift(ep(n,l,c))):i||(l=En(n,a),l!=null&&o.push(ep(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ip=/\r\n?/g,ap=/\u0000|\uFFFD/g;function op(e){return(typeof e==`string`?e:``+e).replace(ip,`
10
+ `).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=hn.get(n)||n,qt(e,n,r);else return}Gt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:pn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Rt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[St]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Gt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}Gt=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:cp(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:cp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:cp(e,t,s,c,n,null)}ln(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||cp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Gt=!0),o=m;break;case`name`:m!==f&&(Gt=!0),a=m;break;case`checked`:m!==f&&(Gt=!0),u=m;break;case`defaultChecked`:m!==f&&(Gt=!0),d=m;break;case`value`:m!==f&&(Gt=!0),s=m;break;case`defaultValue`:m!==f&&(Gt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&cp(e,t,p,m,r,f)}}rn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||cp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Gt=!0),p=o;break;case`defaultValue`:o!==l&&(Gt=!0),c=o;break;case`multiple`:o!==l&&(Gt=!0),s=o;default:o!==l&&cp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:cp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Gt=!0),p=a;break;case`defaultValue`:a!==o&&(Gt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&cp(e,t,s,a,r,o)}cn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:cp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Gt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:cp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&cp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:cp(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&pp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&pp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function yp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function bp(e,t,n,r){return n=_p(n).createElement(e),n[xt]=r,n[St]=t,up(n,e,t),Ft(n),n}function xp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Xh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Xh(t)}function Mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Np(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Pp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Fp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=ih(f),u>sh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=b(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=b(e),e=_p(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=jt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(p(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(p(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),am(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),am(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=b(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:um(n),At(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _m(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),At(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);At(e)}var Em=new Map,Dm=new Set;function Om(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var km=z.d;z.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Wd();return e||t}function jm(e){var t=Mt(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),Ft(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[kt]=!0,o.onload=o.onerror=function(){It(o)}),Ft(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),Ft(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Pt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);Ft(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=Pt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Ft(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=Pt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Ft(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=xe.current)?Om(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Hm(n.href),t=Pt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=Pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Em.set(e,o)),Gm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Km(n),t=Pt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+nn(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[kt]){r.loading=1;return}}else t=e.createElement(`link`),t[kt]=!0,t.onload=t.onerror=It.bind(null,t),up(t,`link`,n),Ft(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+nn(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,Ft(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ft(r),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,Ft(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,Ft(a),a):(r=n,(a=Em.get(o))&&(r=D({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ft(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ym(r,n.precedence,e));return t.instance}function Ym(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ot]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function eh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function th(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function nh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function rh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ih(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ah(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ih(t),e.suspenseyImages.push(t)),e=dh.bind(e),t.decode().then(e,e))}function oh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=uh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ft(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),Ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=uh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var sh=0;function ch(e,t){return e.stylesheets&&e.count===0&&ph(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&sh===0&&(sh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>sh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function lh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ph(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function uh(){this.count--,lh(this)}function dh(){this.imgCount--,lh(this)}var fh=null;function ph(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fh=new Map,t.forEach(mh,e),fh=null,uh.call(e))}function mh(e,t){if(!(t.state.loading&4)){var n=fh.get(e);if(n)var r=n.get(null);else{n=new Map,fh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=uh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var hh={$$typeof:F,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function gh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function _h(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function vh(e){return e?(e=Oi,e):Oi}function yh(e,t,n,r,i,a){i=vh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(zd(n,e,t),_o(n,e,t))}function bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xh(e,t){bh(e,t),(e=e.alternate)&&bh(e,t)}function Sh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&zd(t,e,67108864),xh(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Id();t=gt(t);var n=Ti(e,t);n!==null&&zd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=R.T;R.T=null;var a=z.p;try{z.p=2,Dh(e,t,n,r)}finally{z.p=a,R.T=i}}function Eh(e,t,n,r){var i=R.T;R.T=null;var a=z.p;try{z.p=8,Dh(e,t,n,r)}finally{z.p=a,R.T=i}}function Dh(e,t,n,r){if(wh){var i=Oh(r);if(i===null)$f(e,t,r,kh,n),Bh(e,r);else if(Hh(i,e,t,n,r))r.stopPropagation();else if(Bh(e,r),t&4&&-1<zh.indexOf(e)){for(;i!==null;){var a=Mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(ed&6)&&(xd=ze()+500,Nf(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&zd(s,a,2),Wd(),xh(a,2)}if(a=Oh(r),a===null&&$f(e,t,r,kh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Oh(e){return e=bn(e),Ah(e)}var kh=null;function Ah(e){if(kh=null,e=jt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return kh=e,null}function jh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var Mh=!1,Nh=null,Ph=null,Fh=null,Ih=new Map,Lh=new Map,Rh=[],zh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Bh(e,t){switch(e){case`focusin`:case`focusout`:Nh=null;break;case`dragenter`:case`dragleave`:Ph=null;break;case`mouseover`:case`mouseout`:Fh=null;break;case`pointerover`:case`pointerout`:Ih.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lh.delete(t.pointerId)}}function Vh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mt(t),t!==null&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hh(e,t,n,r,i){switch(t){case`focusin`:return Nh=Vh(Nh,e,t,n,r,i),!0;case`dragenter`:return Ph=Vh(Ph,e,t,n,r,i),!0;case`mouseover`:return Fh=Vh(Fh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ih.set(a,Vh(Ih.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lh.set(a,Vh(Lh.get(a)||null,e,t,n,r,i)),!0}return!1}function Uh(e){var t=jt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,yt(e.priority,function(){Ch(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){Ch(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Mt(n),t!==null&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Wh(e)&&n.delete(t)}function Kh(){Mh=!1,Nh!==null&&Wh(Nh)&&(Nh=null),Ph!==null&&Wh(Ph)&&(Ph=null),Fh!==null&&Wh(Fh)&&(Fh=null),Ih.forEach(Gh),Lh.forEach(Gh)}function qh(e,n){e.blockedOn===n&&(e.blockedOn=null,Mh||(Mh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kh)))}var Jh=null;function Yh(e){Jh!==e&&(Jh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===e&&(Jh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Ah(r||n)===null)continue;break}var a=Mt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xh(e){function t(t){return qh(t,e)}Nh!==null&&qh(Nh,e),Ph!==null&&qh(Ph,e),Fh!==null&&qh(Fh,e),Ih.forEach(t),Lh.forEach(t);for(var n=0;n<Rh.length;n++){var r=Rh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rh.length&&(n=Rh[0],n.blockedOn===null);)Uh(n),n.blockedOn===null&&Rh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[St]||null;if(typeof a==`function`)o||Yh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[St]||null)s=o.formAction;else if(Ah(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yh(n)}}}function Zh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Qh(e){this._internalRoot=e}$h.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yh(n,Id(),e,t,null,null)},$h.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yh(e.current,2,null,e,null,null),Wd(),t[Ct]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rh.length&&t!==0&&t<Rh[n].priority;n++);Rh.splice(n,0,e),n===0&&Uh(e)}};var eg=n.version;if(eg!==`19.3.0`)throw Error(i(527,eg,`19.3.0`));z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var tg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:R,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{Je=ng.inject(tg),Ye=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=_h(e,1,!1,null,null,n,r,null,o,s,c,Zh),e[Ct]=t.current,Zf(e),new Qh(t)}})),v=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()}))(),y=l(f(),1),b=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},x=[`light`,`dark`],S=`(prefers-color-scheme: dark)`,C=typeof window>`u`,w=y.createContext(void 0),T={setTheme:e=>{},themes:[]},E=()=>y.useContext(w)??T,D=e=>y.useContext(w)?y.createElement(y.Fragment,null,e.children):y.createElement(k,{...e}),O=[`light`,`dark`],k=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=O,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=y.useState(()=>j(i,o)),[m,h]=y.useState(()=>f===`system`?N():f),g=c?Object.values(c):a,_=y.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=N());let a=c?c[i]:i,l=t?M(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=x.includes(o)?o:null,t=x.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=y.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),b=y.useCallback(t=>{let r=N(t);h(r),f===`system`&&n&&!e&&_(`system`)},[f,e]);y.useEffect(()=>{let e=window.matchMedia(S);return e.addListener(b),b(e),()=>e.removeListener(b)},[b]),y.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),y.useEffect(()=>{_(e??f)},[e,f]);let C=y.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return y.createElement(w.Provider,{value:C},y.createElement(A,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},A=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return y.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${b.toString()})(${u})`}})}),j=(e,t)=>{if(C)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},M=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},N=e=>(e||=window.matchMedia(S),e.matches?`dark`:`light`),P=l(g(),1),F=`modulepreload`,I=function(e){return`/`+e},ee={},L=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=I(t,n),t=s(t),t in ee)return;ee[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:F,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},te=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ne=/^[\\/]{2}/;function re(e,t){return t+e.replace(/\\/g,`/`)}var ie=`popstate`;function ae(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function oe(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return de(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:fe(t)}return z(t,n,null,e)}function se(e,t){if(e===!1||e==null)throw Error(t)}function ce(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function le(){return Math.random().toString(36).substring(2,10)}function ue(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function de(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?R(t):t,state:n,key:t&&t.key||r||le(),mask:i}}function fe({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function R(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function z(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ae(e)?e:de(h.location,e,t);n&&n(r,e),l=u()+1;let d=ue(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ae(e)?e:de(h.location,e,t);n&&n(r,e),l=u();let i=ue(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return pe(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ie,d),c=e,()=>{i.removeEventListener(ie,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function pe(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),se(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:fe(t);return i=i.replace(/ $/,`%20`),!n&&ne.test(i)&&(i=r+i),new URL(i,r)}function me(e,t,n=`/`){return he(e,t,n,!1)}function he(e,t,n,r,i){let a=Pe((typeof t==`string`?R(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ge(e),s=null,c=Ne(a);for(let e=0;s==null&&e<o.length;++e)s=ke(o[e],c,r);return s}function ge(e){let t=_e(e);return ye(t),t}function _e(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;se(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=He([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(se(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),_e(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:De(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Me(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ve(e.path))a(e,t,!0,n)}),t}function ve(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ve(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ye(e){e.sort((e,t)=>e.score===t.score?Oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var be=/^:[\w-]+$/,xe=3,Se=2,Ce=1,we=10,Te=-2,Ee=e=>e===`*`;function De(e,t){let n=e.split(`/`),r=n.length;return n.some(Ee)&&(r+=Te),t&&(r+=Se),n.filter(e=>!Ee(e)).reduce((e,t)=>e+(be.test(t)?xe:t===``?Ce:we),r)}function Oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ke(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?je(u,l,s.matcher,s.compiledParams):Ae(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:He([a,d.pathname]),pathnameBase:We(He([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=He([a,d.pathnameBase]))}return o}function Ae(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Me(e.path,e.caseSensitive,e.end);return je(e,t,n,r)}function je(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Ue(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Ue(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Me(e,t=!1,n=!0){ce(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ne(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return ce(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Pe(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Fe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?R(e):e,a;return n?(n=Ve(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ie(n.substring(1),`/`):Ie(n,t)):a=t,{pathname:a,search:Ge(r),hash:Ke(i)}}function Ie(e,t){let n=Ue(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Le(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Re(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ze(e){let t=Re(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Be(e,t,n,r=!1){let i;typeof e==`string`?i=R(e):(i={...e},se(!i.pathname||!i.pathname.includes(`?`),Le(`?`,`pathname`,`search`,i)),se(!i.pathname||!i.pathname.includes(`#`),Le(`#`,`pathname`,`hash`,i)),se(!i.search||!i.search.includes(`#`),Le(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Fe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ve=e=>e.replace(/[\\/]{2,}/g,`/`),He=e=>Ve(e.join(`/`));function Ue(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var We=e=>Ue(e).replace(/^\/*/,`/`),Ge=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ke=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,qe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ye(e){return He(e.map(e=>e.route.path).filter(Boolean))||`/`}var Xe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ze(e,t){let n=e;if(typeof n!=`string`||!te.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Xe)try{let e=new URL(window.location.href),r=ne.test(n)?new URL(re(n,e.protocol)):new URL(n),a=Pe(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{ce(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Qe=new URL(`http://localhost`);function $e(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Qe)}catch{return Qe}}function et(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function tt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function nt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!et(i,n),s=!et(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!tt(e,i)||!et(i,a)))throw Error(`External navigation is not allowed`)}var rt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(rt);var it=[`GET`,...rt];new Set(it);var at=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function ot(e){try{return at.includes(new URL(e).protocol)}catch{return!1}}var st=y.createContext(null);st.displayName=`DataRouter`;var ct=y.createContext(null);ct.displayName=`DataRouterState`;var lt=y.createContext(!1);function ut(){return y.useContext(lt)}var dt=y.createContext({isTransitioning:!1});dt.displayName=`ViewTransition`;var ft=y.createContext(new Map);ft.displayName=`Fetchers`;var pt=y.createContext(null);pt.displayName=`Await`;var mt=y.createContext(null);mt.displayName=`Navigation`;var ht=y.createContext(null);ht.displayName=`Location`;var gt=y.createContext({outlet:null,matches:[],isDataRoute:!1});gt.displayName=`Route`;var _t=y.createContext(null);_t.displayName=`RouteError`;var vt=`REACT_ROUTER_ERROR`,yt=`REDIRECT`,bt=`ROUTE_ERROR_RESPONSE`;function xt(e){if(e.startsWith(`${vt}:${yt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function St(e){if(e.startsWith(`${vt}:${bt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new qe(t.status,t.statusText,t.data)}catch{}}function Ct(e,{relative:t}={}){se(wt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=y.useContext(mt),{hash:i,pathname:a,search:o}=Pt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:He([n,a])),r.createHref({pathname:s,search:o,hash:i})}function wt(){return y.useContext(ht)!=null}function Tt(){return se(wt(),`useLocation() may be used only in the context of a <Router> component.`),y.useContext(ht).location}var Et=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Dt(e){y.useContext(mt).static||y.useLayoutEffect(e)}function Ot(){let{isDataRoute:e}=y.useContext(gt);return e?Zt():kt()}function kt(){se(wt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=y.useContext(st),{basename:t,navigator:n}=y.useContext(mt),{matches:r}=y.useContext(gt),{pathname:i}=Tt(),a=JSON.stringify(ze(r)),o=y.useRef(!1);return Dt(()=>{o.current=!0}),y.useCallback((r,s={})=>{if(ce(o.current,Et),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Be(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:He([t,c.pathname])),nt(typeof r==`string`?r:fe(r),n.createHref(c),$e(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var At=y.createContext(null);function jt(){return y.useContext(At)}function Mt(e){let t=y.useContext(gt).outlet;return y.useMemo(()=>t&&y.createElement(At.Provider,{value:e},t),[t,e])}function Nt(){let{matches:e}=y.useContext(gt);return e[e.length-1]?.params??{}}function Pt(e,{relative:t}={}){let{matches:n}=y.useContext(gt),{pathname:r}=Tt(),i=JSON.stringify(ze(n));return y.useMemo(()=>Be(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ft(e,t){return It(e,t)}function It(e,t,n){se(wt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=y.useContext(mt),{matches:i}=y.useContext(gt),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;$t(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Tt(),d;if(t){let e=typeof t==`string`?R(t):t;se(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):me(e,{pathname:p});ce(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),ce(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Ut(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:He([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:He([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?y.createElement(ht.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Lt(){let e=Xt(),t=Je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=y.createElement(y.Fragment,null,y.createElement(`p`,null,`💿 Hey developer 👋`),y.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,y.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,y.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:i},n):null,o)}var Rt=y.createElement(Lt,null),zt=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=St(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(gt.Provider,{value:this.props.routeContext},y.createElement(_t.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(Vt,{error:e},t):t}};zt.contextType=lt;var Bt=new WeakMap;function Vt({children:e,error:t}){let{basename:n,navigator:r}=y.useContext(mt);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=xt(t.digest);if(e){let i=Bt.get(t);if(i)throw i;let a=Ze(e.location,n),o=a.absoluteURL||a.to;if(nt(e.location,o,$e(r),`allow-explicit`),ot(o))throw Error(`Invalid redirect location`);if(Xe&&!Bt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Bt.set(t,n),n}}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Ht({routeContext:e,match:t,children:n}){let r=y.useContext(st);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(gt.Provider,{value:e},n)}function Ut(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);se(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ye(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Rt,o&&(s<0&&c===0?($t(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?y.createElement(n.route.Component,null):n.route.element?n.route.element:e,y.createElement(Ht,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?y.createElement(zt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Wt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gt(e){let t=y.useContext(st);return se(t,Wt(e)),t}function Kt(e){let t=y.useContext(ct);return se(t,Wt(e)),t}function qt(e){let t=y.useContext(gt);return se(t,Wt(e)),t}function Jt(e){let t=qt(e),n=t.matches[t.matches.length-1];return se(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Yt(){return Jt(`useRouteId`)}function Xt(){let e=y.useContext(_t),t=Kt(`useRouteError`),n=Jt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Zt(){let{router:e}=Gt(`useNavigate`),t=Jt(`useNavigate`),n=y.useRef(!1);return Dt(()=>{n.current=!0}),y.useCallback(async(r,i={})=>{ce(n.current,Et),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Qt={};function $t(e,t,n){!t&&!Qt[e]&&(Qt[e]=!0,ce(!1,n))}y.memo(en);function en({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return It(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function tn({to:e,replace:t,state:n,relative:r}){se(wt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=y.useContext(mt);ce(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=y.useContext(gt),{pathname:s}=Tt(),c=Ot(),l=Be(e,ze(o),s,r===`path`);nt(typeof e==`string`?e:fe(e),a.createHref(l),$e(a),`reject`);let u=JSON.stringify(l);return y.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function nn(e){return Mt(e.context)}function rn(e){se(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function an({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){se(!wt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=y.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=R(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=y.useMemo(()=>{let e=Pe(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return ce(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:y.createElement(mt.Provider,{value:c},y.createElement(ht.Provider,{children:t,value:h}))}function on({children:e,location:t}){return Ft(sn(e),t)}y.Component;function sn(e,t=[]){let n=[];return y.Children.forEach(e,(e,r)=>{if(!y.isValidElement(e))return;let i=[...t,r];if(e.type===y.Fragment){n.push.apply(n,sn(e.props.children,i));return}se(e.type===rn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),se(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=sn(e.props.children,i)),n.push(a)}),n}var cn=`get`,ln=`application/x-www-form-urlencoded`;function un(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function dn(e){return un(e)&&e.tagName.toLowerCase()===`button`}function fn(e){return un(e)&&e.tagName.toLowerCase()===`form`}function pn(e){return un(e)&&e.tagName.toLowerCase()===`input`}function mn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hn(e,t){return e.button===0&&(!t||t===`_self`)&&!mn(e)}var gn=null;function _n(){if(gn===null)try{new FormData(document.createElement(`form`),0),gn=!1}catch{gn=!0}return gn}var vn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function yn(e){return e!=null&&!vn.has(e)?(ce(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ln}"`),null):e}function bn(e,t){let n,r,i,a,o;if(fn(e)){let o=e.getAttribute(`action`);r=o?Pe(o,t):null,n=e.getAttribute(`method`)||cn,i=yn(e.getAttribute(`enctype`))||ln,a=new FormData(e)}else if(dn(e)||pn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Pe(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||cn,i=yn(e.getAttribute(`formenctype`))||yn(o.getAttribute(`enctype`))||ln,a=new FormData(o,e),!_n()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(un(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=cn,r=null,i=ln,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function xn(e,t){if(e===!1||e==null)throw Error(t)}function Sn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Pe(i.pathname,t)===`/`?`${Ue(t)}/_root.${r}`:`${Ue(i.pathname)}.${r}`,i}async function Cn(e,t){if(e.id in t)return t[e.id];try{let n=await L(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wn(e){return e!=null&&typeof e.page==`string`}function Tn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function En(e,t,n){return jn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Cn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Tn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Dn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function On(e,t,{includeHydrateFallback:n}={}){return kn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function kn(e){return[...new Set(e)]}function An(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function jn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!wn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(An(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Mn(){let e=y.useContext(st);return xn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Nn(){let e=y.useContext(ct);return xn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Pn=y.createContext(void 0);Pn.displayName=`FrameworkContext`;function Fn(){let e=y.useContext(Pn);return xn(e,`You must render this element inside a <HydratedRouter> element`),e}function In(e,t){let n=y.useContext(Pn),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=y.useRef(null);y.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),y.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ln(s,p),onBlur:Ln(c,m),onMouseEnter:Ln(l,p),onMouseLeave:Ln(u,m),onTouchStart:Ln(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ln(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Rn({page:e,...t}){let n=ut(),{nonce:r}=Fn(),{router:i}=Mn(),a=y.useMemo(()=>me(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?y.createElement(Bn,{page:e,matches:a,...t}):y.createElement(Vn,{page:e,matches:a,...t})):null}function zn(e){let{manifest:t,routeModules:n}=Fn(),[r,i]=y.useState([]);return y.useEffect(()=>{let r=!1;return En(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Bn({page:e,matches:t,...n}){let r=Tt(),{future:i}=Fn(),{basename:a}=Mn(),o=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Sn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return y.createElement(y.Fragment,null,o.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Vn({page:e,matches:t,...n}){let r=Tt(),{future:i,manifest:a,routeModules:o}=Fn(),{basename:s}=Mn(),{loaderData:c,matches:l}=Nn(),u=y.useMemo(()=>Dn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=y.useMemo(()=>Dn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Sn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=y.useMemo(()=>On(d,a),[d,a]),m=zn(d);return y.createElement(y.Fragment,null,f.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>y.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>y.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Hn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}y.Component;var Un=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Un&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Wn({basename:e,children:t,useTransitions:n,window:r}){let i=y.useRef();i.current??=oe({window:r,v5Compat:!0});let a=i.current,[o,s]=y.useState({action:a.action,location:a.location}),c=y.useCallback(e=>{n===!1?s(e):y.startTransition(()=>s(e))},[n]);return y.useLayoutEffect(()=>a.listen(c),[a,c]),y.createElement(an,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Gn=y.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=y.useContext(mt),v=typeof l==`string`&&te.test(l),b=Ze(l,h);l=b.to;let x=Ct(l,{relative:r}),S=Tt(),C=null;if(o){let e=Be(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:He([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=In(n,p),D=Xn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=y.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Hn(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?y.createElement(y.Fragment,null,A,y.createElement(Rn,{page:x})):A});Gn.displayName=`Link`;var Kn=y.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Pt(a,{relative:c.relative}),d=Tt(),f=y.useContext(ct),{navigator:p,basename:m}=y.useContext(mt),h=f!=null&&tr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Pe(v,m)||v);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return y.createElement(Gn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Kn.displayName=`NavLink`;var qn=y.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=cn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=y.useContext(mt),g=$n(),_=er(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&te.test(s);return y.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?y.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});qn.displayName=`Form`;function Jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yn(e){let t=y.useContext(st);return se(t,Jn(e)),t}function Xn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Ot(),d=Tt(),f=Pt(e,{relative:o});return y.useCallback(p=>{if(hn(p,t)){p.preventDefault();let t=n===void 0?fe(d)===fe(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?y.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Zn=0,Qn=()=>`__${String(++Zn)}__`;function $n(){let{router:e}=Yn(`useSubmit`),{basename:t}=y.useContext(mt),n=Yt(),r=e.fetch,i=e.navigate;return y.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=bn(e,t);if(a.navigate===!1){let e=a.fetcherKey||Qn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function er(e,{relative:t}={}){let{basename:n}=y.useContext(mt),r=y.useContext(gt);se(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Pt(e||`.`,{relative:t})},o=Tt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:He([n,a.pathname])),fe(a)}function tr(e,{relative:t}={}){let n=y.useContext(dt);se(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Yn(`useViewTransitionState`),i=Pt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Pe(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Pe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ae(i.pathname,o)!=null||Ae(i.pathname,a)!=null}function nr(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var rr=e=>{switch(e){case`success`:return or;case`info`:return cr;case`warning`:return sr;case`error`:return lr;default:return null}},ir=Array(12).fill(0),ar=({visible:e,className:t})=>y.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},y.createElement(`div`,{className:`sonner-spinner`},ir.map((e,t)=>y.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),or=y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},y.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),sr=y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},y.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),cr=y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},y.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),lr=y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},y.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ur=y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},y.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),y.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),dr=()=>{let[e,t]=y.useState(document.hidden);return y.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},fr=1,pr=100,mr=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:fr++,hr=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-pr;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=mr(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],y.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(_r(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!y.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=mr(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},gr=(e,t)=>hr.message(e,t),_r=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,B=Object.assign(gr,{success:hr.success,info:hr.info,warning:hr.warning,error:hr.error,custom:hr.custom,message:hr.message,promise:hr.promise,dismiss:hr.dismiss,loading:hr.loading},{getHistory:()=>hr.toasts,getToasts:()=>hr.getActiveToasts()});nr(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function vr(e){return e.label!==void 0}var yr=3,br=`24px`,xr=`16px`,Sr=4e3,Cr=356,wr=14,Tr=45,Er=200;function Dr(...e){return e.filter(Boolean).join(` `)}function Or(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var kr=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=y.useState(null),[k,A]=y.useState(null),[j,M]=y.useState(!1),[N,P]=y.useState(!1),[F,I]=y.useState(!1),[ee,L]=y.useState(!1),[te,ne]=y.useState(!1),[re,ie]=y.useState(0),[ae,oe]=y.useState(0),se=y.useRef(n.duration||b||Sr),ce=y.useRef(null),le=y.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,R=fe??`default`,z=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,he=y.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=y.useMemo(()=>n.closeButton??p,[n.closeButton,p]),_e=y.useMemo(()=>n.duration||b||Sr,[n.duration,b]),ve=y.useRef(0),ye=y.useRef(0),be=y.useRef(0),xe=y.useRef(null),[Se,Ce]=x.split(`-`),we=y.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Te=dr(),Ee=y.useMemo(()=>e.swipeDirections??Or(x),[e.swipeDirections,x]),De=n.invert||t,Oe=fe===`loading`;ye.current=y.useMemo(()=>he*S+we,[he,we]),y.useEffect(()=>{se.current=_e},[_e]),y.useEffect(()=>{M(!0)},[]),y.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),y.useLayoutEffect(()=>{if(!j)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=y.useCallback(()=>{P(!0),ie(ye.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Er)},[n,d,a,ye]);y.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Te?(()=>{if(be.current<ve.current){let e=new Date().getTime()-ve.current;se.current-=e}be.current=new Date().getTime()})():se.current!==1/0&&(ve.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Te,ke]),y.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?y.createElement(`div`,{className:Dr(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},T.loading):y.createElement(ar,{className:Dr(w?.loader,n?.classNames?.loader),visible:fe===`loading`})}let je=n.icon||T?.[fe]||rr(fe);return y.createElement(`li`,{tabIndex:0,ref:le,className:Dr(_,pe,w?.toast,n?.classNames?.toast,w?.[R],n?.classNames?.[R]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":te,"data-removed":N,"data-visible":de,"data-y-position":Se,"data-x-position":Ce,"data-index":c,"data-front":ue,"data-swiping":F,"data-dismissible":z,"data-type":fe,"data-invert":De,"data-swipe-out":ee,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?re:ye.current}px`,"--initial-height":C?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),xe.current=null},onPointerDown:e=>{e.button!==2&&!Oe&&z&&(ce.current=new Date,ie(ye.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(ee||!z)return;xe.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ce.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ee.includes(e>0?`right`:`left`):Ee.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Tr||a>.11)){ie(ye.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),L(!0);return}var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),I(!1),O(null)},onPointerMove:e=>{var t,n;if(!xe.current||!z||window.getSelection()?.toString().length>0)return;let r=e.clientY-xe.current.y,i=e.clientX-xe.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Ee.includes(`top`)||Ee.includes(`bottom`)){if(Ee.includes(`top`)&&r<0||Ee.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Ee.includes(`left`)||Ee.includes(`right`))){if(Ee.includes(`left`)&&i<0||Ee.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=le.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=le.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?y.createElement(`button`,{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!z?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Dr(w?.closeButton,n?.classNames?.closeButton)},T?.close??ur):null,(fe||n.icon||n.promise)&&n.icon!==null&&(T?.[fe]!==null||n.icon)?y.createElement(`div`,{"data-icon":``,className:Dr(w?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Ae():n.promise?Ae():null,fe===`loading`?null:je):null,y.createElement(`div`,{"data-content":``,className:Dr(w?.content,n?.classNames?.content)},y.createElement(`div`,{"data-title":``,className:Dr(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?y.createElement(`div`,{"data-description":``,className:Dr(v,me,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),y.isValidElement(n.cancel)?n.cancel:n.cancel&&vr(n.cancel)?y.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{vr(n.cancel)&&z&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:Dr(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,y.isValidElement(n.action)?n.action:n.action&&vr(n.action)?y.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{vr(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:Dr(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Ar(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function jr(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?xr:br;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Mr=y.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=yr,toastOptions:g,dir:_=Ar(),gap:v=wr,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=y.useState([]),T=y.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=y.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=y.useState([]),[k,A]=y.useState(!1),[j,M]=y.useState(!1),[N,F]=y.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),I=y.useRef(null),ee=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=y.useRef(null),te=y.useRef(!1),ne=y.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||hr.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return y.useEffect(()=>hr.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{P.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),y.useEffect(()=>{if(d!==`system`){F(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?F(`dark`):F(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{F(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{F(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),y.useEffect(()=>{C.length<=1&&A(!1)},[C]),y.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=I.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===I.current||I.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),y.useEffect(()=>{if(I.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,te.current=!1)}},[I.current]),y.createElement(`section`,{ref:t,"aria-label":x??`${S} ${ee}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?y.createElement(`ol`,{key:t,dir:_===`auto`?Ar():_,tabIndex:-1,ref:I,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Cr}px`,"--gap":`${v}px`,...m,...jr(l,u)},onBlur:e=>{te.current&&!e.currentTarget.contains(e.relatedTarget)&&(te.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||te.current||(te.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>y.createElement(kr,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ne,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:v,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),Nr=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Pr(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Nr(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Fr=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ir=e=>{let t=Fr(e);return t.charAt(0).toUpperCase()+t.slice(1)},Lr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Rr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function zr(e){return e!=null}function Br(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Rr.width,a=e.size??e.height??Rr.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Lr(...c):Lr(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Rr[`stroke-width`])*Number(e.size??e.width??Rr.width)/Number(t.size??t.width??Rr.width):t.strokeWidth??Rr[`stroke-width`];return[`svg`,{...Object.entries(Rr).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&zr(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&zr(t.width)&&{[r(`width`)]:t.width},...`height`in t&&zr(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Vr(e,t={}){return Br(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Hr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ur=(0,y.createContext)({}),Wr=()=>(0,y.useContext)(Ur),Gr=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Wr()??{},b=!!c||Hr(d),[x,S,C=[]]=Vr(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Lr(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function V(e,t=[],n=[]){let r=typeof e==`string`?Pr(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(Gr,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ir(r.name)),i}var Kr={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Kr.node;var qr=V(Kr),Jr={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};Jr.node;var Yr=V(Jr),Xr={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Xr.node;var Zr=V(Xr),Qr={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Qr.node;var $r=V(Qr),ei={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};ei.node;var ti=V(ei),ni={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};ni.node;var ri=V(ni),ii={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};ii.node;var ai=V(ii),oi={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};oi.node;var si=V(oi),ci={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};ci.node;var li=V(ci),ui={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};ui.node;var di=V(ui),fi={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};fi.node;var pi=V(fi),mi={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};mi.node;var hi=V(mi),gi={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};gi.node;var _i=V(gi),vi={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};vi.node;var yi=V(vi),bi={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};bi.node;var xi=V(bi),Si={name:`corner-left-up`,size:24,node:[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]};Si.node;var Ci=V(Si),wi={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};wi.node;var Ti=V(wi),Ei={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Ei.node;var Di=V(Ei),Oi={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Oi.node;var ki=V(Oi),Ai={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};Ai.node;var ji=V(Ai),Mi={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Mi.node;var Ni=V(Mi),Pi={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Pi.node;var Fi=V(Pi),Ii={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Ii.node;var Li=V(Ii),Ri={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Ri.node;var zi=V(Ri),Bi={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Bi.node;var Vi=V(Bi),Hi={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Hi.node;var Ui=V(Hi),Wi={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Wi.node;var Gi=V(Wi),Ki={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Ki.node;var qi=V(Ki),Ji={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Ji.node;var Yi=V(Ji),Xi={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Xi.node;var Zi=V(Xi),Qi={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Qi.node;var $i=V(Qi),ea={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};ea.node;var ta=V(ea),na={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};na.node;var ra=V(na),ia={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};ia.node;var aa=V(ia),oa={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};oa.node;var sa=V(oa),ca={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};ca.node;var la=V(ca),ua={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};ua.node;var da=V(ua),fa={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};fa.node;var pa=V(fa),ma={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ma.node;var ha=V(ma),ga={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ga.node;var _a=V(ga),va={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};va.node;var ya=V(va),ba={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ba.node;var xa=V(ba),Sa={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Sa.node;var Ca=V(Sa),wa={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};wa.node;var Ta=V(wa),Ea={name:`shrink`,size:24,node:[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]};Ea.node;var Da=V(Ea),Oa={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Oa.node;var ka=V(Oa),Aa={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Aa.node;var ja=V(Aa),Ma={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Ma.node;var Na=V(Ma),Pa={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Pa.node;var Fa=V(Pa),Ia={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};Ia.node;var La=V(Ia),Ra={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};Ra.node;var za=V(Ra),Ba={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};Ba.node;var Va=V(Ba),Ha={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ha.node;var Ua=V(Ha),Wa={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Wa.node;var Ga=V(Wa),Ka={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};Ka.node;var qa=V(Ka),Ja={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Ja.node;var Ya=V(Ja),Xa={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Xa.node;var Za=V(Xa),Qa=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),H=o(((e,t)=>{t.exports=Qa()}))(),$a=({...e})=>{let{theme:t=`system`}=E();return(0,H.jsx)(Mr,{theme:t,className:`toaster group`,icons:{success:(0,H.jsx)(pi,{className:`size-4`}),info:(0,H.jsx)(Vi,{className:`size-4`}),warning:(0,H.jsx)(Ga,{className:`size-4`}),error:(0,H.jsx)(ra,{className:`size-4`}),loading:(0,H.jsx)(Zi,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})},eo=48,to=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-eo-t;return n},no=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},ro=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-eo;n+=i>>>1^-(i&1),t[r]=n}return t},io=384,ao=[],oo=no(to(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),so=no(to(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),co=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,lo=(()=>{let e=oo.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=oo[n];i<oo[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(oo[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=oo[i];a<oo[i+1];a++)n[r++]=e,e+=t[e]}return n})(),uo=to(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),fo=no(to(`123333359346463635126536711576`)),po=to(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),mo=to(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ho=ro(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),go=(()=>{let e=new Int32Array(319).fill(-1),t=ro(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=ro(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),_o=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),vo=ro(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),yo=ro(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),bo=ro(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),xo=new Int32Array(995),So=new Int32Array(995),Co=new Int32Array(995),wo=``,To=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<vo.length;r++)for(let i of _o[bo[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),To[a*2]=wo.length,To[a*2+1]=i.length,wo+=i),xo[n]=vo[r],So[n]=yo[r],Co[n]=a,n++}}var Eo=ro(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Do=no(to(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Oo=ro(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),ko=to(`ij`),Ao=to(`—`),jo=to(`1`),Mo={GROUP_COUNT:io,customValidatorNames:ao,edgeStart:oo,labelStart:so,labelText:co,edgeTarget:lo,nodeGroup:uo,nodeVlist:go,vlistPat:fo,vlistOps:po,vlistRef:mo,vlistGroup:ho,litAnchor:xo,litGroup:So,litPool:Co,poolOffsets:To,poolText:wo,adjGid:Eo,adjStart:Do,adjTgt:Oo,patGid:ko,patTgt:Ao,postfixLookupGroups:jo,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},No=`line`in Error(),Po=-1,Fo=-1,Io=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Lo=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},Ro=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Io(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(Io(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},te=n.cacheSize??8192,ne=n.prefix??e.prefix??``,re=ne===``?``:ne+`:`,ie=re.length,ae=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),oe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,le=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=0,de=-1,fe=-1,R=-1,z=-1,pe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,me=e=>/\s/.test(String.fromCharCode(e)),he=(e,t,n)=>{if(ue=0,de=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ue=1;else if(r===40&&i===41)ue=2;else return;R=t+1,z=n-1;let a=t+1;if(pe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!pe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(de=t+1,fe=a,R=a+1)}},ge=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},_e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ye=e=>!!e&&!Number.isNaN(Number(e)),be=(e,t,n)=>{if(n-t<11||!ge(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ge(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ge(e,t+10,t+18,`-normal/`)},xe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Se=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Ce=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],we=(e,t,n,r)=>{if(e>=10){if(e>=25)return ae[e-25](t.slice(n,r));let i=e-10;if(ue!==xe[i])return!1;if(de>=0){for(let e of Se[i])if(ge(t,de,fe,e))return!0;return!1}switch(Ce[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(R,z);return oe.test(e)&&!se.test(e)}case 3:return ye(t.slice(R,z));case 4:return le.test(t.slice(R,z));default:return ce.test(t.slice(R,z))}}switch(e){case 0:return!0;case 1:return ue===0;case 2:return ue===1;case 3:return ue===2;case 4:return _e.test(t.slice(n,r));case 5:return ye(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ye(t.slice(n,r-1));case 8:return ve.test(t.slice(n,r));default:return be(t,n,r)}},Te=new Set(typeof E==`string`?E.split(` `):E),Ee=(e,t,n,r,i,a)=>{let o=Io(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},De=new Map,Oe=new Map,ke=2,Ae=4096,je=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||Te.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Oe.get(s);return c===void 0&&Oe.set(s,c=ke++),c},Me=new Map,Ne=r,Pe=r+4096,Fe=()=>Ne++,Ie=2097152,Le=8192,Re=new Int32Array(Le),ze=Array(Le).fill(null),Be=new Int32Array(Le),Ve=new Int32Array(Le),He=new Uint8Array(Le),Ue=0,We=(e,t,n,r,i,a,o,s)=>{let c=e;if(ze[e]!==null){if(ze[e|1]===null)c=e|1;else if(!(Ue++&3))c=e|Ue>>2&1;else return}ze[c]=t.slice(n,r),Re[c]=i,Be[c]=a,Ve[c]=o,He[c]=s},Ge=()=>ze.fill(null),Ke=256,qe=[new Int32Array(Ke),new Int32Array(Ke),new Int32Array(Ke),new Int32Array(Ke)],[Je,Ye,Xe,Ze]=qe,Qe=new Uint8Array(Ke),$e=new Uint8Array(Ke),et=()=>{Ke*=2,qe=qe.map(e=>{let t=new Int32Array(Ke);return t.set(e),t}),[Je,Ye,Xe,Ze]=qe;let e=new Uint8Array(Ke);e.set(Qe),Qe=e,$e=new Uint8Array(Ke)},tt=64,nt=new Int32Array(tt),rt=new Int32Array(tt),it=new Int32Array(r),at=2048,ot=21,st=new Float64Array(at),ct=new Int32Array(at),lt=0,ut=(e,t)=>{if(e===0&&t<r)return it[t]===lt?1:(it[t]=lt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>ot;for(;ct[i]===lt;){if(st[i]===n)return 1;i=i+1&at-1}return st[i]=n,ct[i]=lt,0},dt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Po:Ee(Me,e,t+1,r,0,Fe)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=rt[t];if(r>n)continue;let i=nt[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;he(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(we(d[t],e,r,n))return p[h+t]}return Po},ft=e=>{let t=e.length,n=0,c=0,u=!1;(ke>Ae||De.size>Ae)&&(De=new Map,Oe=new Map,ke=2,Ge()),Ne>Pe&&(Me=new Map,Ne=r,Ge());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&me(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&me(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ke&&et();let _=n++;Je[_]=p,Ye[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Re[y]===v&&ze[y]!==null&&ze[y].length===g?t=y:Re[y|1]===v&&ze[y|1]!==null&&ze[y|1].length===g&&(t=y|1),t>=0){let n=ze[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Xe[_]=Be[t],Ze[_]=Ve[t],Qe[_]=He[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Xe[_]=Po,We(y,e,p,h,v,Po,0,0);continue}b=p+ie}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(nt[0]=0,rt[0]=M,L=1);let te=Fo,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?Fo:P,ne=L),P!==Fo){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=Fo;else{let e=i[P],t=i[P+1],c=Fo;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===tt){tt*=2;let e=new Int32Array(tt);e.set(nt),nt=e;let t=new Int32Array(tt);t.set(rt),rt=t}nt[L]=r,rt[L]=t+2,L++}}A===D&&(te=F<I?Fo:P,ne=L);let ae=F<I?Fo:P,oe,se=!1;if(A>=0){if(se=!0,oe=dt(e,E,A,te,ne),oe!==Po&&oe<r&&j[oe]){let t=dt(e,E,D,ae,L);t!==Po&&t!==oe&&(oe=t,se=!1)}else oe===Po&&(oe=dt(e,E,D,ae,L),se=!1)}else oe=dt(e,E,D,ae,L);let ce=0,le=0;oe===Po?Xe[_]=Po:(le=+!!se,ce=b>=C?+!!O:Ee(De,e,b,C,+!!O,e=>je(e,O)),Xe[_]=oe,Qe[_]=le,Ze[_]=ce),We(y,e,p,h,v,oe,ce,le)}if(n===0)return``;if(n===1)return Je[0]===0&&Ye[0]===t?e:e.slice(Je[0],Ye[0]);if(n*k>at){for(;n*k>at;)at<<=1,ot--;st=new Float64Array(at),ct=new Int32Array(at)}if(ke>=Ie||Ne>=Ie)throw Error(`cn: too many distinct classes in one merge`);lt=lt+1|0,lt===0&&(it.fill(0),ct.fill(0),lt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Xe[e];if(t===Po){$e[e]=1;continue}let n=Ze[e];if(ut(n,t)===1){$e[e]=0,f=!0;continue}if($e[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)ut(n,x[e]);if(Qe[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&ut(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!$e[m]){m++;continue}let t=Je[m],r=Ye[m],i=m+1;for(;i<n&&$e[i]&&Je[i]===r+1&&e.charCodeAt(r)===32;)r=Ye[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},pt=16384,mt=new Int32Array(pt*2),ht=0,gt=1,_t=Object.create(null),vt=Object.create(null),yt=new Map,bt=new Map,xt=0,St=0,Ct=()=>{ht^=pt,gt=gt+1|0,St=0},wt=e=>{let t=_t[e];if(t!==void 0)return t;let n=Lo(e,0,e.length),r=(n&16383)+ht,i=mt[r]===(n^gt)||mt[r^pt]===(n^gt-1);return i&&(t=vt[e],t!==void 0)?(_t[e]=t,t):(t=ft(e),i?(_t[e]=t,++xt>te&&(xt=0,vt=_t,_t=Object.create(null),Ct())):(mt[r]=n^gt,++St>pt&&Ct()),t)},Tt=e=>{let t=yt.get(e);if(t!==void 0)return t;let n=Lo(e,0,e.length),r=(n&16383)+ht,i=mt[r]===(n^gt)||mt[r^pt]===(n^gt-1);return i&&(t=bt.get(e),t!==void 0)?(yt.set(e,t),t):(t=ft(e),i?(yt.set(e,t),++xt>te&&(xt=0,bt=yt,yt=new Map,Ct())):(mt[r]=n^gt,++St>pt&&Ct()),t)},Et=e=>{let t=Lo(e,0,e.length),n=(t&16383)+ht;return mt[n]===(t^gt)||mt[n^pt]===(t^gt-1)||(mt[n]=t^gt,++St>pt&&Ct(),!1)},Dt=te===0?ft:No?e=>{let t=yt.get(e);return t===void 0?Tt(e):t}:wt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Dt(arguments[0]):Dt(U.apply(null,arguments))},mergeString:Dt,seenBefore:te===0?()=>!1:Et,mergeUncached:ft}},zo=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:zo(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Bo=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:zo(i,t);a&&(n&&(n+=` `),n+=a)}return n},U=function(){return Bo(arguments,!1)},Vo=256,Ho=16,Uo=1024,Wo=4096,Go=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Wo).fill(``),l=Array(Wo).fill(``),u=Array(Wo).fill(``));let i=Lo(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=zo(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Ho&&(_.miss=Ho,_.skip=Uo,_.e.length=0,_.at=0);let u=_.e;u.length<Vo?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(zo(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ko=Ro(Mo),W=Go(Ko.mergeString,Ko);Ko.merge;var qo=Object.defineProperty,Jo=(e,t)=>qo(e,`name`,{value:t,configurable:!0});function Yo(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Jo(Yo,`setRef`);function Xo(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yo(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Yo(e[t],null)}}}}Jo(Xo,`composeRefs`);function Zo(...e){return y.useCallback(Xo(...e),e)}Jo(Zo,`useComposedRefs`);var Qo=Object.defineProperty,$o=(e,t)=>Qo(e,`name`,{value:t,configurable:!0});function es(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ls(r)&&typeof ps==`function`&&(r=ps(r._payload)),y.Children.forEach(r,e=>{if(ss(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ls(n)&&typeof ps==`function`&&(n=ps(n._payload)),a=is(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=y.cloneElement(a,void 0,s):!o&&y.Children.count(r)===1&&y.isValidElement(r)&&(a=r);let c=a?os(a):void 0,l=Zo(n,c);if(!a){if(r||r===0)throw Error(o?fs(e):ds(e));return r}let u=as(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}$o(es,`createSlot`);var ts=es(`Slot`),ns=Symbol.for(`radix.slottable`);function rs(e){let t=$o(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=ns,t}$o(rs,`createSlottable`);var is=$o((e,t)=>{if(`child`in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function as(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}$o(as,`mergeProps`);function os(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$o(os,`getElementRef`);function ss(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ns}$o(ss,`isSlottable`);var cs=Symbol.for(`react.lazy`);function ls(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===cs&&`_payload`in e&&us(e._payload)}$o(ls,`isLazyComponent`);function us(e){return typeof e==`object`&&!!e&&`then`in e}$o(us,`isPromiseLike`);var ds=$o(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),fs=$o(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ps=y.use,ms=Object.defineProperty,hs=(e,t)=>ms(e,`name`,{value:t,configurable:!0}),gs=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=es(`Primitive.${t}`),r=y.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _s(e,t){e&&P.flushSync(()=>e.dispatchEvent(t))}hs(_s,`dispatchDiscreteCustomEvent`);var vs=Object.defineProperty,ys=(e,t)=>vs(e,`name`,{value:t,configurable:!0}),bs=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),xs=y.forwardRef(ys(function(e,t){return(0,H.jsx)(gs.span,{...e,ref:t,style:{...bs,...e.style}})},`VisuallyHidden`)),Ss=Object.defineProperty,Cs=(e,t)=>Ss(e,`name`,{value:t,configurable:!0});function ws(e,t){let n=y.createContext(t);n.displayName=e+`Context`;let r=Cs(e=>{let{children:t,...r}=e,i=y.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=y.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Cs(i,`useContext`),[r,i]}Cs(ws,`createContext`);function Ts(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Cs(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=y.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Cs(s,`useContext`),[o,s]}Cs(r,`createContext`);let i=Cs(()=>{let t=n.map(e=>y.createContext(e));return Cs(function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Es(i,...t)]}Cs(Ts,`createContextScope`);function Es(...e){let t=e[0];if(e.length===1)return t;let n=Cs(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Cs(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Cs(Es,`composeContextScopes`);var Ds=Object.defineProperty,Os=(e,t)=>Ds(e,`name`,{value:t,configurable:!0});function ks(e){let t=e+`CollectionProvider`,[n,r]=Ts(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Os(e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=es(s),l=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Zo(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=es(u),p=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=Zo(t,o),c=a(u,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Os(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Os(ks,`createCollection`);var As=new WeakMap,js=class e extends Map{static{Os(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],As.set(this,!0)}set(e,t){return As.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Ps(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ms(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ms(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ms(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ms(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ns(e,t);return n===-1?void 0:e[n]}Os(Ms,`at`);function Ns(e,t){let n=e.length,r=Ps(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Os(Ns,`toSafeIndex`);function Ps(e){return e!==e||e===0?0:Math.trunc(e)}Os(Ps,`toSafeInteger`);function Fs(e){let t=e+`CollectionProvider`,[n,r]=Ts(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new js,setItemMap:Os(()=>void 0,`setItemMap`)}),o=Os(({state:e,...t})=>e?(0,H.jsx)(c,{...t,state:e}):(0,H.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Os(e=>{let t=h();return(0,H.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Os(e=>{let{scope:t,children:n,state:r}=e,a=y.useRef(null),[o,s]=y.useState(null),c=Zo(a,s),[l,u]=r;return y.useEffect(()=>{if(!o)return;let e=zs(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,H.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=es(l),d=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Zo(t,a(l,n).collectionRef);return(0,H.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=es(f),m=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),[s,c]=y.useState(null),l=Zo(t,o,c),{setItemMap:u}=a(f,n),d=y.useRef(i);Is(d.current,i)||(d.current=i);let m=d.current;return y.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Rs):(t.set(s,{...e,element:s}),t.toSorted(Rs)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new js(e)))}},[s,m,u]),(0,H.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return y.useState(new js)}Os(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Os(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Os(Fs,`createCollection`);function Is(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Os(Is,`shallowEqual`);function Ls(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Os(Ls,`isElementPreceding`);function Rs(e,t){return!e[1].element||!t[1].element?0:Ls(e[1].element,t[1].element)?-1:1}Os(Rs,`sortByDocumentPosition`);function zs(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Os(zs,`getChildListObserver`);var Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0}),Hs=!!(typeof window<`u`&&window.document&&window.document.createElement);function G(e,t,{checkForDefaultPrevented:n=!0}={}){return Vs(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Vs(G,`composeEventHandlers`);function Us(e){if(!Hs)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Vs(Us,`getOwnerWindow`);function Ws(e){if(!Hs)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Vs(Ws,`getOwnerDocument`);function Gs(e,t=!1){let{activeElement:n}=Ws(e);if(!n?.nodeName)return null;if(Ks(n)&&n.contentDocument)return Gs(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Ws(n).getElementById(e);if(t)return t}}return n}Vs(Gs,`getActiveElement`);function Ks(e){return e.tagName===`IFRAME`}Vs(Ks,`isFrame`);var qs=globalThis?.document?y.useLayoutEffect:()=>{},Js=Object.defineProperty,Ys=(e,t)=>Js(e,`name`,{value:t,configurable:!0}),Xs=y.useEffectEvent,Zs=y.useInsertionEffect;function Qs(e){if(typeof Xs==`function`)return Xs(e);let t=y.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Zs==`function`?Zs(()=>{t.current=e}):qs(()=>{t.current=e}),y.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ys(Qs,`useEffectEvent`);var $s=Object.defineProperty,ec=(e,t)=>$s(e,`name`,{value:t,configurable:!0}),tc=y.useInsertionEffect||qs;function nc({prop:e,defaultProp:t,onChange:n=ec(()=>{},`onChange`),caller:r}){let[i,a,o]=rc({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,y.useCallback(t=>{if(s){let n=ic(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ec(nc,`useControllableState`);function rc({defaultProp:e,onChange:t}){let[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return tc(()=>{a.current=t},[t]),y.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ec(rc,`useUncontrolledState`);function ic(e){return typeof e==`function`}ec(ic,`isFunction`);var ac=Symbol(`RADIX:SYNC_STATE`);function oc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Qs(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=y.useReducer((t,n)=>{if(n.type===ac)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=y.useRef(p);y.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=y.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return y.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:ac,state:i})},[i,d.state,c]),[h,f]}ec(oc,`useControllableStateReducer`);var sc=Object.defineProperty,cc=(e,t)=>sc(e,`name`,{value:t,configurable:!0});function lc(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}cc(lc,`useStateMachine`);var uc=cc(e=>{let{present:t,children:n}=e,r=dc(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=pc(r.ref,hc(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null},`Presence`);function dc(e){let[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef(`none`),o=y.useRef(void 0),[s,c]=lc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{s===`mounted`?(a.current=o.current??mc(r.current),o.current=void 0):a.current=`none`},[s]),qs(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=mc(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),qs(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=cc(a=>{let o=mc(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=cc(e=>{e.target===t&&(a.current=mc(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=mc(t)}else r.current=null;n(e)},[])}}cc(dc,`usePresence`);function fc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}cc(fc,`setRef`);function pc(...e){let t=y.useRef(e);return t.current=e,y.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=fc(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():fc(n[e],null)}}},[])}cc(pc,`useStableComposedRefs`);function mc(e){return e?.animationName||`none`}cc(mc,`getAnimationName`);function hc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}cc(hc,`getElementRef`);var gc=Object.defineProperty,_c=(e,t)=>gc(e,`name`,{value:t,configurable:!0}),vc=y.useId||(()=>void 0),yc=0;function bc(e){let[t,n]=y.useState(vc());return qs(()=>{e||n(e=>e??String(yc++))},[e]),e||(t?`radix-${t}`:``)}_c(bc,`useId`);var xc=Object.defineProperty,Sc=(e,t)=>xc(e,`name`,{value:t,configurable:!0}),Cc=y.createContext(void 0);function wc(e){let t=y.useContext(Cc);return e||t||`ltr`}Sc(wc,`useDirection`);var Tc=Object.defineProperty,Ec=(e,t)=>Tc(e,`name`,{value:t,configurable:!0});function Dc(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ec(Dc,`useCallbackRef`);var Oc=Object.defineProperty,kc=(e,t)=>Oc(e,`name`,{value:t,configurable:!0}),Ac=`dismissableLayer.update`,jc=`dismissableLayer.pointerDownOutside`,Mc=`dismissableLayer.focusOutside`,Nc,Pc=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Fc=y.forwardRef(kc(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=y.useContext(Pc),[d,f]=y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=y.useState({}),h=Zo(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=v,C=y.useRef(!1),w=Rc(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=zc(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Dc(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return y.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Nc=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Bc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Nc))}},[d,p,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Bc())},[d,u]),y.useEffect(()=>{let e=kc(()=>m({}),`handleUpdate`);return document.addEventListener(Ac,e),()=>document.removeEventListener(Ac,e)},[]),(0,H.jsx)(gs.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:G(e.onFocusCapture,T.onFocusCapture),onBlurCapture:G(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Ic(){let e=y.useContext(Pc),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}kc(Ic,`useDismissableLayerSurface`);var Lc=kc(()=>!0,`IS_TRUE`);function Rc(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Lc}=t,s=Dc(e),c=y.useRef(!1),l=y.useRef(!1),u=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}kc(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}kc(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}kc(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}kc(p,`handleInteractionBubble`);let m=kc(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Vc(jc,s,p,{discrete:!0})};if(kc(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:kc(()=>c.current=!0,`onPointerDownCapture`)}}kc(Rc,`usePointerDownOutside`);function zc(e,t=globalThis?.document){let n=Dc(e),r=y.useRef(!1);return y.useEffect(()=>{let e=kc(e=>{e.target&&!r.current&&Vc(Mc,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:kc(()=>r.current=!0,`onFocusCapture`),onBlurCapture:kc(()=>r.current=!1,`onBlurCapture`)}}kc(zc,`useFocusOutside`);function Bc(){let e=new CustomEvent(Ac);document.dispatchEvent(e)}kc(Bc,`dispatchUpdate`);function Vc(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?_s(i,a):i.dispatchEvent(a)}kc(Vc,`handleAndDispatchCustomEvent`);var Hc=Object.defineProperty,Uc=(e,t)=>Hc(e,`name`,{value:t,configurable:!0}),Wc=`focusScope.autoFocusOnMount`,Gc=`focusScope.autoFocusOnUnmount`,Kc={bubbles:!1,cancelable:!0},qc=y.forwardRef(Uc(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=y.useState(null),l=Dc(i),u=Dc(a),d=y.useRef(null),f=Zo(t,c),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:el(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||el(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&el(s)};Uc(e,`handleFocusIn`),Uc(t,`handleFocusOut`),Uc(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){tl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Wc,Kc);s.addEventListener(Wc,l),s.dispatchEvent(t),t.defaultPrevented||(Jc(il(Xc(s)),{select:!0}),document.activeElement===e&&el(s))}return()=>{s.removeEventListener(Wc,l),setTimeout(()=>{let t=new CustomEvent(Gc,Kc);s.addEventListener(Gc,u),s.dispatchEvent(t),t.defaultPrevented||el(e??document.body,{select:!0}),s.removeEventListener(Gc,u),tl.remove(p)},0)}}},[s,l,u,p]);let m=y.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Yc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&el(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&el(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(gs.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Jc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(el(r,{select:t}),document.activeElement!==n)return}Uc(Jc,`focusFirst`);function Yc(e){let t=Xc(e);return[Zc(t,e),Zc(t.reverse(),e)]}Uc(Yc,`getTabbableEdges`);function Xc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Uc(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Uc(Xc,`getTabbableCandidates`);function Zc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Qc(r,{upTo:t})))return r}Uc(Zc,`findVisible`);function Qc(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Uc(Qc,`isHidden`);function $c(e){return e instanceof HTMLInputElement&&`select`in e}Uc($c,`isSelectableInput`);function el(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$c(e)&&t&&e.select()}}Uc(el,`focus`);var tl=nl();function nl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=rl(e,t),e.unshift(t)},remove(t){e=rl(e,t),e[0]?.resume()}}}Uc(nl,`createFocusScopesStack`);function rl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Uc(rl,`arrayRemove`);function il(e){return e.filter(e=>e.tagName!==`A`)}Uc(il,`removeLinks`);var al=Object.defineProperty,ol=y.forwardRef(((e,t)=>al(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=y.useState(!1);qs(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?P.createPortal((0,H.jsx)(gs.div,{...r,ref:t}),o):null},`Portal`)),sl=Object.defineProperty,cl=(e,t)=>sl(e,`name`,{value:t,configurable:!0}),ll=0,ul=null;function dl(e){return fl(),e.children}cl(dl,`FocusGuards`);function fl(){y.useEffect(()=>{ul||={start:pl(),end:pl()};let{start:e,end:t}=ul;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ll++,()=>{ll===1&&(ul?.start.remove(),ul?.end.remove(),ul=null),ll=Math.max(0,ll-1)}},[])}cl(fl,`useFocusGuards`);function pl(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}cl(pl,`createFocusGuard`);var ml=function(){return ml=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ml.apply(this,arguments)};function hl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gl(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _l=`right-scroll-bar-position`,vl=`width-before-scroll-bar`,yl=`with-scroll-bars-hidden`,bl=`--removed-body-scroll-bar-size`;function xl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Sl(e,t){var n=(0,y.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Cl=typeof window<`u`?y.useLayoutEffect:y.useEffect,wl=new WeakMap;function Tl(e,t){var n=Sl(t||null,function(t){return e.forEach(function(e){return xl(e,t)})});return Cl(function(){var t=wl.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xl(e,null)}),i.forEach(function(e){r.has(e)||xl(e,a)})}wl.set(n,e)},[e]),n}function El(e){return e}function Dl(e,t){t===void 0&&(t=El);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ol(e){e===void 0&&(e={});var t=Dl(null);return t.options=ml({async:!0,ssr:!1},e),t}var kl=function(e){var t=e.sideCar,n=hl(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return y.createElement(r,ml({},n))};kl.isSideCarExport=!0;function Al(e,t){return e.useMedium(t),kl}var jl=Ol(),Ml=function(){},Nl=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ml,onWheelCapture:Ml,onTouchMoveCapture:Ml}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,b=e.gapMode,x=hl(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Tl([n,t]),w=ml(ml({},x),i);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:jl,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(s),ml(ml({},w),{ref:C})):y.createElement(v,ml({},w,{className:c,ref:C}),s))});Nl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nl.classNames={fullWidth:vl,zeroRight:_l};var Pl=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Fl(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Pl();return t&&e.setAttribute(`nonce`,t),e}function Il(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ll(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Rl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Fl())&&(Il(t,n),Ll(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zl=function(){var e=Rl();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Bl=function(){var e=zl();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Vl={left:0,top:0,right:0,gap:0},Hl=function(e){return parseInt(e||``,10)||0},Ul=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Hl(n),Hl(r),Hl(i)]},Wl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Vl;var t=Ul(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Gl=Bl(),Kl=`data-scroll-locked`,ql=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
13
+ .${yl} {
14
+ overflow: hidden ${r};
15
+ padding-right: ${s}px ${r};
16
+ }
17
+ body[${Kl}] {
18
+ overflow: hidden ${r};
19
+ overscroll-behavior: contain;
20
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
21
+ padding-left: ${i}px;
22
+ padding-top: ${a}px;
23
+ padding-right: ${o}px;
24
+ margin-left:0;
25
+ margin-top:0;
26
+ margin-right: ${s}px ${r};
27
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
28
+ }
29
+
30
+ .${_l} {
31
+ right: ${s}px ${r};
32
+ }
33
+
34
+ .${vl} {
35
+ margin-right: ${s}px ${r};
36
+ }
37
+
38
+ .${_l} .${_l} {
39
+ right: 0 ${r};
40
+ }
41
+
42
+ .${vl} .${vl} {
43
+ margin-right: 0 ${r};
44
+ }
45
+
46
+ body[${Kl}] {
47
+ ${bl}: ${s}px;
48
+ }
49
+ `},Jl=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Yl=function(){y.useEffect(function(){return document.body.setAttribute(Kl,(Jl()+1).toString()),function(){var e=Jl()-1;e<=0?document.body.removeAttribute(Kl):document.body.setAttribute(Kl,e.toString())}},[])},Xl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Yl();var a=y.useMemo(function(){return Wl(i)},[i]);return y.createElement(Gl,{styles:ql(a,!t,i,n?``:`!important`)})},Zl=!1;if(typeof window<`u`)try{var Ql=Object.defineProperty({},"passive",{get:function(){return Zl=!0,!0}});window.addEventListener(`test`,Ql,Ql),window.removeEventListener(`test`,Ql,Ql)}catch{Zl=!1}var $l=Zl?{passive:!1}:!1,eu=function(e){return e.tagName===`TEXTAREA`},tu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!eu(e)&&n[t]===`visible`)},nu=function(e){return tu(e,`overflowY`)},ru=function(e){return tu(e,`overflowX`)},iu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),su(e,r)){var i=cu(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},au=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ou=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},su=function(e,t){return e===`v`?nu(t):ru(t)},cu=function(e,t){return e===`v`?au(t):ou(t)},lu=function(e,t){return e===`h`&&t===`rtl`?-1:1},uu=function(e,t,n,r,i){var a=lu(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=cu(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&su(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},du=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fu=function(e){return[e.deltaX,e.deltaY]},pu=function(e){return e&&`current`in e?e.current:e},mu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hu=function(e){return`
50
+ .block-interactivity-${e} {pointer-events: none;}
51
+ .allow-interactivity-${e} {pointer-events: all;}
52
+ `},gu=0,_u=[];function vu(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(gu++)[0],a=y.useState(Bl)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gl([e.lockRef.current],(e.shards||[]).map(pu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=du(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=iu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=iu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return uu(h,t,e,h===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(_u.length&&_u[_u.length-1]===a){var r=`deltaY`in n?fu(n):du(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(pu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:yu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=du(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,fu(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,du(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return _u.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,$l),document.addEventListener(`touchmove`,c,$l),document.addEventListener(`touchstart`,u,$l),function(){_u=_u.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$l),document.removeEventListener(`touchmove`,c,$l),document.removeEventListener(`touchstart`,u,$l)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:hu(i)}):null,p?y.createElement(Xl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bu=Al(jl,vu),xu=y.forwardRef(function(e,t){return y.createElement(Nl,ml({},e,{ref:t,sideCar:bu}))});xu.classNames=Nl.classNames;var Su=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Cu=new WeakMap,wu=new WeakMap,Tu={},Eu=0,Du=function(e){return e&&(e.host||Du(e.parentNode))},Ou=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Du(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ku=function(e,t,n,r){var i=Ou(t,Array.isArray(e)?e:[e]);Tu[n]||(Tu[n]=new WeakMap);var a=Tu[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Cu.get(e)||0)+1,l=(a.get(e)||0)+1;Cu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&wu.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Eu++,function(){o.forEach(function(e){var t=Cu.get(e)-1,i=a.get(e)-1;Cu.set(e,t),a.set(e,i),t||(wu.has(e)||e.removeAttribute(r),wu.delete(e)),i||e.removeAttribute(n)}),Eu--,Eu||(Cu=new WeakMap,Cu=new WeakMap,wu=new WeakMap,Tu={})}},Au=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Su(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ku(r,i,n,`aria-hidden`)):function(){return null}},ju=Object.defineProperty,Mu=(e,t)=>ju(e,`name`,{value:t,configurable:!0}),Nu=`Dialog`,[Pu,Fu]=Ts(Nu),[Iu,Lu]=Pu(Nu),Ru=Mu(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l,u]=nc({prop:r,defaultProp:i??!1,onChange:a,caller:Nu}),[d,f]=y.useState(0),[p,m]=y.useState(0);return(0,H.jsx)(Iu,{scope:t,triggerRef:s,contentRef:c,contentId:bc(),titleId:bc(),descriptionId:bc(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),zu=`DialogTrigger`,Bu=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,...r}=e,i=Lu(zu,n),a=Zo(t,i.triggerRef);return(0,H.jsx)(gs.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":od(i.open),...r,ref:a,onClick:G(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Vu=`DialogPortal`,[Hu,Uu]=Pu(Vu,{forceMount:void 0}),Wu=Mu(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Lu(Vu,t);return(0,H.jsx)(Hu,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,H.jsx)(uc,{present:n||a.open,children:(0,H.jsx)(ol,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Gu=`DialogOverlay`,Ku=y.forwardRef(Mu(function(e,t){let n=Uu(Gu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Lu(Gu,e.__scopeDialog);return a.modal?(0,H.jsx)(uc,{present:r||a.open,children:(0,H.jsx)(Ju,{...i,ref:t})}):null},`DialogOverlay`)),qu=es(`DialogOverlay.RemoveScroll`),Ju=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,...r}=e,i=Lu(Gu,n),a=Zo(t,Ic());return(0,H.jsx)(xu,{as:qu,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(gs.div,{"data-state":od(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Yu=`DialogContent`,Xu=y.forwardRef(Mu(function(e,t){let n=Uu(Yu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Lu(Yu,e.__scopeDialog);return(0,H.jsx)(uc,{present:r||a.open,children:a.modal?(0,H.jsx)(Zu,{...i,ref:t}):(0,H.jsx)(Qu,{...i,ref:t})})},`DialogContent`)),Zu=y.forwardRef(Mu(function(e,t){let n=Lu(Yu,e.__scopeDialog),r=y.useRef(null),i=Zo(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return Au(e)},[]),(0,H.jsx)($u,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Qu=y.forwardRef(Mu(function(e,t){let n=Lu(Yu,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,H.jsx)($u,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),$u=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Lu(Yu,n);return fl(),(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(qc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Fc,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":od(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),ed=`DialogTitle`,td=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,...r}=e,i=Lu(ed,n),{setTitleCount:a}=i;return qs(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(gs.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),nd=`DialogDescription`,rd=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,...r}=e,i=Lu(nd,n),{setDescriptionCount:a}=i;return qs(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(gs.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),id=`DialogClose`,ad=y.forwardRef(Mu(function(e,t){let{__scopeDialog:n,...r}=e,i=Lu(id,n);return(0,H.jsx)(gs.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function od(e){return e?`open`:`closed`}Mu(od,`getState`);var sd=Object.defineProperty,cd=(e,t)=>sd(e,`name`,{value:t,configurable:!0}),[ld,ud]=Ts(`AlertDialog`,[Fu]),dd=Fu(),fd=cd(e=>{let{__scopeAlertDialog:t,...n}=e,r=dd(t);return(0,H.jsx)(Ru,{...r,...n,modal:!0})},`AlertDialog`);y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=dd(n);return(0,H.jsx)(Bu,{...i,...r,ref:t})},`AlertDialogTrigger`));var pd=cd(e=>{let{__scopeAlertDialog:t,...n}=e,r=dd(t);return(0,H.jsx)(Wu,{...r,...n})},`AlertDialogPortal`),md=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=dd(n);return(0,H.jsx)(Ku,{...i,...r,ref:t})},`AlertDialogOverlay`)),[hd,gd]=ld(`AlertDialogContent`),_d=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=dd(n),o=Zo(t,y.useRef(null)),s=y.useRef(null);return(0,H.jsx)(hd,{scope:n,cancelRef:s,children:(0,H.jsx)(Xu,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:G(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),vd=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=dd(n);return(0,H.jsx)(td,{...i,...r,ref:t})},`AlertDialogTitle`)),yd=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=dd(n);return(0,H.jsx)(rd,{...i,...r,ref:t})},`AlertDialogDescription`)),bd=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=dd(n);return(0,H.jsx)(ad,{...i,...r,ref:t})},`AlertDialogAction`)),xd=`AlertDialogCancel`,Sd=y.forwardRef(cd(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=gd(xd,n),a=dd(n),o=Zo(t,i);return(0,H.jsx)(ad,{...a,...r,ref:o})},`AlertDialogCancel`)),Cd=fd,wd=pd,Td=md,Ed=_d,Dd=bd,Od=Sd,kd=vd,Ad=yd,jd=Object.defineProperty,Md=(e,t)=>jd(e,`name`,{value:t,configurable:!0});function Nd(e){let[t,n]=y.useState(void 0);return qs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Md(Nd,`useSize`);var Pd=[`top`,`right`,`bottom`,`left`],Fd=Math.min,Id=Math.max,Ld=Math.round,Rd=Math.floor,zd=e=>({x:e,y:e}),Bd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Vd(e,t,n){return Id(e,Fd(t,n))}function Hd(e,t){return typeof e==`function`?e(t):e}function Ud(e){return e.split(`-`)[0]}function Wd(e){return e.split(`-`)[1]}function Gd(e){return e===`x`?`y`:`x`}function Kd(e){return e===`y`?`height`:`width`}function qd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Jd(e){return Gd(qd(e))}function Yd(e,t,n){n===void 0&&(n=!1);let r=Wd(e),i=Jd(e),a=Kd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=af(o)),[o,af(o)]}function Xd(e){let t=af(e);return[Zd(e),t,Zd(t)]}function Zd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Qd=[`left`,`right`],$d=[`right`,`left`],ef=[`top`,`bottom`],tf=[`bottom`,`top`];function nf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?$d:Qd:t?Qd:$d;case`left`:case`right`:return t?ef:tf;default:return[]}}function rf(e,t,n,r){let i=Wd(e),a=nf(Ud(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Zd)))),a}function af(e){let t=Ud(e);return Bd[t]+e.slice(t.length)}function of(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function sf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:of(e)}function cf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function lf(e,t,n){let{reference:r,floating:i}=e,a=qd(t),o=Jd(t),s=Kd(o),c=Ud(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Wd(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function uf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Hd(t,e),p=sf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=cf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=cf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var df=50,ff=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:uf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=lf(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<df&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=lf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Hd(e,t)||{};if(l==null)return{};let d=sf(u),f={x:n,y:r},p=Jd(i),m=Kd(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Fd(d[_],T),D=Fd(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Vd(E,k,O),j=!c.arrow&&Wd(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),mf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Hd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ud(r),_=qd(o),v=Ud(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[af(o)]:Xd(o)),x=p!==`none`;!d&&x&&b.push(...rf(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Yd(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===qd(t)||T.every(e=>qd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=qd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function hf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gf(e){return Pd.some(t=>e[t]>=0)}var _f=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Hd(e,t);switch(i){case`referenceHidden`:{let e=hf(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:gf(e)}}}case`escaped`:{let e=hf(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:gf(e)}}}default:return{}}}}},vf=new Set([`left`,`top`]);async function yf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ud(n),s=Wd(n),c=qd(n)===`y`,l=vf.has(o)?-1:1,u=a&&c?-1:1,d=Hd(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var bf=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Hd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=qd(i),p=Gd(f),m=u[p],h=u[f],g=(e,t)=>Vd(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Hd(e,t),u={x:n,y:r},d=qd(i),f=Gd(d),p=u[f],m=u[d],h=Hd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=vf.has(Ud(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Hd(e,t),c=await i.detectOverflow(t,s),l=Ud(n),u=Wd(n),d=qd(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Fd(p-c[m],g),y=Fd(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Id(c.left,c.right):S=p-2*Id(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function wf(){return typeof window<`u`}function Tf(e){return Of(e)?(e.nodeName||``).toLowerCase():`#document`}function Ef(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Df(e){return((Of(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Of(e){return wf()?e instanceof Node||e instanceof Ef(e).Node:!1}function kf(e){return wf()?e instanceof Element||e instanceof Ef(e).Element:!1}function Af(e){return wf()?e instanceof HTMLElement||e instanceof Ef(e).HTMLElement:!1}function jf(e){return!wf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ef(e).ShadowRoot}function Mf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Uf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Nf(e){return/^(table|td|th)$/.test(Tf(e))}function Pf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ff=/transform|translate|scale|rotate|perspective|filter/,If=/paint|layout|strict|content/,Lf=e=>!!e&&e!==`none`,Rf;function zf(e){let t=kf(e)?Uf(e):e;return Lf(t.transform)||Lf(t.translate)||Lf(t.scale)||Lf(t.rotate)||Lf(t.perspective)||!Vf()&&(Lf(t.backdropFilter)||Lf(t.filter))||Ff.test(t.willChange||``)||If.test(t.contain||``)}function Bf(e){let t=Gf(e);for(;Af(t)&&!Hf(t);){if(zf(t))return t;if(Pf(t))return null;t=Gf(t)}return null}function Vf(){return Rf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Rf}function Hf(e){return/^(html|body|#document)$/.test(Tf(e))}function Uf(e){return Ef(e).getComputedStyle(e)}function Wf(e){return kf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gf(e){if(Tf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||jf(e)&&e.host||Df(e);return jf(t)?t.host:t}function Kf(e){let t=Gf(e);return Hf(t)?(e.ownerDocument||e).body:Af(t)&&Mf(t)?t:Kf(t)}function qf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Kf(e),i=r===e.ownerDocument?.body,a=Ef(r);if(i){let e=Jf(a);return t.concat(a,a.visualViewport||[],Mf(r)?r:[],e&&n?qf(e):[])}return t.concat(r,qf(r,[],n))}function Jf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yf(e){let t=Uf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Af(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ld(n)!==a||Ld(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Xf(e){return kf(e)?e:e.contextElement}function Zf(e){let t=Xf(e);if(!Af(t))return zd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Yf(t),o=(a?Ld(n.width):n.width)/r,s=(a?Ld(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Qf=zd(0);function $f(e){let t=Ef(e);return!Vf()||!t.visualViewport?Qf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ep(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ef(e)}function tp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Xf(e),o=zd(1);t&&(r?kf(r)&&(o=Zf(r)):o=Zf(e));let s=ep(a,n,r)?$f(a):zd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ef(a),t=kf(r)?Ef(r):r,n=e,i=Jf(n);for(;i&&t!==n;){let e=Zf(i),t=i.getBoundingClientRect(),r=Uf(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ef(i),i=Jf(n)}}return cf({width:u,height:d,x:c,y:l})}function np(e,t){let n=Wf(e).scrollLeft;return t?t.left+n:tp(Df(e)).left+n}function rp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-np(e,n),y:n.top+t.scrollTop}}function ip(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Df(r),s=t?Pf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=zd(1),u=zd(0),d=Af(r);if((d||!a)&&((Tf(r)!==`body`||Mf(o))&&(c=Wf(r)),d)){let e=tp(r);l=Zf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rp(o,c):zd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ap(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function op(e){let t=Wf(e),n=e.ownerDocument.body,r=Id(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Id(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+np(e),o=-t.scrollTop;return Uf(n).direction===`rtl`&&(a+=Id(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var sp=25;function cp(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ef(e),a=Df(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Vf()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(np(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=sp&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lp(e,t){let n=tp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function up(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=cp(e,n,t);else if(t===`document`)r=op(Df(e));else if(kf(t))r=lp(t,n);else{let n=$f(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return cf(r)}function dp(e,t){let n=t.get(e);if(n)return n;let r=qf(e,[],!1).filter(e=>kf(e)&&Tf(e)!==`body`),i=null,a=Uf(e).position===`fixed`,o=a?Gf(e):e;for(;kf(o)&&!Hf(o);){let e=Uf(o),t=zf(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Gf(o)}return t.set(e,r),r}function fp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Pf(t)?[]:dp(t,this._c):[].concat(n),r],o=up(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=up(t,a[e],i);s=Id(n.top,s),c=Fd(n.right,c),l=Fd(n.bottom,l),u=Id(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pp(e){let{width:t,height:n}=Yf(e);return{width:t,height:n}}function mp(e,t,n){let r=Af(t),i=Df(t),a=n===`fixed`,o=tp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=zd(0);if((r||!a)&&((Tf(t)!==`body`||Mf(i))&&(s=Wf(t)),r)){let e=tp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=np(i));let l=i&&!r&&!a?rp(i,s):zd(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function hp(e){return Uf(e).position===`static`}function gp(e,t){if(!Af(e)||Uf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Df(e)===n&&(n=n.ownerDocument.body),n}function _p(e,t){let n=Ef(e);if(Pf(e))return n;if(!Af(e)){let t=Gf(e);for(;t&&!Hf(t);){if(kf(t)&&!hp(t))return t;t=Gf(t)}return n}let r=gp(e,t);for(;r&&Nf(r)&&hp(r);)r=gp(r,t);return r&&Hf(r)&&hp(r)&&!zf(r)?n:r||Bf(e)||n}var vp=async function(e){let t=this.getOffsetParent||_p,n=this.getDimensions,r=await n(e.floating);return{reference:mp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yp(e){return Uf(e).direction===`rtl`}var bp={convertOffsetParentRelativeRectToViewportRelativeRect:ip,getDocumentElement:Df,getClippingRect:fp,getOffsetParent:_p,getElementRects:vp,getClientRects:ap,getDimensions:pp,getScale:Zf,isElement:kf,isRTL:yp};function xp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sp(e,t,n){let r=null,i,a=Df(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Rd(d),h=Rd(a.clientWidth-(u+f)),g=Rd(a.clientHeight-(d+p)),_=Rd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Id(0,Fd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xp(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ef(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Cp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Xf(e),u=i||a?[...l?qf(l):[],...t?qf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Sp(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?tp(e):null;c&&g();function g(){let t=tp(e);h&&!xp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wp=bf,Tp=xf,Ep=mf,Dp=Cf,Op=_f,kp=pf,Ap=Sf,jp=(e,t,n)=>{let r=new Map,i=n??{},a={...bp,...i.platform,_c:r};return ff(e,t,{...i,platform:a})},Mp=typeof document<`u`?y.useLayoutEffect:function(){};function Np(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Np(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Np(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fp(e,t){let n=Pp(e);return Math.round(t*n)/n}function Ip(e){let t=y.useRef(e);return Mp(()=>{t.current=e}),t}function Lp(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);Np(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,D=Ip(c),O=Ip(i),k=Ip(l),A=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jp(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Np(T.current,t)&&(T.current=t,P.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Mp(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=y.useRef(!1);Mp(()=>(j.current=!0,()=>{j.current=!1}),[]),Mp(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),N=y.useMemo(()=>({reference:x,floating:S}),[x,S]),F=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Fp(N.floating,u.x),r=Fp(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pp(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:F}),[u,A,M,N,F])}var Rp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kp({element:r.current,padding:i}).fn(n):r?kp({element:r,padding:i}).fn(n):{}}}},zp=(e,t)=>{let n=wp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bp=(e,t)=>{let n=Tp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vp=(e,t)=>({fn:Ap(e).fn,options:[e,t]}),Hp=(e,t)=>{let n=Ep(e);return{name:n.name,fn:n.fn,options:[e,t]}},Up=(e,t)=>{let n=Dp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wp=(e,t)=>{let n=Op(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gp=(e,t)=>{let n=Rp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kp=Object.defineProperty,qp=y.forwardRef(((e,t)=>Kp(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(gs.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Jp=Object.defineProperty,Yp=(e,t)=>Jp(e,`name`,{value:t,configurable:!0}),Xp=`Popper`,[Zp,Qp]=Ts(Xp),[$p,em]=Zp(Xp),tm=Yp(e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null),[a,o]=y.useState(void 0);return(0,H.jsx)($p,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),nm=`PopperAnchor`,rm=y.forwardRef(Yp(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=em(nm,n),o=y.useRef(null),s=a.onAnchorChange,c=Zo(t,y.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&pm(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(gs.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),im=`PopperContent`,[am,om]=Zp(im),sm=y.forwardRef(Yp(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=em(im,n),[_,v]=y.useState(null),b=Zo(t,v),[x,S]=y.useState(null),C=Nd(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(dm),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Lp({strategy:`fixed`,placement:E,whileElementsMounted:Yp((...e)=>Cp(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[zp({mainAxis:i+T,alignmentAxis:o}),c&&Bp({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Vp():void 0,...A}),c&&Hp({...A}),Up({...A,apply:Yp(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Gp({element:x,padding:s}),fm({arrowWidth:w,arrowHeight:T}),f&&Wp({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;qs(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=pm(N),te=Dc(m);qs(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=y.useState();return qs(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(am,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,H.jsx)(gs.div,{"data-side":ee,"data-align":L,...h,ref:b,style:{...h.style,animation:P?h.style?.animation:`none`}})})})},`PopperContent`)),cm=`PopperArrow`,lm={top:`bottom`,right:`left`,bottom:`top`,left:`right`},um=y.forwardRef(Yp(function(e,t){let{__scopePopper:n,...r}=e,i=om(cm,n),a=lm[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(qp,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function dm(e){return e!==null}Yp(dm,`isNotNull`);var fm=Yp(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pm(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function pm(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Yp(pm,`getSideAndAlignFromPlacement`);var mm=tm,hm=rm,gm=sm,_m=um,vm=Object.defineProperty,ym=(e,t)=>vm(e,`name`,{value:t,configurable:!0}),bm=!1;function xm(){let[e,t]=y.useState(bm);return y.useEffect(()=>{bm||(bm=!0,t(!0))},[]),e}ym(xm,`useIsHydrated`);var Sm=y.useSyncExternalStore;function Cm(){return()=>{}}ym(Cm,`subscribe`);function wm(){return Sm(Cm,()=>!0,()=>!1)}ym(wm,`useIsHydratedModern`);var Tm=typeof Sm==`function`?wm:xm,Em=Object.defineProperty,Dm=(e,t)=>Em(e,`name`,{value:t,configurable:!0}),Om=`rovingFocusGroup.onEntryFocus`,km={bubbles:!1,cancelable:!0},Am=`RovingFocusGroup`,[jm,Mm,Nm]=ks(Am),[Pm,Fm]=Ts(Am,[Nm]),[Im,Lm]=Pm(Am),Rm=y.forwardRef(Dm(function(e,t){return(0,H.jsx)(jm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(jm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(zm,{...e,ref:t})})})},`RovingFocusGroup`)),zm=y.forwardRef(Dm(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),p=Zo(t,f),m=wc(a),[h,g]=nc({prop:o,defaultProp:s??null,onChange:c,caller:Am}),[_,v]=y.useState(!1),b=Dc(l),x=Mm(n),S=y.useRef(!1),[C,w]=y.useState(0);return y.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Om,b),()=>e.removeEventListener(Om,b)},[b]),(0,H.jsx)(Im,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:y.useCallback(e=>g(e),[g]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:y.useCallback(()=>w(e=>e-1),[]),children:(0,H.jsx)(gs.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{S.current=!0}),onFocus:G(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Om,km);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Gm([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:G(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Bm=`RovingFocusGroupItem`,Vm=y.forwardRef(Dm(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=bc(),l=a||c,u=Lm(Bm,n),d=u.currentTabStopId===l,f=Mm(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Tm();return qs(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),y.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,H.jsx)(jm.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(gs.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Wm(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Km(n,r+1):n.slice(r+1)}setTimeout(()=>Gm(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Hm={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Um(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Dm(Um,`getDirectionAwareKey`);function Wm(e,t,n){let r=Um(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Hm[r]}Dm(Wm,`getFocusIntent`);function Gm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Dm(Gm,`focusFirst`);function Km(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Dm(Km,`wrapArray`);var qm=Rm,Jm=Vm,Ym=Object.defineProperty,Xm=(e,t)=>Ym(e,`name`,{value:t,configurable:!0}),Zm=[`Enter`,` `],Qm=[`ArrowDown`,`PageUp`,`Home`],$m=[`ArrowUp`,`PageDown`,`End`],eh=[...Qm,...$m];[...Zm],[...Zm];var th=`Menu`,[nh,rh,ih]=ks(th),[ah,oh]=Ts(th,[ih,Qp,Fm]),sh=Qp(),ch=Fm(),[lh,uh]=ah(th),[dh,fh]=ah(th),ph=Xm(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=sh(t),[c,l]=y.useState(null),u=y.useRef(!1),d=Dc(a),f=wc(i);return y.useEffect(()=>{let e=Xm(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Xm(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),y.useEffect(()=>{if(!n)return;let e=Xm(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(mm,{...s,children:(0,H.jsx)(lh,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(dh,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),mh=y.forwardRef(Xm(function(e,t){let{__scopeMenu:n,...r}=e,i=sh(n);return(0,H.jsx)(hm,{...i,...r,ref:t})},`MenuAnchor`)),hh=`MenuPortal`,[gh,_h]=ah(hh,{forceMount:void 0}),vh=Xm(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=uh(hh,t);return(0,H.jsx)(gh,{scope:t,forceMount:n,children:(0,H.jsx)(uc,{present:n||a.open,children:(0,H.jsx)(ol,{asChild:!0,container:i,children:r})})})},`MenuPortal`),yh=`MenuContent`,[bh,xh]=ah(yh),Sh=y.forwardRef(Xm(function(e,t){let n=_h(yh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=uh(yh,e.__scopeMenu),o=fh(yh,e.__scopeMenu);return(0,H.jsx)(nh.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(uc,{present:r||a.open,children:(0,H.jsx)(nh.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(Ch,{...i,ref:t}):(0,H.jsx)(wh,{...i,ref:t})})})})},`MenuContent`)),Ch=y.forwardRef(Xm(function(e,t){let n=uh(yh,e.__scopeMenu),r=y.useRef(null),i=Zo(t,r);return y.useEffect(()=>{let e=r.current;if(e)return Au(e)},[]),(0,H.jsx)(Eh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),wh=y.forwardRef(Xm(function(e,t){let n=uh(yh,e.__scopeMenu);return(0,H.jsx)(Eh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Th=es(`MenuContent.ScrollLock`),Eh=y.forwardRef(Xm(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=uh(yh,n),_=fh(yh,n),v=sh(n),b=ch(n),x=rh(n),[S,C]=y.useState(null),w=y.useRef(null),T=Zo(t,w,g.onContentChange),E=y.useRef(0),D=y.useRef(``),O=y.useRef(0),k=y.useRef(null),A=y.useRef(`right`),j=y.useRef(0),M=m?xu:y.Fragment,N=m?{as:Th,allowPinchZoom:!0}:void 0,P=Xm(e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Hh(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Xm((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);y.useEffect(()=>()=>window.clearTimeout(E.current),[]),fl();let F=y.useCallback(e=>A.current===k.current?.side&&Wh(e,k.current?.area),[]);return(0,H.jsx)(bh,{scope:n,searchRef:D,onItemEnter:y.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:y.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:y.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:y.useCallback(e=>{k.current=e},[]),children:(0,H.jsx)(M,{...N,children:(0,H.jsx)(qc,{asChild:!0,trapped:i,onMountAutoFocus:G(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(Fc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)(qm,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:G(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(gm,{role:`menu`,"aria-orientation":`vertical`,"data-state":Lh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:G(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=w.current;if(e.target!==i||!eh.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);$m.includes(e.key)&&a.reverse(),Bh(a)}),onBlur:G(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:G(e.onPointerMove,Gh(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Dh=`MenuItem`,Oh=`menu.itemSelect`,kh=y.forwardRef(Xm(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=fh(Dh,e.__scopeMenu),s=xh(Dh,e.__scopeMenu),c=Zo(t,a),l=y.useRef(!1),u=Xm(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Oh,{bubbles:!0,cancelable:!0});e.addEventListener(Oh,e=>r?.(e),{once:!0}),_s(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,H.jsx)(Ah,{...i,ref:c,disabled:n,onClick:G(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:G(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:G(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Zm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ah=y.forwardRef(Xm(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=xh(Dh,n),s=ch(n),c=y.useRef(null),l=Zo(t,c),[u,d]=y.useState(!1),[f,p]=y.useState(``);return y.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(nh.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(Jm,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(gs.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:G(e.onPointerMove,Gh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,Gh(e=>o.onItemLeave(e))),onFocus:G(e.onFocus,()=>d(!0)),onBlur:G(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[jh,Mh]=ah(`MenuRadioGroup`,{value:void 0,onValueChange:Xm(()=>{},`onValueChange`)}),[Nh,Ph]=ah(`MenuItemIndicator`,{checked:!1}),[Fh,Ih]=ah(`MenuSub`);function Lh(e){return e?`open`:`closed`}Xm(Lh,`getOpenState`);function Rh(e){return e===`indeterminate`}Xm(Rh,`isIndeterminate`);function zh(e){return Rh(e)?`indeterminate`:e?`checked`:`unchecked`}Xm(zh,`getCheckedState`);function Bh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Xm(Bh,`focusFirst`);function Vh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Xm(Vh,`wrapArray`);function Hh(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Vh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Xm(Hh,`getNextMatch`);function Uh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Xm(Uh,`isPointInPolygon`);function Wh(e,t){return t?Uh({x:e.clientX,y:e.clientY},t):!1}Xm(Wh,`isPointerInGraceArea`);function Gh(e){return t=>t.pointerType===`mouse`?e(t):void 0}Xm(Gh,`whenMouse`);var Kh=ph,qh=mh,Jh=vh,Yh=Sh,Xh=kh,Zh=Object.defineProperty,Qh=(e,t)=>Zh(e,`name`,{value:t,configurable:!0}),$h=`DropdownMenu`,[eg,tg]=Ts($h,[oh]),ng=oh(),[rg,ig]=eg($h),ag=Qh(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ng(t),l=y.useRef(null),[u,d]=nc({prop:i,defaultProp:a??!1,onChange:o,caller:$h});return(0,H.jsx)(rg,{scope:t,triggerId:bc(),triggerRef:l,contentId:bc(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(Kh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),og=`DropdownMenuTrigger`,sg=y.forwardRef(Qh(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ig(og,n),o=ng(n),s=Zo(t,a.triggerRef);return(0,H.jsx)(qh,{asChild:!0,...o,children:(0,H.jsx)(gs.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:G(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:G(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),cg=Qh(e=>{let{__scopeDropdownMenu:t,...n}=e,r=ng(t);return(0,H.jsx)(Jh,{...r,...n})},`DropdownMenuPortal`),lg=`DropdownMenuContent`,ug=y.forwardRef(Qh(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ig(lg,n),a=ng(n),o=y.useRef(!1);return(0,H.jsx)(Yh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:G(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),dg=y.forwardRef(Qh(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ng(n);return(0,H.jsx)(Xh,{...i,...r,ref:t})},`DropdownMenuItem`)),fg=ag,pg=sg,mg=cg,hg=ug,gg=dg,_g=Object.defineProperty,vg=(e,t)=>_g(e,`name`,{value:t,configurable:!0});function yg(e,[t,n]){return Math.min(n,Math.max(t,e))}vg(yg,`clamp`);var bg=Object.defineProperty,xg=(e,t)=>bg(e,`name`,{value:t,configurable:!0}),Sg=`Popover`,[Cg,wg]=Ts(Sg,[Qp]),Tg=Qp(),[Eg,Dg]=Cg(Sg),Og=xg(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Tg(t),c=y.useRef(null),[l,u]=y.useState(!1),[d,f]=nc({prop:r,defaultProp:i??!1,onChange:a,caller:Sg});return(0,H.jsx)(mm,{...s,children:(0,H.jsx)(Eg,{scope:t,contentId:bc(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),kg=`PopoverTrigger`,Ag=y.forwardRef(xg(function(e,t){let{__scopePopover:n,...r}=e,i=Dg(kg,n),a=Tg(n),o=Zo(t,i.triggerRef),s=(0,H.jsx)(gs.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Vg(i.open),...r,ref:o,onClick:G(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(hm,{asChild:!0,...a,children:s})},`PopoverTrigger`)),jg=`PopoverPortal`,[Mg,Ng]=Cg(jg,{forceMount:void 0}),Pg=xg(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Dg(jg,t);return(0,H.jsx)(Mg,{scope:t,forceMount:n,children:(0,H.jsx)(uc,{present:n||a.open,children:(0,H.jsx)(ol,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Fg=`PopoverContent`,Ig=y.forwardRef(xg(function(e,t){let n=Ng(Fg,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Dg(Fg,e.__scopePopover);return(0,H.jsx)(uc,{present:r||a.open,children:a.modal?(0,H.jsx)(Rg,{...i,ref:t}):(0,H.jsx)(zg,{...i,ref:t})})},`PopoverContent`)),Lg=es(`PopoverContent.RemoveScroll`),Rg=y.forwardRef(xg(function(e,t){let n=Dg(Fg,e.__scopePopover),r=y.useRef(null),i=Zo(t,r),a=y.useRef(!1);return y.useEffect(()=>{let e=r.current;if(e)return Au(e)},[]),(0,H.jsx)(xu,{as:Lg,allowPinchZoom:!0,children:(0,H.jsx)(Bg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),zg=y.forwardRef(xg(function(e,t){let n=Dg(Fg,e.__scopePopover),r=y.useRef(!1),i=y.useRef(!1);return(0,H.jsx)(Bg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Bg=y.forwardRef(xg(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Dg(Fg,n),p=Tg(n);return fl(),(0,H.jsx)(qc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Fc,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,H.jsx)(gm,{"data-state":Vg(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function Vg(e){return e?`open`:`closed`}xg(Vg,`getState`);var Hg=Og,Ug=Ag,Wg=Pg,Gg=Ig,Kg=Object.defineProperty,qg=(e,t)=>Kg(e,`name`,{value:t,configurable:!0});function Jg(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}qg(Jg,`useStateMachine`);var Yg=`ScrollArea`,[Xg,Zg]=Ts(Yg),[Qg,$g]=Xg(Yg),e_=y.forwardRef(qg(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=y.useState(null),[l,u]=y.useState(null),[d,f]=y.useState(null),[p,m]=y.useState(null),[h,g]=y.useState(null),[_,v]=y.useState(0),[b,x]=y.useState(0),[S,C]=y.useState(!1),[w,T]=y.useState(!1),E=Zo(t,c),D=wc(i);return(0,H.jsx)(Qg,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,H.jsx)(gs.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),t_=`ScrollAreaViewport`,n_=y.forwardRef(qg(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=$g(t_,n),s=Zo(t,y.useRef(null),o.onViewportChange);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r_,{nonce:i}),(0,H.jsx)(gs.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,H.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),r_=y.memo(qg(function({nonce:e}){return(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),i_=`ScrollAreaScrollbar`,a_=y.forwardRef(qg(function(e,t){let{forceMount:n,...r}=e,i=$g(i_,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return y.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,H.jsx)(o_,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,H.jsx)(s_,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,H.jsx)(c_,{...r,ref:t,forceMount:n}):i.type===`always`?(0,H.jsx)(l_,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),o_=y.forwardRef(qg(function(e,t){let{forceMount:n,...r}=e,i=$g(i_,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=qg(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=qg(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,H.jsx)(uc,{present:n||a,children:(0,H.jsx)(c_,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),s_=y.forwardRef(qg(function(e,t){let{forceMount:n,...r}=e,i=$g(i_,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=k_(()=>c(`SCROLL_END`),100),[s,c]=Jg(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return y.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),y.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=qg(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,H.jsx)(uc,{present:n||s!==`hidden`,children:(0,H.jsx)(l_,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:G(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:G(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),c_=y.forwardRef(qg(function(e,t){let n=$g(i_,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),s=e.orientation===`horizontal`,c=k_(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return A_(n.viewport,c),A_(n.content,c),(0,H.jsx)(uc,{present:r||a,children:(0,H.jsx)(l_,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),l_=y.forwardRef(qg(function(e,t){let{orientation:n=`vertical`,...r}=e,i=$g(i_,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[s,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=S_(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:qg(e=>a.current=e,`onThumbChange`),onThumbPointerUp:qg(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:qg(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return w_(e,o.current,s,t)}return qg(d,`getScrollPosition`),n===`horizontal`?(0,H.jsx)(u_,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=T_(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,H.jsx)(d_,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=T_(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),u_=y.forwardRef(qg(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=$g(i_,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=Zo(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,H.jsx)(m_,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":C_(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),D_(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:x_(o.paddingLeft),paddingEnd:x_(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),d_=y.forwardRef(qg(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=$g(i_,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=Zo(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,H.jsx)(m_,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":C_(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),D_(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:x_(o.paddingTop),paddingEnd:x_(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[f_,p_]=Xg(i_),m_=y.forwardRef(qg(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=$g(i_,n),[m,h]=y.useState(null),g=Zo(t,h),_=y.useRef(null),v=y.useRef(``),b=p.viewport,x=r.content-r.viewport,S=Dc(u),C=Dc(c),w=k_(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return qg(T,`handleDragScroll`),y.useEffect(()=>{let e=qg(e=>{let t=e.target;m?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),y.useEffect(C,[r,C]),A_(m,w),A_(p.content,w),(0,H.jsx)(f_,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Dc(a),onThumbPointerUp:Dc(o),onThumbPositionChange:C,onThumbPointerDown:Dc(s),children:(0,H.jsx)(gs.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:G(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:G(e.onPointerMove,T),onPointerUp:G(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),h_=`ScrollAreaThumb`,g_=y.forwardRef(qg(function(e,t){let{forceMount:n,...r}=e,i=p_(h_,e.__scopeScrollArea);return(0,H.jsx)(uc,{present:n||i.hasThumb,children:(0,H.jsx)(__,{ref:t,...r})})},`ScrollAreaThumb`)),__=y.forwardRef(qg(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=$g(h_,n),o=p_(h_,n),{onThumbPositionChange:s}=o,c=Zo(t,o.onThumbChange),l=y.useRef(void 0),u=k_(()=>{l.current&&=(l.current(),void 0)},100);return y.useEffect(()=>{let e=a.viewport;if(e){let t=qg(()=>{if(u(),!l.current){let t=O_(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,H.jsx)(gs.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:G(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:G(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),v_=`ScrollAreaCorner`,y_=y.forwardRef(qg(function(e,t){let n=$g(v_,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,H.jsx)(b_,{...e,ref:t}):null},`ScrollAreaCorner`)),b_=y.forwardRef(qg(function(e,t){let{__scopeScrollArea:n,...r}=e,i=$g(v_,n),[a,o]=y.useState(0),[s,c]=y.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return A_(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),A_(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),y.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,H.jsx)(gs.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function x_(e){return e?parseInt(e,10):0}qg(x_,`toInt`);function S_(e,t){let n=e/t;return isNaN(n)?0:n}qg(S_,`getThumbRatio`);function C_(e){let t=S_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}qg(C_,`getThumbSize`);function w_(e,t,n,r=`ltr`){let i=C_(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return E_([c,l],d)(e)}qg(w_,`getScrollPositionFromPointer`);function T_(e,t,n=`ltr`){let r=C_(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=yg(e,n===`ltr`?[0,o]:[o*-1,0]);return E_([0,o],[0,s])(c)}qg(T_,`getThumbOffsetFromScroll`);function E_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}qg(E_,`linearScale`);function D_(e,t){return e>0&&e<t}qg(D_,`isScrollingWithinScrollbarBounds`);var O_=qg((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return qg((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function k_(e,t){let n=Dc(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}qg(k_,`useDebounceCallback`);function A_(e,t){let n=Dc(t);qs(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}qg(A_,`useResizeObserver`);var j_=e_,M_=n_,N_=y_,P_=Object.defineProperty,F_=(e,t)=>P_(e,`name`,{value:t,configurable:!0}),I_=`horizontal`,L_=[`horizontal`,`vertical`],R_=y.forwardRef(F_(function(e,t){let{decorative:n,orientation:r=I_,...i}=e,a=z_(r)?r:I_,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,H.jsx)(gs.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function z_(e){return L_.includes(e)}F_(z_,`isValidOrientation`);var B_=R_,V_=Object.defineProperty,H_=(e,t)=>V_(e,`name`,{value:t,configurable:!0}),[U_,W_]=Ts(`Tooltip`,[Qp]),G_=Qp(),K_=`TooltipProvider`,q_=700,J_=`tooltip.open`,[Y_,X_]=U_(K_),Z_=H_(e=>{let{__scopeTooltip:t,delayDuration:n=q_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(Y_,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Q_=`Tooltip`,[$_,ev]=U_(Q_),tv=H_(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=X_(Q_,e.__scopeTooltip),l=G_(t),[u,d]=y.useState(null),[f,p]=y.useState(void 0),m=bc(),h=y.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=y.useRef(!1),[b,x]=nc({prop:r,defaultProp:i??!1,onChange:H_(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(J_))):c.onClose(),a?.(e)},`onChange`),caller:Q_}),S=y.useMemo(()=>b?v.current?`delayed-open`:`instant-open`:`closed`,[b]),C=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,x(!0)},[x]),w=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,x(!0),h.current=0},_)},[_,x]);y.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,H.jsx)(mm,{...l,children:(0,H.jsx)($_,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:y.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),nv=`TooltipTrigger`,rv=y.forwardRef(H_(function(e,t){let{__scopeTooltip:n,...r}=e,i=ev(nv,n),a=X_(nv,n),o=G_(n),s=Zo(t,y.useRef(null),i.onTriggerChange),c=y.useRef(!1),l=y.useRef(!1),u=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,H.jsx)(hm,{asChild:!0,...o,children:(0,H.jsx)(gs.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:G(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:G(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:G(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:G(e.onBlur,i.onClose),onClick:G(e.onClick,i.onClose)})})},`TooltipTrigger`)),iv=`TooltipPortal`,[av,ov]=U_(iv,{forceMount:void 0}),sv=H_(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=ev(iv,t);return(0,H.jsx)(av,{scope:t,forceMount:n,children:(0,H.jsx)(uc,{present:n||a.open,children:(0,H.jsx)(ol,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),cv=`TooltipContent`,lv=y.forwardRef(H_(function(e,t){let n=ov(cv,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=ev(cv,e.__scopeTooltip);return(0,H.jsx)(uc,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(fv,{side:i,...a,ref:t}):(0,H.jsx)(uv,{side:i,...a,ref:t})})},`TooltipContent`)),uv=y.forwardRef(H_(function(e,t){let n=ev(cv,e.__scopeTooltip),r=X_(cv,e.__scopeTooltip),i=y.useRef(null),a=Zo(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=hv(r,mv(r,n.getBoundingClientRect())),a=gv(t.getBoundingClientRect()),o=vv([...i,...a]);s(o),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=H_(e=>p(e,u),`handleTriggerLeave`),t=H_(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=H_(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!_v(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,H.jsx)(fv,{...e,ref:a})},`TooltipContentHoverable`)),dv=rs(`TooltipContent`),fv=y.forwardRef(H_(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=ev(cv,n),u=G_(n),{onClose:d}=l;y.useEffect(()=>(document.addEventListener(J_,d),()=>document.removeEventListener(J_,d)),[d]),y.useEffect(()=>{if(l.trigger){let e=H_(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return qs(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,H.jsx)(Fc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,H.jsxs)(gm,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(dv,{children:r}),i?(0,H.jsx)(xs,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),pv=y.forwardRef(H_(function(e,t){let{__scopeTooltip:n,...r}=e,i=G_(n);return(0,H.jsx)(_m,{...i,...r,ref:t})},`TooltipArrow`));function mv(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}H_(mv,`getExitSideFromRect`);function hv(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}H_(hv,`getPaddedExitPoints`);function gv(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}H_(gv,`getPointsFromRect`);function _v(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}H_(_v,`isPointInPolygon`);function vv(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),yv(t)}H_(vv,`getHull`);function yv(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}H_(yv,`getHullPresorted`);var bv=Z_,xv=tv,Sv=rv,Cv=sv,wv=lv,Tv=pv;function Ev({delayDuration:e=0,...t}){return(0,H.jsx)(bv,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Dv({...e}){return(0,H.jsx)(xv,{"data-slot":`tooltip`,...e})}function Ov({...e}){return(0,H.jsx)(Sv,{"data-slot":`tooltip-trigger`,...e})}function kv({className:e,sideOffset:t=0,children:n,...r}){return(0,H.jsx)(Cv,{children:(0,H.jsxs)(wv,{"data-slot":`tooltip-content`,sideOffset:t,className:W(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,H.jsx)(Tv,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Av={frameBytes:4194304,subscribers:64,queuedBytes:262144,heartbeatMs:15e3,refreshMs:100,reconnectMs:500,maxReconnectMs:1e4,partialCharacters:262144},jv=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`BackendError`}},Mv=class{options;constructor(e={}){this.options=e}async request(e,t,n=t===void 0?`GET`:`POST`,r){if(!e.startsWith(`/api/`))throw TypeError(`Only backend API paths are supported.`);let i=this.headers();t!==void 0&&i.set(`content-type`,`application/json`);let a=await(this.options.fetch??fetch)(`${this.options.url??``}${e}`,{method:n,headers:i,...t===void 0?{}:{body:JSON.stringify(t)},signal:r??AbortSignal.timeout(3e4),redirect:`error`});if(!a.ok){let e=await a.json().catch(()=>null);throw new jv(a.status,typeof e?.error==`string`?e.error:`Backend request failed (${a.status}).`)}return await a.json()}identity(e){return this.request(`/api/backend`,void 0,`GET`,e)}sessions(){return this.request(`/api/sessions`)}createSession(){return this.request(`/api/sessions`,{},`POST`)}snapshot(e,t){return this.request(`/api/sessions/${encodeURIComponent(e)}/snapshot`,void 0,`GET`,t)}run(e){return this.request(`/api/runs`,e)}stop(e){return this.request(`/api/sessions/${encodeURIComponent(e)}/stop`,{})}watchSession(e,t,n,r){let i=new AbortController,a,o=!1,s=!1,c=()=>{s=!0,!(a||o||i.signal.aborted)&&(a=setTimeout(()=>{a=void 0,o=!0,s=!1,this.snapshot(e,i.signal).then(e=>{i.signal.aborted||t(e)}).catch(e=>{i.signal.aborted||n?.(e instanceof Error?e:Error(String(e)))}).finally(()=>{o=!1,s&&c()})},Av.refreshMs))},l=this.watch(t=>{r?.(t),(!t.sessionId||t.sessionId===e)&&c()},n);return c(),{close:()=>{i.abort(),clearTimeout(a),l.close()}}}headers(){let e=new Headers,t=typeof this.options.token==`function`?this.options.token():this.options.token;return t&&e.set(`authorization`,`Bearer ${t}`),this.options.workspace&&e.set(`x-ringko-workspace`,encodeURIComponent(this.options.workspace)),e}watch(e,t){let n=new AbortController,r=Av.reconnectMs;return(async()=>{for(;!n.signal.aborted;){try{let t=await(this.options.fetch??fetch)(`${this.options.url??``}/api/sync`,{headers:this.headers(),signal:n.signal,redirect:`error`});if(!t.ok)throw new jv(t.status,`Sync connection failed (${t.status}).`);if(r=Av.reconnectMs,await Pv(t,(t,n)=>{t===`sync`&&e(n)},n.signal),!n.signal.aborted)throw Error(`Backend sync disconnected; reconnecting.`)}catch(e){if(n.signal.aborted)break;let r=e instanceof Error?e:Error(String(e));if(t?.(r),r instanceof jv&&[401,403,409].includes(r.status))break}await Nv(r,n.signal),r=Math.min(r*2,Av.maxReconnectMs)}})(),{close:()=>n.abort()}}};function Nv(e,t){return new Promise(n=>{let r=()=>{clearTimeout(i),t.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t.addEventListener(`abort`,r,{once:!0}),t.aborted&&r()})}async function Pv(e,t,n){if(!e.body)throw Error(`Missing event stream.`);let r=e.body.getReader(),i=new TextDecoder,a=``,o=()=>{r.cancel().catch(()=>{})};n?.addEventListener(`abort`,o,{once:!0});try{for(;!n?.aborted;){let{value:e,done:n}=await r.read();if(n)break;if(a+=i.decode(e,{stream:!0}),a.length>Av.frameBytes)throw Error(`Event stream frame exceeds the size limit.`);let o;for(;(o=a.search(/\r?\n\r?\n/))>=0;){let e=a.slice(o).match(/^\r?\n\r?\n/)?.[0]??`
53
+
54
+ `,n=a.slice(0,o);a=a.slice(o+e.length);let r=`message`,i=[];for(let e of n.split(/\r?\n/))e.startsWith(`event:`)&&(r=e.slice(6).trimStart()),e.startsWith(`data:`)&&i.push(e.slice(5).trimStart());i.length&&t(r,JSON.parse(i.join(`
55
+ `)))}}}finally{n?.removeEventListener(`abort`,o),await r.cancel().catch(()=>{}),r.releaseLock()}}function Fv(e,t={},n){let r=new URLSearchParams;return t.before!==void 0&&r.set(`before`,String(t.before)),t.after!==void 0&&r.set(`after`,String(t.after)),fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/trajectory?${r}`,{headers:ey(),signal:n}).then(async e=>{if(e.status===401)throw new Zv;if(!e.ok)throw Error(`Trajectory request failed (${e.status}).`);return await e.json()})}function Iv(){return ty(`/api/permissions`)}async function Lv(e,t){let n=await fetch(`${Kv}/api/permissions`,{method:`DELETE`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({workspace:e,...t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(typeof e.error==`string`?e.error:`Permission update failed (${n.status}).`)}}function Rv(e=``){return ty(`/api/workspace/files?path=${encodeURIComponent(e)}`)}function zv(e){return ty(`/api/workspace/file?path=${encodeURIComponent(e)}`)}function Bv(e=``){return ty(`/api/workspace/diff?path=${encodeURIComponent(e)}`)}async function Vv(e,t){let n=await fetch(`${Kv}/api/terminal`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({cols:e,rows:t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(typeof e.error==`string`?e.error:`Terminal start failed (${n.status}).`)}return await n.json()}async function Hv(e){let t=await fetch(`${Kv}/api/terminal/${encodeURIComponent(e)}`,{method:`DELETE`,headers:ey()});if(t.status===401)throw new Zv;if(!t.ok&&t.status!==404)throw Error(`Terminal close failed (${t.status}).`)}function Uv(e){let t=new URL(`/api/terminal/${encodeURIComponent(e)}/socket`,window.location.href);return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.toString()}function Wv(e,t,n=-1){return ty(`/api/sessions/${encodeURIComponent(e)}/task-detail?taskId=${encodeURIComponent(t)}&after=${n}`)}async function Gv(e){let t=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/stop`,{method:`POST`,headers:ey()});if(t.status===401)throw new Zv;if(!t.ok&&t.status!==404)throw Error(`Stop failed (${t.status}).`)}var Kv=``,qv=new Mv({token:()=>Qv()});async function Jv(e,t){let n=await fetch(`${Kv}/api/ask`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({id:e,...t?{output:t}:{cancel:!0}})});if(!n.ok)throw Error(`Answer failed (${n.status}).`)}async function Yv(e,t,n){let r=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/jobs`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({jobId:t,action:n})});if(!r.ok)throw Error(`Job action failed (${r.status}).`);return await r.json()}var Xv=`ringko.token`,Zv=class extends Error{constructor(){super(`unauthorized`),this.name=`UnauthorizedError`}};function Qv(){try{return localStorage.getItem(Xv)}catch{return null}}function $v(e){try{localStorage.setItem(Xv,e)}catch{}}function ey(e){let t=new Headers(e),n=Qv();return n&&t.set(`authorization`,`Bearer ${n}`),t}async function ty(e){let t=await fetch(`${Kv}${e}`,{headers:ey()});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`${e}: ${t.status}`);return await t.json()}function ny(){return ty(`/api/info`)}function ry(e){return ty(`/api/sessions/${encodeURIComponent(e)}/context`)}async function iy(e,t){let n=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/fork`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(t===void 0?{}:{index:t})});if(n.status===401)throw new Zv;if(!n.ok)throw Error(`Branch failed (${n.status}).`);return await n.json()}function ay(e){return ty(`/api/sessions/${encodeURIComponent(e)}/feedback`)}async function oy(e,t,n){let r=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/feedback`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({index:t,value:n})});if(r.status===401)throw new Zv;if(!r.ok)throw Error(`Feedback failed (${r.status}).`)}function sy(){return ty(`/api/sessions`)}function cy(e){return qv.snapshot(e)}function ly(e,t=0){return ty(`/api/sessions/${encodeURIComponent(e)}/tool-log?offset=${t}`)}async function uy(){let e=await fetch(`${Kv}/api/sessions`,{method:`POST`,headers:ey()});if(e.status===401)throw new Zv;if(!e.ok)throw Error(`Create session failed (${e.status}).`);return await e.json()}async function dy(e,t,n){let r=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}/${t}`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(n??{})});if(r.status===401)throw new Zv;if(!r.ok)throw Error(`${t} failed (${r.status}).`)}function fy(e,t){return dy(e,`title`,{title:t})}function py(e,t){return dy(e,`archive`,{archived:t})}async function my(e){let t=await fetch(`${Kv}/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`,headers:ey()});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Delete failed (${t.status}).`)}async function hy(e,t,n){let r=await fetch(`${Kv}/api/approval`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({id:e,approved:t,scope:n})});if(!r.ok)throw Error(`Approval failed (${r.status}).`)}function gy(){return ty(`/api/projects`)}async function _y(e){let t=await fetch(`${Kv}/api/projects`,e);if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Request failed (${t.status}).`)}return await t.json()}function vy(){return ty(`/api/mcp`)}function yy(){return ty(`/api/mcp/connected`)}async function by(e,t){let n=await fetch(`${Kv}/api/mcp/test`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({name:e,config:t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Test failed (${n.status}).`)}return await n.json()}async function xy(e,t){let n=await fetch(`${Kv}/api/mcp/oauth`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({name:e,url:t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`OAuth start failed (${n.status}).`)}return await n.json()}async function Sy(e,t=`global`){let n=await fetch(`${Kv}/api/mcp`,{method:`PUT`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({servers:e,scope:t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Save failed (${n.status}).`)}return await n.json()}function Cy(){return ty(`/api/skills`)}async function wy(e){let t=await fetch(`${Kv}/api/skills`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(e)});if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Create failed (${t.status}).`)}return await t.json()}async function Ty(e){let t=await fetch(`${Kv}/api/skills/remove`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({dir:e})});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Remove failed (${t.status}).`);return await t.json()}function Ey(e){return ty(`/api/fs/list${e&&e.trim().length>0?`?path=${encodeURIComponent(e)}`:``}`)}async function Dy(e,t){let n=await fetch(`${Kv}/api/fs/mkdir`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({path:e,name:t})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Create failed (${n.status}).`)}return(await n.json()).path}function Oy(e,t){return _y({method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({path:e,...t?{name:t}:{}})})}async function ky(e){let t=await fetch(`${Kv}/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`,headers:ey()});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Remove failed (${t.status}).`);return await t.json()}async function Ay(e){let t=await fetch(`${Kv}/api/projects/${encodeURIComponent(e)}/current`,{method:`POST`,headers:ey()});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Switch failed (${t.status}).`);return await t.json()}function jy(){return ty(`/api/providers`)}function My(){return ty(`/api/presets`)}async function Ny(e){let t=await fetch(`${Kv}/api/providers`,{method:`PUT`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(e)});if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Save failed (${t.status}).`)}return await t.json()}async function Py(e,t){let n=await e.text().catch(()=>``);if(n.length>0)try{let e=JSON.parse(n);if(typeof e.error==`string`)return Error(e.error)}catch{return Error(n)}return Error(t)}async function Fy(e,t,n){let r=await fetch(`${Kv}${e}`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(t)});if(r.status===401)throw new Zv;if(!r.ok)throw await Py(r,n);return await r.json()}function Iy(){return ty(`/api/auth`)}async function Ly(e){let t=await fetch(`${Kv}/api/auth/oauth`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({domain:e})});if(t.status===401)throw new Zv;if(!t.ok)throw await Py(t,`OAuth start failed (${t.status}).`);return await t.json()}function Ry(e){return ty(`/api/auth/oauth/${encodeURIComponent(e)}`)}function zy(e,t){return ty(`/api/auth/quota?domain=${encodeURIComponent(e)}&accountId=${encodeURIComponent(t)}`)}function By(e,t){return Fy(`/api/auth/default`,{domain:e,accountId:t},`Could not set the default account.`)}function Vy(e,t){return Fy(`/api/auth/remove`,{domain:e,accountId:t},`Could not remove the account.`)}async function Hy(e){let t=await fetch(`${Kv}/api/mode`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({workflow:e})});if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Switch failed (${t.status}).`)}return await t.json()}async function Uy(e){let t=await fetch(`${Kv}/api/access`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({mode:e})});if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Switch failed (${t.status}).`)}return await t.json()}async function Wy(e){let t=new FormData;t.append(`file`,e);let n=await fetch(`${Kv}/api/upload`,{method:`POST`,headers:ey(),body:t});if(n.status===401)throw new Zv;if(!n.ok)throw Error(`Upload failed (${n.status}).`);return(await n.json()).files[0]}async function Gy(e){let t=await fetch(`${Kv}/api/thinking`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({level:e})});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Set thinking failed (${t.status}).`);return await t.json()}async function Ky(e){let t=await fetch(`${Kv}/api/ui`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(e)});if(t.status===401)throw new Zv;if(!t.ok)throw Error(`Set UI failed (${t.status}).`);return await t.json()}async function qy(e,t){let n=await fetch(`${Kv}/api/compact`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({sessionId:e,...t?{instructions:t}:{}})});if(n.status===401)throw new Zv;if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Compaction failed (${n.status}).`)}return await n.json()}async function Jy(e){let t=await fetch(`${Kv}/api/model`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify({model:e})});if(t.status===401)throw new Zv;if(!t.ok){let e=await t.text().catch(()=>``);throw Error(e||`Switch failed (${t.status}).`)}return await t.json()}async function Yy(){let e=await fetch(`${Kv}/api/reload`,{method:`POST`,headers:ey()});if(e.status===401)throw new Zv;if(!e.ok)throw Error(`Reload failed (${e.status}).`);return await e.json()}async function Xy(e){return(await fetch(`${Kv}/api/sessions`,{headers:{authorization:`Bearer ${e}`}})).ok}function Zy(e,t){let n=new AbortController;(async()=>{let i;try{i=await fetch(`${Kv}/api/chat`,{method:`POST`,headers:ey({"content-type":`application/json`}),body:JSON.stringify(e),signal:n.signal})}catch(e){n.signal.aborted||t.onError(e instanceof Error?e.message:`Request failed.`);return}if(i.status===401){t.onUnauthorized?.();return}if(!i.ok||!i.body){let e=await i.text().catch(()=>``);t.onError(e||`Request failed (${i.status}).`);return}let a=!1;try{await Pv(i,(e,t)=>{(e===`done`||e===`error`)&&(a=!0),r(e,t)},n.signal),!a&&!n.signal.aborted&&t.onError(`Stream disconnected. The backend keeps running; synchronizing the session.`)}catch(e){n.signal.aborted||t.onError(e instanceof Error?e.message:`Stream failed.`)}})();function r(e,n){switch(e){case`delta`:{let e=n;(e.kind===`text`||e.kind===`reasoning`)&&typeof e.text==`string`&&t.onDelta?.({kind:e.kind,text:e.text});break}case`job`:t.onJob?.(n);break;case`ask`:t.onAsk?.(n);break;case`ask_closed`:t.onAskClosed?.(n.id);break;case`session`:{let e=n.sessionId;typeof e==`string`&&t.onSession?.(e);break}case`assistant`:t.onAssistant(n);break;case`task`:t.onTask?.(n);break;case`approval_closed`:t.onApprovalClosed?.(n.id);break;case`tool`:t.onTool(n);break;case`approval`:t.onApproval(n);break;case`todo`:t.onTodo?.(n.items??[]);break;case`loop`:t.onLoop?.(n);break;case`session_meta`:t.onSessionMeta?.();break;case`done`:t.onDone(n);break;case`error`:t.onError(n.message??`Run failed.`)}}return{abort:()=>n.abort()}}function Qy(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Qy(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function $y(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Qy(e))&&(r&&(r+=` `),r+=t);return r}var eb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,tb=$y,nb=(e,t)=>n=>{if(t?.variants==null)return tb(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=eb(t)||eb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return tb(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},rb=nb(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function K({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?ts:`button`;return(0,H.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:W(rb({variant:t,size:n,className:e})),...i})}function ib({...e}){return(0,H.jsx)(Cd,{"data-slot":`alert-dialog`,...e})}function ab({...e}){return(0,H.jsx)(wd,{"data-slot":`alert-dialog-portal`,...e})}function ob({className:e,...t}){return(0,H.jsx)(Td,{"data-slot":`alert-dialog-overlay`,className:W(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function sb({className:e,size:t=`default`,...n}){return(0,H.jsxs)(ab,{children:[(0,H.jsx)(ob,{}),(0,H.jsx)(Ed,{"data-slot":`alert-dialog-content`,"data-size":t,className:W(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function cb({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:W(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function lb({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:W(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function ub({className:e,...t}){return(0,H.jsx)(kd,{"data-slot":`alert-dialog-title`,className:W(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function db({className:e,...t}){return(0,H.jsx)(Ad,{"data-slot":`alert-dialog-description`,className:W(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function fb({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,H.jsx)(K,{variant:t,size:n,asChild:!0,children:(0,H.jsx)(Dd,{"data-slot":`alert-dialog-action`,className:W(e),...r})})}function pb({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,H.jsx)(K,{variant:t,size:n,asChild:!0,children:(0,H.jsx)(Od,{"data-slot":`alert-dialog-cancel`,className:W(e),...r})})}function mb({...e}){return(0,H.jsx)(Ru,{"data-slot":`dialog`,...e})}function hb({...e}){return(0,H.jsx)(Bu,{"data-slot":`dialog-trigger`,...e})}function gb({...e}){return(0,H.jsx)(Wu,{"data-slot":`dialog-portal`,...e})}function _b({className:e,...t}){return(0,H.jsx)(Ku,{"data-slot":`dialog-overlay`,className:W(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function vb({className:e,children:t,showCloseButton:n=!0,...r}){return(0,H.jsxs)(gb,{children:[(0,H.jsx)(_b,{}),(0,H.jsxs)(Xu,{"data-slot":`dialog-content`,className:W(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,H.jsx)(ad,{"data-slot":`dialog-close`,asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,H.jsx)(Za,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function yb({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:W(`flex flex-col gap-2`,e),...t})}function bb({className:e,showCloseButton:t=!1,children:n,...r}){return(0,H.jsxs)(`div`,{"data-slot":`dialog-footer`,className:W(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,H.jsx)(ad,{asChild:!0,children:(0,H.jsx)(K,{variant:`outline`,children:`Close`})})]})}function xb({className:e,...t}){return(0,H.jsx)(td,{"data-slot":`dialog-title`,className:W(`font-heading text-base leading-none font-medium`,e),...t})}function Sb({className:e,type:t,...n}){return(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:W(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function Cb({className:e,children:t,...n}){return(0,H.jsxs)(j_,{"data-slot":`scroll-area`,className:W(`relative`,e),...n,children:[(0,H.jsx)(M_,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,H.jsx)(wb,{}),(0,H.jsx)(N_,{})]})}function wb({className:e,orientation:t=`vertical`,...n}){return(0,H.jsx)(a_,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:W(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,H.jsx)(g_,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var Tb={"upload.limit":`Attach up to 16 files per message.`,"workspace.title":`Files & changes`,"workspace.scope":`Read-only view of the server workspace. Git changes compare with HEAD, not a specific task.`,"workspace.up":`Parent directory`,"workspace.refresh":`Refresh`,"workspace.allChanges":`All changes`,"workspace.file":`File`,"workspace.diff":`Git diff`,"workspace.loading":`Loading…`,"workspace.empty":`No content or changes to display.`,"workspace.binary":`Binary files cannot be previewed here.`,"workspace.truncated":`Preview or listing reached its size limit.`,"rightSidebar.title":`Right sidebar`,"rightSidebar.files":`Workspace files`,"rightSidebar.terminal":`Terminal`,"rightSidebar.close":`Close right sidebar`,"terminal.starting":`Starting terminal…`,"terminal.connected":`Connected`,"terminal.disconnected":`Disconnected`,"terminal.error":`Terminal error`,"terminal.restart":`Restart terminal`,"terminal.invalidData":`Received invalid terminal data.`,"terminal.serverError":`The terminal server reported an error.`,"terminal.connectionError":`Could not connect to the terminal.`,"terminal.exited":`Shell exited (code {code}).`,"queue.title":`Queued messages`,"queue.resume":`Resume queue`,"queue.hint":`Runs in order after the current task finishes. Stopping or a failure pauses the queue.`,"queue.edit":`Edit queued message`,"queue.attachments":`{count} attachments`,"queue.save":`Save`,"queue.cancel":`Cancel edit`,"queue.remove":`Remove queued message`,"queue.add":`Add to queue`,"queue.commandBusy":`Wait for the current run before using this command.`,"stream.live":`Live response`,"session.running":`Running`,"task.inspect":`View task details`,"task.events":`Child conversation and tools`,"task.loading":`Loading task events…`,"task.emptyEvents":`No recorded child events.`,"app.name":`RingKo`,"nav.chat":`Chat`,"nav.settings":`Settings`,"sidebar.sessions":`Sessions`,"sidebar.new":`New chat`,"sidebar.empty":`No sessions yet.`,"sidebar.untitled":`New chat`,"session.actions":`Session actions`,"session.rename":`Rename`,"session.fork":`Fork`,"session.forked":`Forked into a new session`,"session.archive":`Archive`,"session.unarchive":`Unarchive`,"session.delete":`Delete`,"session.deleteTitle":`Delete this session?`,"session.deleteDesc":`This permanently deletes the session log and cannot be undone.`,"session.renameTitle":`Rename session`,"session.titlePlaceholder":`Session title`,"session.archived":`Archived`,"session.showArchived":`Show archived`,"session.hideArchived":`Hide archived`,"common.cancel":`Cancel`,"common.save":`Save`,"header.noModel":`no model`,"header.tools":`{count} tools`,"message.you":`You`,"message.assistant":`Assistant`,"message.tool":`Tool · {name}`,"message.reasoning":`reasoning`,"message.copy":`Copy`,"message.copied":`Copied`,"message.branch":`Branch from here`,"message.branched":`Branched into a new session`,"message.good":`Good response`,"message.bad":`Bad response`,"message.files":`{count} files`,"message.matches":`{count} matches`,"message.arguments":`arguments`,"message.completed":`Completed`,"message.failed":`Failed`,"message.unknown":`Outcome unknown`,"message.output":`output`,"message.working":`working…`,"message.empty":`Ask anything. Tools run through the approval gate.`,"chat.greeting.morning":`Good morning`,"chat.greeting.noon":`Good afternoon`,"chat.greeting.afternoon":`Good afternoon`,"chat.greeting.dusk":`Good evening`,"chat.greeting.evening":`Good evening`,"chat.emptyTitle":`How can I help?`,"chat.suggest.1":`Summarize this repository`,"chat.suggest.2":`Find and fix the lint errors`,"chat.suggest.3":`Explain how the agent loop works`,"model.select":`Model`,"model.search":`Search models…`,"model.empty":`No models configured.`,"model.noMatches":`No matching models.`,"model.switched":`Model switched.`,"access.title":`Permission mode`,"access.approval":`Request approval`,"access.approval.desc":`Always ask when editing external files or using the internet`,"access.assist":`Approve risky actions`,"access.assist.desc":`Only request approval for detected risky operations`,"access.full":`Full access`,"access.full.desc":`Unrestricted access to the internet and any file on your computer`,"access.changed":`Permission mode changed.`,"thinking.title":`Reasoning effort`,"thinking.off":`Off`,"thinking.low":`Low`,"thinking.high":`High`,"thinking.max":`Max`,"thinking.changed":`Reasoning effort changed.`,"todo.title":`Todo`,"ui.showThinking":`Show reasoning`,"ui.showTools":`Show tool output`,"toolLog.title":`Tool call log`,"toolLog.description":`Recorded calls and results for this session.`,"toolLog.callId":`Call ID`,"toolLog.turn":`Turn`,"toolLog.requested":`Requested`,"toolLog.started":`Started`,"toolLog.completed":`Completed`,"toolLog.duration":`Duration`,"toolLog.success":`Completed`,"toolLog.error":`Failed`,"toolLog.running":`Running`,"toolLog.noResult":`No result recorded`,"toolLog.noSession":`Open a session to view its tool calls.`,"toolLog.loading":`Loading tool calls…`,"toolLog.loadFailed":`Could not load the tool call log.`,"toolLog.empty":`No tool calls recorded in this session.`,"toolLog.loadMore":`Load earlier calls`,"toolLog.refresh":`Refresh log`,"toolLog.close":`Close log`,"compact.done":`Compacted.`,"compact.none":`Nothing to compact.`,"command.compact":`Compact context`,"composer.hint":`Enter to send · Shift+Enter for newline · /reload reloads config`,"context.usage":`{used} / {limit} tokens ({percent}%)`,"command.reload":`Reload configuration`,"command.loop":`Loop a prompt until a completion promise`,"loop.running":`Loop iteration {iteration}`,"loop.usage":`Usage: /loop <prompt> [--max-iterations N] [--completion-promise TEXT]`,"upload.attach":`Attach files`,"upload.failed":`Upload failed.`,"composer.placeholder":`Type a message… (Enter to send, Shift+Enter for newline)`,"composer.send":`Send`,"composer.stop":`Stop`,"approval.title":`Approve {tool}?`,"approval.approve":`Approve`,"approval.session":`Allow for session`,"approval.saved":`Remember this tool and target`,"approval.deny":`Deny`,"settings.title":`Settings`,"settings.general":`General`,"settings.models":`Models`,"settings.appearance":`Appearance`,"settings.about":`About`,"settings.workspace":`Workspace`,"settings.providers":`Providers`,"settings.providerModels":`{count} models`,"settings.noProviders":`No providers configured.`,"settings.tools":`Tools`,"settings.access":`Access mode`,"settings.version":`Version`,"settings.authRequired":`Authentication`,"settings.authOn":`Enabled`,"settings.authOff":`Disabled`,"settings.providersHint":`Providers are required; models are optional.`,"settings.connectors":`Connectors`,"settings.skills":`Skills`,"settings.permissions":`Permissions`,"permissions.hint":`Saved rules for this workspace. Removing an allow rule makes future calls ask again when approval is required.`,"permissions.empty":`No saved permission rules.`,"permissions.remove":`Remove`,"permissions.confirm":`Confirm removal`,"permissions.cancel":`Cancel`,"permissions.removed":`Permission rule removed.`,"permissions.workspaceChanged":`Workspace changed. Reload permissions before removing a rule.`,"connectors.hint":`MCP servers available to the agent.`,"connectors.add":`Add connector`,"connectors.name":`Name`,"connectors.config":`Config (JSON)`,"connectors.empty":`No connectors configured.`,"connectors.saved":`Connectors saved.`,"connectors.invalidJson":`Config must be valid JSON.`,"skills.hint":`Skills installed under ~/.ringko/skills and ~/.agents/skills.`,"skills.empty":`No skills installed.`,"skills.create":`Create skill`,"skills.name":`Name`,"skills.description":`Description`,"skills.body":`Instructions (Markdown)`,"skills.created":`Skill created.`,"skills.removed":`Skill removed.`,"settings.projects":`Projects`,"projects.hint":`Projects are the workspaces the agent operates in.`,"projects.add":`Add project`,"projects.addTitle":`Add project`,"projects.browse":`Browse…`,"browser.title":`Select a folder`,"browser.open":`Open`,"browser.cancel":`Cancel`,"browser.newFolder":`New folder`,"browser.folderName":`Folder name`,"browser.editPath":`Edit path`,"browser.home":`Home`,"browser.loading":`Loading…`,"browser.empty":`No subfolders.`,"browser.showHidden":`Show hidden`,"browser.up":`Up`,"projects.browseFailed":`Could not open the folder picker; enter a path manually.`,"projects.path":`Path`,"projects.name":`Name`,"projects.current":`Active`,"projects.use":`Use`,"projects.remove":`Remove`,"projects.empty":`No projects yet.`,"projects.loading":`Loading projects…`,"projects.loadFailed":`Could not load projects.`,"projects.added":`Project added.`,"projects.removed":`Project removed.`,"projects.switched":`Project switched.`,"settings.addProvider":`Add provider`,"settings.fromPreset":`Add from preset`,"settings.visual":`Editor`,"settings.json":`JSON`,"settings.providerName":`Name`,"settings.providerType":`Type`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API key`,"settings.addModel":`Add model`,"settings.modelId":`Model id`,"settings.modelName":`Display name`,"settings.remove":`Remove`,"settings.save":`Save`,"settings.saved":`Saved.`,"settings.invalidJson":`Invalid JSON.`,"settings.reload":`Reload`,"settings.reloadDone":`Configuration reloaded.`,"login.title":`Sign in`,"login.description":`This RingKo server requires an access token (RINGKO_WEB_TOKEN).`,"login.token":`Access token`,"login.submit":`Sign in`,"login.error":`Invalid token.`,"login.disabled":`Authentication is not enabled.`,"login.signOut":`Sign out`,"theme.toggle":`Theme`,"theme.light":`Light`,"theme.dark":`Dark`,"theme.system":`System`,"language.toggle":`Language`,"trajectory.title":`Trajectory`,"trajectory.task":`Tasks`,"task.title":`Subtasks`,"task.read":`Read only`,"task.write":`Read & write`,"task.running":`Running`,"task.completed":`Completed`,"task.failed":`Failed`,"task.cancelled":`Cancelled`,"task.unknown":`Outcome unknown`,"task.detailsHint":`Open Trajectory to inspect child tool calls and recorded events.`,"trajectory.latest":`Latest`,"trajectory.chat":`Chat`,"trajectory.description":`Recorded session events. Updates every 3 seconds; timing is shown only when recorded.`,"trajectory.all":`All`,"trajectory.user":`User`,"trajectory.assistant":`Assistant`,"trajectory.model":`Model`,"trajectory.tool":`Tools`,"trajectory.compaction":`Compaction`,"trajectory.session":`Session`,"trajectory.search":`Search loaded event summaries`,"trajectory.timeline":`Sequence overview · latest {count} matching events`,"trajectory.timelineLabel":`Select an event from the sequence overview`,"trajectory.older":`Load older events`,"trajectory.empty":`No matching events.`,"trajectory.loadFailed":`Could not load trajectory. Refresh to retry.`,"trajectory.windowLimit":`Showing at most {count} events in this view. The complete log remains on disk.`,"trajectory.type":`Event type`,"trajectory.time":`Recorded at`,"trajectory.data":`Event data`,"trajectory.copy":`Copy displayed event data`,"trajectory.copied":`Event data copied.`,"trajectory.copyFailed":`Could not copy event data.`,"trajectory.truncated":`Large event data is truncated for display; the complete event remains in the session log.`,"settings.oauth":`OAuth2 credentials`,"settings.oauthHint":`OAuth2 providers are managed under OAuth2 credentials.`,"oauth.title":`OAuth2 credentials`,"oauth.intro":`Sign in for providers that authenticate with OAuth2 instead of an API key.`,"oauth.empty":`No OAuth2 providers configured.`,"oauth.add":`Add OAuth2 provider`,"oauth.addTitle":`Add OAuth2 provider`,"oauth.name":`Provider name`,"oauth.type":`Provider type`,"oauth.models":`Models (optional, comma separated)`,"oauth.signedIn":`Signed in`,"oauth.signedOut":`Not signed in`,"oauth.account":`Account`,"oauth.signIn":`Sign in`,"oauth.signOut":`Sign out`,"oauth.signedInToast":`Signed in.`,"oauth.signedOutToast":`Signed out.`,"oauth.signInFailed":`Sign in failed.`,"oauth.signOutFailed":`Sign out failed.`,"oauth.deviceHint":`Open the verification page and enter this code:`,"oauth.open":`Open verification page`,"oauth.copyCode":`Copy code`,"oauth.copied":`Code copied.`,"oauth.copyFailed":`Could not copy code.`,"oauth.waiting":`Waiting for authorization…`,"oauth.cancel":`Cancel`,"oauth.added":`Provider added.`,"oauth.removed":`Provider removed.`,"oauth.remove":`Remove`,"oauth.loadFailed":`Could not load credentials.`,"oauth.unsupported":`This provider type does not support OAuth2.`,"task.full":`Full access`,"ask.title":`Questions from the agent`,"ask.custom":`Custom answer`,"ask.submit":`Submit answers`,"ask.cancel":`Cancel questions`,"job.title":`Jobs and subscriptions`,"job.background":`Background`,"job.foreground":`Foreground`,"job.detach":`Move to background`,"job.cancel":`Cancel job`,"job.result":`Check result`,"oauth.accountCount":`{count} account(s)`,"oauth.noAccounts":`No accounts yet.`,"oauth.addAccount":`Add account`,"oauth.removeAccount":`Remove account`,"oauth.setDefault":`Set as default`,"oauth.default":`Default`,"oauth.reauth":`Re-login required`,"oauth.signedInAs":`Signed in as {login}`,"oauth.quota":`Subscription usage`,"oauth.quotaLoading":`Loading usage…`,"oauth.quotaFailed":`Usage unavailable`,"oauth.window5h":`5h`,"oauth.window7d":`7d`,"oauth.window30d":`30d`,"oauth.quotaResets":`resets in {time}`,"oauth.windowWeekly":`Week`,"oauth.windowMonthly":`Month`,"oauth.windowDaily":`Day`,"connectors.project":`Project`,"connectors.global":`Global`,"connectors.test":`Test connection`,"connectors.testOk":`Connected — {count} tool(s)`,"connectors.command":`Command`,"connectors.args":`Args`,"connectors.env":`Environment (JSON)`,"connectors.url":`URL`,"connectors.headers":`Headers (JSON)`,"connectors.connected":`Connected servers`,"connectors.noneConnected":`No MCP servers connected.`,"connectors.toolCount":`{count} tools`,"skills.project":`Project`,"skills.global":`Global`,"connectors.login":`OAuth sign-in`,"connectors.authenticated":`Authenticated`,"connectors.loginFirst":`Not authenticated — run OAuth sign-in first.`,"mode.title":`Mode`,"mode.changed":`Mode changed.`,"code.copy":`Copy code`,"code.wrap":`Wrap lines`,"code.nowrap":`No wrap`},Eb={"upload.limit":`每条消息最多添加 16 个附件。`,"workspace.title":`文件与变更`,"workspace.scope":`只读查看服务工作区。Git 变更与 HEAD 对比,不代表某个任务的修改。`,"workspace.up":`上一级目录`,"workspace.refresh":`刷新`,"workspace.allChanges":`全部变更`,"workspace.file":`文件`,"workspace.diff":`Git 差异`,"workspace.loading":`正在加载…`,"workspace.empty":`没有可展示的内容或变更。`,"workspace.binary":`此处不支持预览二进制文件。`,"workspace.truncated":`预览或目录列表已达到大小限制。`,"rightSidebar.title":`右侧栏`,"rightSidebar.files":`工作区文件`,"rightSidebar.terminal":`终端`,"rightSidebar.close":`收起右侧栏`,"terminal.starting":`正在启动终端…`,"terminal.connected":`已连接`,"terminal.disconnected":`已断开`,"terminal.error":`终端错误`,"terminal.restart":`重启终端`,"terminal.invalidData":`收到无效的终端数据。`,"terminal.serverError":`终端服务返回错误。`,"terminal.connectionError":`无法连接到终端。`,"terminal.exited":`Shell 已退出(代码 {code})。`,"queue.title":`消息队列`,"queue.resume":`继续队列`,"queue.hint":`当前任务完成后按顺序执行。停止或失败会暂停队列。`,"queue.edit":`修改排队消息`,"queue.attachments":`{count} 个附件`,"queue.save":`保存`,"queue.cancel":`取消修改`,"queue.remove":`删除排队消息`,"queue.add":`加入队列`,"queue.commandBusy":`请等待当前任务结束后再使用此命令。`,"stream.live":`实时回复`,"session.running":`运行中`,"task.inspect":`查看任务详情`,"task.events":`子代理对话与工具`,"task.loading":`正在加载任务事件…`,"task.emptyEvents":`暂无已记录的子代理事件。`,"app.name":`RingKo`,"nav.chat":`对话`,"nav.settings":`设置`,"sidebar.sessions":`会话`,"sidebar.new":`新会话`,"sidebar.empty":`暂无会话。`,"sidebar.untitled":`新会话`,"session.actions":`会话操作`,"session.rename":`重命名`,"session.fork":`分叉`,"session.forked":`已分叉为新会话`,"session.archive":`归档`,"session.unarchive":`取消归档`,"session.delete":`删除`,"session.deleteTitle":`删除该会话?`,"session.deleteDesc":`将永久删除该会话日志,且无法恢复。`,"session.renameTitle":`重命名会话`,"session.titlePlaceholder":`会话标题`,"session.archived":`已归档`,"session.showArchived":`显示已归档`,"session.hideArchived":`隐藏已归档`,"common.cancel":`取消`,"common.save":`保存`,"header.noModel":`未配置模型`,"header.tools":`{count} 个工具`,"message.you":`你`,"message.assistant":`助手`,"message.tool":`工具 · {name}`,"message.reasoning":`推理`,"message.copy":`复制`,"message.copied":`已复制`,"message.branch":`从这里分支`,"message.branched":`已分支为新会话`,"message.good":`回答不错`,"message.bad":`回答不好`,"message.files":`{count} 个文件`,"message.matches":`{count} 处匹配`,"message.arguments":`参数`,"message.completed":`已完成`,"message.failed":`失败`,"message.unknown":`结果未知`,"message.output":`输出`,"message.working":`处理中…`,"message.empty":`输入任何问题。工具调用会经过审批。`,"chat.greeting.morning":`早上好`,"chat.greeting.noon":`中午好`,"chat.greeting.afternoon":`下午好`,"chat.greeting.dusk":`傍晚好`,"chat.greeting.evening":`晚上好`,"chat.emptyTitle":`有什么可以帮你的?`,"chat.suggest.1":`总结这个仓库`,"chat.suggest.2":`找出并修复 lint 错误`,"chat.suggest.3":`讲解一下 agent loop 的原理`,"model.select":`模型`,"model.search":`搜索模型…`,"model.empty":`未配置模型。`,"model.noMatches":`没有找到匹配的模型。`,"model.switched":`已切换模型。`,"access.title":`权限模式`,"access.approval":`请求批准`,"access.approval.desc":`编辑外部文件和使用互联网时始终询问`,"access.assist":`帮我批准`,"access.assist.desc":`仅对检测到的风险操作请求批准`,"access.full":`完全访问权限`,"access.full.desc":`可不受限制地访问互联网和你电脑上的任何文件`,"access.changed":`已切换权限模式。`,"thinking.title":`思考程度`,"thinking.off":`关闭`,"thinking.low":`低`,"thinking.high":`高`,"thinking.max":`最高`,"thinking.changed":`已切换思考程度。`,"todo.title":`待办`,"ui.showThinking":`显示推理`,"ui.showTools":`显示工具输出`,"toolLog.title":`工具调用日志`,"toolLog.description":`查看此会话记录的工具调用与结果。`,"toolLog.callId":`调用 ID`,"toolLog.turn":`轮次`,"toolLog.requested":`请求时间`,"toolLog.started":`开始时间`,"toolLog.completed":`完成时间`,"toolLog.duration":`耗时`,"toolLog.success":`已完成`,"toolLog.error":`失败`,"toolLog.running":`运行中`,"toolLog.noResult":`未记录结果`,"toolLog.noSession":`打开会话后可查看工具调用。`,"toolLog.loading":`正在加载工具调用…`,"toolLog.loadFailed":`无法加载工具调用日志。`,"toolLog.empty":`此会话尚无工具调用记录。`,"toolLog.loadMore":`加载更早的调用`,"toolLog.refresh":`刷新日志`,"toolLog.close":`关闭日志`,"compact.done":`已压缩。`,"compact.none":`无需压缩。`,"command.compact":`压缩上下文`,"composer.hint":`Enter 发送 · Shift+Enter 换行 · /reload 重载配置`,"context.usage":`{used} / {limit} tokens({percent}%)`,"command.reload":`重载配置`,"command.loop":`循环执行提示词直到完成承诺`,"loop.running":`循环第 {iteration} 轮`,"loop.usage":`用法:/loop <提示词> [--max-iterations N] [--completion-promise TEXT]`,"upload.attach":`上传文件`,"upload.failed":`上传失败。`,"composer.placeholder":`输入消息…(Enter 发送,Shift+Enter 换行)`,"composer.send":`发送`,"composer.stop":`停止`,"approval.title":`批准 {tool}?`,"approval.approve":`批准`,"approval.session":`会话内允许`,"approval.saved":`保存此工具和目标的许可`,"approval.deny":`拒绝`,"settings.title":`设置`,"settings.general":`通用`,"settings.models":`模型`,"settings.appearance":`外观`,"settings.about":`关于`,"settings.workspace":`工作区`,"settings.providers":`提供商`,"settings.providerModels":`{count} 个模型`,"settings.noProviders":`未配置提供商。`,"settings.tools":`工具`,"settings.access":`访问模式`,"settings.version":`版本`,"settings.authRequired":`鉴权`,"settings.authOn":`已启用`,"settings.authOff":`未启用`,"settings.providersHint":`提供商是必要项,模型是可选项。`,"settings.connectors":`连接器`,"settings.skills":`技能`,"settings.permissions":`权限`,"permissions.hint":`当前工作区保存的规则。移除允许规则后,需要审批的工具将在下次调用时重新询问。`,"permissions.empty":`没有保存的权限规则。`,"permissions.remove":`移除`,"permissions.confirm":`确认移除`,"permissions.cancel":`取消`,"permissions.removed":`权限规则已移除。`,"permissions.workspaceChanged":`工作区已切换,请重新加载规则后再移除。`,"connectors.hint":`Agent 可用的 MCP 服务器。`,"connectors.add":`添加连接器`,"connectors.name":`名称`,"connectors.config":`配置(JSON)`,"connectors.empty":`未配置连接器。`,"connectors.saved":`连接器已保存。`,"connectors.invalidJson":`配置必须是合法 JSON。`,"skills.hint":`安装在 ~/.ringko/skills 与 ~/.agents/skills 下的技能。`,"skills.empty":`未安装技能。`,"skills.create":`创建技能`,"skills.name":`名称`,"skills.description":`描述`,"skills.body":`说明(Markdown)`,"skills.created":`技能已创建。`,"skills.removed":`技能已移除。`,"settings.projects":`项目`,"projects.hint":`项目即 agent 操作的工作区。`,"projects.add":`添加项目`,"projects.addTitle":`添加项目`,"projects.browse":`浏览…`,"browser.title":`选择文件夹`,"browser.open":`打开`,"browser.cancel":`取消`,"browser.newFolder":`新建文件夹`,"browser.folderName":`文件夹名称`,"browser.editPath":`编辑路径`,"browser.home":`主目录`,"browser.loading":`加载中…`,"browser.empty":`没有子文件夹。`,"browser.showHidden":`显示隐藏`,"browser.up":`上一级`,"projects.browseFailed":`无法打开文件夹选择器,请手动输入路径。`,"projects.path":`路径`,"projects.name":`名称`,"projects.current":`当前`,"projects.use":`设为当前`,"projects.remove":`移除`,"projects.empty":`暂无项目。`,"projects.loading":`正在加载项目…`,"projects.loadFailed":`项目加载失败。`,"projects.added":`已添加项目。`,"projects.removed":`已移除项目。`,"projects.switched":`已切换项目。`,"settings.addProvider":`添加提供商`,"settings.fromPreset":`从预设添加`,"settings.visual":`编辑器`,"settings.json":`JSON`,"settings.providerName":`名称`,"settings.providerType":`类型`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.addModel":`添加模型`,"settings.modelId":`模型 ID`,"settings.modelName":`显示名称`,"settings.remove":`删除`,"settings.save":`保存`,"settings.saved":`已保存。`,"settings.invalidJson":`JSON 无效。`,"settings.reload":`重载`,"settings.reloadDone":`配置已重载。`,"login.title":`登录`,"login.description":`此 RingKo 服务端要求访问令牌(RINGKO_WEB_TOKEN)。`,"login.token":`访问令牌`,"login.submit":`登录`,"login.error":`令牌无效。`,"login.disabled":`未启用鉴权。`,"login.signOut":`退出登录`,"theme.toggle":`主题`,"theme.light":`浅色`,"theme.dark":`深色`,"theme.system":`跟随系统`,"language.toggle":`语言`,"trajectory.title":`轨迹`,"trajectory.task":`子任务`,"task.title":`子任务`,"task.read":`只读`,"task.write":`读写`,"task.running":`运行中`,"task.completed":`已完成`,"task.failed":`失败`,"task.cancelled":`已取消`,"task.unknown":`结果未知`,"task.detailsHint":`在轨迹页查看子任务的工具调用和事件记录。`,"trajectory.latest":`最新`,"trajectory.chat":`聊天`,"trajectory.description":`查看会话事件,每 3 秒更新;仅显示日志中已有的耗时信息。`,"trajectory.all":`全部`,"trajectory.user":`用户`,"trajectory.assistant":`助手`,"trajectory.model":`模型`,"trajectory.tool":`工具`,"trajectory.compaction":`压缩`,"trajectory.session":`会话`,"trajectory.search":`搜索已加载事件摘要`,"trajectory.timeline":`执行顺序概览 · 最近 {count} 条匹配事件`,"trajectory.timelineLabel":`从执行顺序概览选择事件`,"trajectory.older":`加载更早事件`,"trajectory.empty":`没有匹配的事件。`,"trajectory.loadFailed":`无法加载轨迹,请刷新重试。`,"trajectory.windowLimit":`当前视图最多显示 {count} 条事件,完整日志仍保存在磁盘中。`,"trajectory.type":`事件类型`,"trajectory.time":`记录时间`,"trajectory.data":`事件数据`,"trajectory.copy":`复制当前显示的事件数据`,"trajectory.copied":`已复制事件数据。`,"trajectory.copyFailed":`无法复制事件数据。`,"trajectory.truncated":`较大事件的数据已截断显示,完整事件仍保存在会话日志中。`,"settings.oauth":`OAuth2 凭据`,"settings.oauthHint":`OAuth2 提供商请在「OAuth2 凭据」中管理。`,"oauth.title":`OAuth2 凭据管理`,"oauth.intro":`为通过 OAuth2 登录(而非 API Key)鉴权的提供商管理凭据。`,"oauth.empty":`暂无 OAuth2 提供商。`,"oauth.add":`添加 OAuth2 提供商`,"oauth.addTitle":`添加 OAuth2 提供商`,"oauth.name":`提供商名称`,"oauth.type":`提供商类型`,"oauth.models":`模型(可选,逗号分隔)`,"oauth.signedIn":`已登录`,"oauth.signedOut":`未登录`,"oauth.account":`账户`,"oauth.signIn":`登录`,"oauth.signOut":`退出登录`,"oauth.signedInToast":`已登录。`,"oauth.signedOutToast":`已退出登录。`,"oauth.signInFailed":`登录失败。`,"oauth.signOutFailed":`退出登录失败。`,"oauth.deviceHint":`打开验证页面并输入此代码:`,"oauth.open":`打开验证页面`,"oauth.copyCode":`复制代码`,"oauth.copied":`已复制代码。`,"oauth.copyFailed":`无法复制代码。`,"oauth.waiting":`等待授权中…`,"oauth.cancel":`取消`,"oauth.added":`已添加提供商。`,"oauth.removed":`已移除提供商。`,"oauth.remove":`删除`,"oauth.loadFailed":`无法加载凭据。`,"oauth.unsupported":`该提供商类型不支持 OAuth2。`,"task.full":`完全访问`,"ask.title":`代理提问`,"ask.custom":`自定义回答`,"ask.submit":`提交回答`,"ask.cancel":`取消提问`,"job.title":`任务与事件订阅`,"job.background":`后台`,"job.foreground":`前台`,"job.detach":`转到后台`,"job.cancel":`取消任务`,"job.result":`查看结果`,"oauth.accountCount":`{count} 个账号`,"oauth.noAccounts":`暂无账号。`,"oauth.addAccount":`添加账号`,"oauth.removeAccount":`移除账号`,"oauth.setDefault":`设为默认`,"oauth.default":`默认`,"oauth.reauth":`需要重新登录`,"oauth.signedInAs":`已登录:{login}`,"oauth.quota":`订阅额度`,"oauth.quotaLoading":`正在查询额度…`,"oauth.quotaFailed":`额度不可用`,"oauth.window5h":`5小时`,"oauth.window7d":`7天`,"oauth.window30d":`30天`,"oauth.quotaResets":`{time}后重置`,"oauth.windowWeekly":`周`,"oauth.windowMonthly":`月`,"oauth.windowDaily":`日`,"connectors.project":`项目`,"connectors.global":`全局`,"connectors.test":`测试连接`,"connectors.testOk":`已连接 — {count} 个工具`,"connectors.command":`命令`,"connectors.args":`参数`,"connectors.env":`环境变量(JSON)`,"connectors.url":`地址`,"connectors.headers":`请求头(JSON)`,"connectors.connected":`已连接的服务器`,"connectors.noneConnected":`没有已连接的 MCP 服务器。`,"connectors.toolCount":`{count} 个工具`,"skills.project":`项目`,"skills.global":`全局`,"connectors.login":`OAuth 登录`,"connectors.authenticated":`已认证`,"connectors.loginFirst":`未认证,请先 OAuth 登录。`,"mode.title":`模式`,"mode.changed":`已切换模式。`,"code.copy":`复制代码`,"code.wrap":`自动换行`,"code.nowrap":`不换行`},Db=[{value:`en`,label:`English`},{value:`zh-CN`,label:`简体中文`}],Ob={en:Tb,"zh-CN":Eb},kb=`ringko.locale`,Ab=(0,y.createContext)(null);function jb(){let e=typeof localStorage>`u`?null:localStorage.getItem(kb);return e===`en`||e===`zh-CN`?e:(typeof navigator>`u`?`en`:navigator.language).toLowerCase().startsWith(`zh`)?`zh-CN`:`en`}function Mb({children:e}){let[t,n]=(0,y.useState)(jb);(0,y.useEffect)(()=>{document.documentElement.lang=t},[t]);let r=(0,y.useCallback)(e=>{n(e);try{localStorage.setItem(kb,e)}catch{}},[]),i=(0,y.useCallback)((e,n)=>{let r=Ob[t][e]??Ob.en[e]??e;if(n)for(let[e,t]of Object.entries(n))r=r.replaceAll(`{${e}}`,String(t));return r},[t]),a=(0,y.useMemo)(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return(0,H.jsx)(Ab.Provider,{value:a,children:e})}function Nb(){let e=(0,y.useContext)(Ab);if(!e)throw Error(`useI18n must be used within an I18nProvider`);return e}function Pb({open:e,onOpen:t,onClose:n}){let{t:r}=Nb(),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(null),v=(0,y.useCallback)(e=>{s(!0),l(null),Ey(e).then(e=>{a(e),p(e.path)}).catch(e=>{l(e instanceof Error?e.message:String(e))}).finally(()=>s(!1))},[]);(0,y.useEffect)(()=>{e&&(d(!1),h(!1),_(null),v())},[e,v]);async function b(){let e=(g??``).trim();if(i&&e.length!==0)try{let t=await Dy(i.path,e);_(null),v(t)}catch(e){B.error(e instanceof Error?e.message:String(e))}}let x=(i?.entries??[]).filter(e=>m||!e.hidden);return(0,H.jsx)(mb,{open:e,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(vb,{className:`flex h-[500px] w-[680px] max-w-[95vw] flex-col gap-0 p-0`,children:[(0,H.jsx)(yb,{className:`border-b px-4 py-3`,children:(0,H.jsx)(xb,{className:`text-sm`,children:r(`browser.title`)})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 border-b px-2 py-2`,children:[(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,title:r(`browser.up`),onClick:()=>{let e=i?.crumbs.at(-2)?.path;e&&v(e)},children:(0,H.jsx)(Ci,{className:`size-3.5`})}),u?(0,H.jsx)(Sb,{value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(d(!1),v(f)),e.key===`Escape`&&d(!1)},className:`h-7 flex-1 font-mono text-xs`,autoFocus:!0}):(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center overflow-x-auto whitespace-nowrap`,children:(i?.crumbs??[]).map((e,t)=>(0,H.jsxs)(`span`,{className:`flex items-center`,children:[(0,H.jsx)(si,{className:`size-3 shrink-0 text-muted-foreground`}),(0,H.jsx)(`button`,{type:`button`,className:W(`rounded px-1.5 py-0.5 text-xs hover:bg-accent`,t===(i?.crumbs.length??0)-1&&`font-medium text-foreground`),onClick:()=>v(e.path),children:t===0?r(`browser.home`):e.name})]},e.path))}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,title:r(`browser.editPath`),onClick:()=>{p(i?.path??``),d(e=>!e)},children:(0,H.jsx)(da,{className:`size-3.5`})})]}),(0,H.jsx)(Cb,{className:`flex-1`,children:(0,H.jsxs)(`div`,{className:`p-2`,children:[o?(0,H.jsx)(`p`,{className:`px-2 py-4 text-xs text-muted-foreground`,children:r(`browser.loading`)}):c?(0,H.jsx)(`p`,{className:`px-2 py-4 text-xs text-destructive`,children:c}):x.length===0?(0,H.jsx)(`p`,{className:`px-2 py-4 text-xs text-muted-foreground`,children:r(`browser.empty`)}):x.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:()=>v(e.path),children:[(0,H.jsx)(Li,{className:`size-4 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)),i?.truncated?(0,H.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`…`}):null]})}),g===null?null:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-t px-3 py-2`,children:[(0,H.jsx)(Sb,{value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b(),e.key===`Escape`&&_(null)},placeholder:r(`browser.folderName`),className:`h-8 flex-1 text-xs`,autoFocus:!0}),(0,H.jsx)(K,{size:`sm`,onClick:()=>void b(),children:r(`common.save`)})]}),(0,H.jsxs)(bb,{className:`flex-row items-center gap-2 border-t px-3 py-3 sm:justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(K,{variant:`outline`,size:`sm`,disabled:!i,onClick:()=>_(``),children:[(0,H.jsx)(Fi,{"data-icon":`inline-start`}),r(`browser.newFolder`)]}),(0,H.jsx)(K,{variant:`ghost`,size:`sm`,onClick:()=>h(e=>!e),children:r(`browser.showHidden`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(K,{variant:`outline`,size:`sm`,onClick:n,children:r(`browser.cancel`)}),(0,H.jsx)(K,{size:`sm`,disabled:!i,onClick:()=>{i&&t(i.path)},children:r(`browser.open`)})]})]})]})})}var Fb={queued:16,prompt:65536,partial:262144,cached:64},Ib=()=>({messages:[],busy:!1,approval:null,question:null,tasks:[],jobs:[],todos:[],queue:[],partial:null,draft:``,error:null,loop:null}),Lb=class{states=new Map;runs=new Map;listeners=new Set;paused=new Set;revisions=new Map;disposed=!1;transport;report;constructor(e,t){this.transport=e,this.report=t}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});peek(e){return this.states.get(e)}get(e){let t=this.states.get(e);if(!t){if(this.states.size>=Fb.cached){let e=[...this.states].find(([,e])=>!e.busy&&!e.queue.length&&!e.draft);if(!e)throw Error(`Conversation cache is full. Finish or clear a queued conversation.`);this.states.delete(e[0]),this.paused.delete(e[0]),this.revisions.delete(e[0])}t=Ib(),this.states.set(e,t)}return t}patch(e,t){this.states.set(e,{...this.get(e),...t});for(let e of[...this.listeners])e()}load(e,t,n){let r=this.get(e);r.busy||n&&r!==n||this.patch(e,t)}synchronize(e){if(this.disposed||this.runs.has(e.id))return;let t=this.revisions.get(e.id);if(t?.instance===e.instance&&t.revision>e.revision)return;let n=new Set(e.events.filter(e=>e.type===`tool/result`&&e.data?.failed).map(e=>e.data.toolCallId));this.patch(e.id,{messages:e.messages.map(e=>e.role===`tool`?{...e,failed:n.has(e.toolCallId)}:e),busy:e.busy,partial:e.partial,approval:e.approvals[0]??null,question:e.questions[0]??null,tasks:e.tasks,todos:e.todos,jobs:e.jobs,loop:e.loop,error:e.error}),this.revisions.set(e.id,{instance:e.instance,revision:e.revision}),!e.busy&&!e.error&&!this.paused.has(e.id)&&queueMicrotask(()=>this.resume(e.id))}send(e,t,n=[],r){if(this.disposed)throw Error(`Conversation manager is closed.`);if(t=t.trim(),!t||t.length>Fb.prompt||n.length>16)throw Error(`Invalid message size.`);let i=this.get(e);if(i.busy||i.queue.length){if(i.queue.length>=Fb.queued)throw Error(`Message queue is full.`);this.patch(e,{queue:[...i.queue,{id:crypto.randomUUID(),prompt:t,attachments:[...n]}]}),i.busy||this.resume(e)}else this.start(e,t,n,r)}editQueued(e,t,n){if(!n.trim()||n.length>Fb.prompt)throw Error(`Invalid queued message.`);this.patch(e,{queue:this.get(e).queue.map(e=>e.id===t?{...e,prompt:n.trim()}:e)})}removeQueued(e,t){this.patch(e,{queue:this.get(e).queue.filter(e=>e.id!==t)})}resume(e){if(this.disposed)return;this.paused.delete(e);let t=this.get(e);if(t.busy||!t.queue.length)return;let[n,...r]=t.queue;this.patch(e,{queue:r}),this.start(e,n.prompt,n.attachments)}stop(e){let t=this.get(e);this.paused.add(e);let n=this.runs.get(e);this.runs.delete(e),n?.abort(),this.patch(e,{busy:!1,partial:null,approval:null,question:null,tasks:t.tasks.map(e=>e.status===`running`?{...e,status:`unknown`}:e),jobs:t.jobs.map(e=>e.status===`running`?{...e,status:`unknown`}:e)})}dispose(){this.disposed=!0;for(let e of[...this.runs.keys()])this.stop(e);this.listeners.clear()}start(e,t,n,r){let i=Symbol(e);this.runs.set(e,{token:i,abort(){}}),this.patch(e,{busy:!0,error:null,loop:null,messages:[...this.get(e).messages,{role:`user`,content:t}]});let a=t=>{this.runs.get(e)?.token===i&&this.patch(e,t(this.get(e)))},o=t=>{if(this.runs.get(e)?.token!==i)return;this.runs.delete(e);let n=this.get(e);this.patch(e,{busy:!1,partial:null,approval:null,question:null,error:t??null,loop:null,...t?{tasks:n.tasks.map(e=>e.status===`running`?{...e,status:`unknown`}:e),jobs:n.jobs.map(e=>e.status===`running`?{...e,status:`unknown`}:e)}:{}}),this.report(t,e),t||queueMicrotask(()=>this.resume(e))};try{let s=this.transport({sessionId:e,prompt:t,attachments:n,...r?{loop:r}:{}},{onDelta:e=>a(t=>{let n=t.partial??{content:``,reasoning:``},r=e.kind===`reasoning`?`reasoning`:`content`;return{partial:{...n,[r]:(n[r]+e.text).slice(0,Fb.partial)}}}),onAssistant:e=>a(t=>({partial:null,messages:[...t.messages,{role:`assistant`,content:e.content,reasoning:e.reasoning??void 0,toolCalls:e.toolCalls}]})),onTool:e=>a(t=>({messages:[...t.messages,{role:`tool`,name:e.name,content:e.content,...e.toolCallId?{toolCallId:e.toolCallId}:{},failed:e.error}]})),onApproval:e=>a(()=>({approval:e})),onApprovalClosed:e=>a(t=>({approval:t.approval?.id===e?null:t.approval})),onAsk:e=>a(()=>({question:e})),onAskClosed:e=>a(t=>({question:t.question?.id===e?null:t.question})),onTodo:e=>a(()=>({todos:e})),onLoop:e=>a(()=>({loop:e})),onTask:e=>a(t=>{let n=t.tasks.find(t=>t.taskId===e.taskId)??{taskId:e.taskId,parentCallId:e.parentCallId,description:e.description,mode:e.mode,model:e.model,status:`running`,startedAt:e.time,completedAt:null};return{tasks:[...t.tasks.filter(t=>t.taskId!==e.taskId),{...n,...e.type!==`started`&&e.type!==`event`?{status:e.type,completedAt:e.time}:{},...e.result?{content:e.result.content}:{},...e.reason?{reason:e.reason}:{},...e.event?{activity:`${e.event.toolName??e.event.type} · ${e.event.turn}`}:{}}]}}),onJob:e=>a(t=>{let n=e.data&&typeof e.data==`object`?e.data:{},r=t.jobs.find(t=>t.jobId===e.jobId);if(r&&e.seq<=r.lastSeq)return{};let i=r??{jobId:e.jobId,kind:e.kind,description:n.description??e.kind,status:`running`,background:n.background===!0,lastSeq:-1},a=[`completed`,`failed`,`cancelled`].includes(e.type)?e.type:i.status,o=e.type===`stdout`||e.type===`stderr`?`${i.output??``}${n.content??`[truncated event]`}`.slice(-32768):i.output;return{jobs:[...t.jobs.filter(t=>t.jobId!==e.jobId),{...i,status:a,output:o,background:e.type===`background`||i.background,lastSeq:e.seq,result:n.result??i.result}]}}),onSessionMeta:()=>this.report(void 0,e),onDone:()=>o(),onError:o,onUnauthorized:()=>o(`Unauthorized`)});this.runs.get(e)?.token===i&&this.runs.set(e,{token:i,...s})}catch(e){o(e instanceof Error?e.message:`Request failed.`)}}},Rb=(0,y.createContext)(null),zb=Ib(),Bb=e=>B.error(e instanceof Error?e.message:String(e));function Vb({children:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)([]),[s,c]=(0,y.useState)(),[l,u]=(0,y.useState)(``),d=(0,y.useRef)(``),f=(0,y.useRef)(void 0),p=(0,y.useRef)(0),[m,h]=(0,y.useState)(0),g=(0,y.useCallback)(()=>{sy().then(o).catch(e=>{e instanceof Zv&&i(!0)})},[]),_=(0,y.useCallback)(()=>{ny().then(e=>{n(e),i(!1)}).catch(Bb)},[]),[v]=(0,y.useState)(()=>new Lb(Zy,(e,t)=>{e===`Unauthorized`?i(!0):e&&B.error(e),g(),t&&cy(t).then(e=>v.synchronize(e)).catch(Bb)}));(0,y.useEffect)(()=>v.subscribe(()=>h(e=>e+1)),[v]);let b=(0,y.useRef)(void 0);(0,y.useEffect)(()=>(clearTimeout(b.current),()=>{b.current=setTimeout(()=>v.dispose(),0)}),[v]),(0,y.useEffect)(()=>{_()},[_]),(0,y.useEffect)(()=>{t&&g()},[t,g]),(0,y.useEffect)(()=>{let e,t=qv.watch(t=>{t.kind!==`activity`&&(e||=setTimeout(()=>{e=void 0,g(),t.kind!==`session`&&_()},150))},e=>{e instanceof jv&&e.status===401&&i(!0)});return()=>{clearTimeout(e),t.close()}},[g,_,r]),(0,y.useEffect)(()=>{if(!s)return;let e=qv.watchSession(s,e=>v.synchronize(e),e=>{e instanceof jv&&e.status===401?i(!0):e instanceof jv&&e.status===404&&(v.patch(s,{busy:!1,error:`Session was deleted in another client.`}),g())});return()=>e.close()},[s,v,g,r]);let x=(0,y.useCallback)(e=>{f.current=e,c(e),p.current++},[]),S=(0,y.useCallback)(e=>{let t;try{t=v.get(e)}catch(e){Bb(e);return}x(e),!t.busy&&cy(e).then(n=>{v.get(e)===t&&v.synchronize(n)}).catch(Bb)},[v,x]),C=(0,y.useRef)(null),w=(0,y.useCallback)(()=>{if(f.current)return Promise.resolve(f.current);if(!C.current){let e=p.current;C.current=uy().then(t=>(v.get(t.id),p.current===e&&(v.patch(t.id,{draft:d.current}),d.current=``,u(``),x(t.id)),g(),t.id)).finally(()=>{C.current=null})}return C.current},[v,x,g]),T=(0,y.useCallback)((e,t,n)=>{w().then(r=>v.send(r,e,t,n)).catch(Bb)},[v,w]),E=(0,y.useCallback)(()=>{d.current=``,u(``),x();let e=p.current;uy().then(t=>{v.get(t.id),p.current===e&&x(t.id),g()}).catch(Bb)},[x,v,g]),D=(0,y.useCallback)(()=>{let e=f.current;e&&(v.stop(e),Gv(e).catch(Bb))},[v]),O=(0,y.useCallback)(e=>{let t=f.current,n=t?v.get(t).question:null;n&&Jv(n.id,e).catch(Bb)},[v]),k=(0,y.useCallback)((e,t)=>{let n=f.current,r=n?v.get(n).approval:null;n&&r&&hy(r.id,e,t).then(()=>{v.get(n).approval?.id===r.id&&v.patch(n,{approval:null})}).catch(Bb)},[v]),A=(0,y.useCallback)((e,t)=>{let n=f.current;n&&Yv(n,e,t).then(t=>v.patch(n,{jobs:v.get(n).jobs.map(n=>n.jobId===e?{...n,...t}:n)})).catch(Bb)},[v]),j=(0,y.useMemo)(()=>s?v.get(s):{...zb,draft:l},[s,v,m,l]),M=(0,y.useMemo)(()=>({...j,info:t,unauthorized:r,sessions:a,sessionId:s,refreshInfo:_,refreshSessions:g,openSession:S,newChat:E,send:T,stop:D,answer:O,decide:k,controlJob:A,clearSession:()=>x(),setDraft:e=>{f.current?v.patch(f.current,{draft:e}):(d.current=e,u(e))},editQueued:(e,t)=>{if(f.current)try{v.editQueued(f.current,e,t)}catch(e){Bb(e)}},removeQueued:e=>{f.current&&v.removeQueued(f.current,e)},resumeQueue:()=>{f.current&&v.resume(f.current)},runningSessions:a.filter(e=>e.busy||v.peek(e.id)?.busy).map(e=>e.id)}),[j,t,r,a,s,_,g,S,E,T,D,O,k,A,x,v]);return(0,H.jsx)(Rb.Provider,{value:M,children:e})}function Hb(){let e=(0,y.useContext)(Rb);if(!e)throw Error(`useApp must be used within an AppProvider`);return e}var Ub=2,Wb=1,Gb=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Ub,Math.floor(u/e.css.cell.width)),rows:Math.max(Wb,Math.floor(l/e.css.cell.height))}}},Kb=Object.defineProperty,qb=Object.getOwnPropertyDescriptor,Jb=(e,t)=>{for(var n in t)Kb(e,n,{get:t[n],enumerable:!0})},Yb=(e,t,n,r)=>{for(var i=r>1?void 0:r?qb(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Kb(t,n,i),i},q=(e,t)=>(n,r)=>t(n,r,e),Xb=`Terminal input`,Zb={get:()=>Xb,set:e=>Xb=e},Qb=`Too much output to announce, navigate to rows manually to read`,$b={get:()=>Qb,set:e=>Qb=e};function ex(e){return e.replace(/\r?\n/g,`\r`)}function tx(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function nx(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function rx(e,t,n,r){e.stopPropagation(),e.clipboardData&&ix(e.clipboardData.getData(`text/plain`),t,n,r)}function ix(e,t,n,r){e=ex(e),e=tx(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ax(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ox(e,t,n,r,i){ax(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function sx(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function cx(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var lx=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ux=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},dx=``,fx=` `,px=class e{constructor(){this.fg=0,this.bg=0,this.extended=new mx}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},mx=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},hx=class e extends px{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new mx,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?sx(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},gx=`di$target`,_x=`di$dependencies`,vx=new Map;function yx(e){return e[_x]||[]}function bx(e){if(vx.has(e))return vx.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);xx(t,e,r)};return t._id=e,vx.set(e,t),t}function xx(e,t,n){t[gx]===t?t[_x].push({id:e,index:n}):(t[_x]=[{id:e,index:n}],t[gx]=t)}var Sx=bx(`BufferService`),Cx=bx(`CoreMouseService`),wx=bx(`CoreService`),Tx=bx(`CharsetService`),Ex=bx(`InstantiationService`),Dx=bx(`LogService`),Ox=bx(`OptionsService`),kx=bx(`OscLinkService`),Ax=bx(`UnicodeService`),jx=bx(`DecorationService`),Mx=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new hx,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Nx(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Mx=Yb([q(0,Sx),q(1,Ox),q(2,kx)],Mx);function Nx(e,t){if(confirm(`Do you want to navigate to ${t}?
56
+
57
+ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Px=bx(`CharSizeService`),Fx=bx(`CoreBrowserService`),Ix=bx(`MouseService`),Lx=bx(`RenderService`),Rx=bx(`SelectionService`),zx=bx(`CharacterJoinerService`),Bx=bx(`ThemeService`),Vx=bx(`LinkProviderService`),Hx=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Jx.isErrorNoTelemetry(e)?new Jx(e.message+`
58
+
59
+ `+e.stack):Error(e.message+`
60
+
61
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Ux(e){Gx(e)||Hx.onUnexpectedError(e)}var Wx=`Canceled`;function Gx(e){return e instanceof Kx||e instanceof Error&&e.name===Wx&&e.message===Wx}var Kx=class extends Error{constructor(){super(Wx),this.name=this.message}};function qx(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var Jx=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Yx=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function Xx(e,t=0){return e[e.length-(1+t)]}var Zx;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Zx||={});var Qx=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Zx.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};Qx.empty=new Qx(e=>{});function $x(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var eS;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(eS||={});var tS=null;function nS(e){return tS?.trackDisposable(e),e}function rS(e){tS?.markAsDisposed(e)}function iS(e,t){tS?.setParent(e,t)}function aS(e){return tS?.markAsSingleton(e),e}function oS(e){if(eS.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function sS(...e){return cS(()=>oS(e))}function cS(e){let t=nS({dispose:$x(()=>{rS(t),e()})});return t}var lS=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,nS(this)}dispose(){this._isDisposed||(rS(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oS(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return iS(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),iS(e,null))}};lS.DISABLE_DISPOSED_WARNING=!1;var uS=lS,dS=class{constructor(){this._store=new uS,nS(this),iS(this._store,this)}dispose(){rS(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};dS.None=Object.freeze({dispose(){}});var fS=class{constructor(){this._isDisposed=!1,nS(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&iS(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,rS(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&iS(e,null),e}},pS=typeof window==`object`?window:globalThis,mS=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};mS.Undefined=new mS(void 0);var hS=mS,gS=class{constructor(){this._first=hS.Undefined,this._last=hS.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===hS.Undefined}clear(){let e=this._first;for(;e!==hS.Undefined;){let t=e.next;e.prev=hS.Undefined,e.next=hS.Undefined,e=t}this._first=hS.Undefined,this._last=hS.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new hS(e);if(this._first===hS.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==hS.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==hS.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==hS.Undefined&&e.next!==hS.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===hS.Undefined&&e.next===hS.Undefined?(this._first=hS.Undefined,this._last=hS.Undefined):e.next===hS.Undefined?(this._last=this._last.prev,this._last.next=hS.Undefined):e.prev===hS.Undefined&&(this._first=this._first.next,this._first.prev=hS.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==hS.Undefined;)yield e.element,e=e.next}},_S=globalThis.performance&&typeof globalThis.performance.now==`function`,vS=class e{static create(t){return new e(t)}constructor(e){this._now=_S&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},yS;(e=>{e.None=()=>dS.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(sS(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new J({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new J({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new J({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new J({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new J({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new J;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function w(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=w;class T{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new J(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(e,t){return new T(e,t).emitter.event}e.fromObservable=E;function D(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof uS?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=D})(yS||={});var bS=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new vS,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};bS.all=new Set,bS._idPool=0;var xS=bS,SS=-1,CS=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new ES(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};CS._idPool=1;var wS=CS,TS=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
62
+ `).slice(2).join(`
63
+ `))}},ES=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},DS=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},OS=0,kS=class{constructor(e){this.value=e,this.id=OS++}},AS=2,J=class{constructor(e){this._size=0,this._options=e,this._leakageMon=SS>0||this._options?.leakWarningThreshold?new wS(e?.onListenerError??Ux,this._options?.leakWarningThreshold??SS):void 0,this._perfMon=this._options?._profName?new xS(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new DS(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Ux)(n),dS.None}if(this._disposed)return dS.None;t&&(e=e.bind(t));let r=new kS(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=TS.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof kS?(this._deliveryQueue??=new jS,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=cS(()=>{i?.(),this._removeListener(r)});return n instanceof uS?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*AS<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||Ux;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof kS)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},jS=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},MS=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new J,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new J,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};MS.INSTANCE=new MS;var NS=MS;function PS(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}NS.INSTANCE.onDidChangeZoomLevel;function FS(e){return NS.INSTANCE.getZoomFactor(e)}NS.INSTANCE.onDidChangeFullscreen;var IS=typeof navigator==`object`?navigator.userAgent:``,LS=IS.indexOf(`Firefox`)>=0,RS=IS.indexOf(`AppleWebKit`)>=0,zS=IS.indexOf(`Chrome`)>=0,BS=!zS&&IS.indexOf(`Safari`)>=0;IS.indexOf(`Electron/`),IS.indexOf(`Android`);var VS=!1;if(typeof pS.matchMedia==`function`){let e=pS.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=pS.matchMedia(`(display-mode: fullscreen)`);VS=e.matches,PS(pS,e,({matches:e})=>{VS&&t.matches||(VS=e)})}function HS(){return VS}var US=`en`,WS=!1,GS=!1,KS=!1,qS=!1,JS=!1,YS=US,XS,ZS=globalThis,QS;typeof ZS.vscode<`u`&&typeof ZS.vscode.process<`u`?QS=ZS.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(QS=process);var $S=typeof QS?.versions?.electron==`string`&&QS?.type===`renderer`;if(typeof QS==`object`){WS=QS.platform===`win32`,GS=QS.platform===`darwin`,KS=QS.platform===`linux`,KS&&QS.env.SNAP&&QS.env.SNAP_REVISION,QS.env.CI||QS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,YS=US;let e=QS.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,YS=t.resolvedLanguage||US,t.languagePack?.translationsConfigFile}catch{}qS=!0}else typeof navigator==`object`&&!$S?(XS=navigator.userAgent,WS=XS.indexOf(`Windows`)>=0,GS=XS.indexOf(`Macintosh`)>=0,(XS.indexOf(`Macintosh`)>=0||XS.indexOf(`iPad`)>=0||XS.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,KS=XS.indexOf(`Linux`)>=0,XS?.indexOf(`Mobi`),JS=!0,YS=globalThis._VSCODE_NLS_LANGUAGE||US,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var eC=WS,tC=GS,nC=KS,rC=qS;JS&&typeof ZS.importScripts==`function`&&ZS.origin;var iC=XS,aC=YS,oC;(e=>{function t(){return aC}e.value=t;function n(){return aC.length===2?aC===`en`:aC.length>=3&&aC[0]===`e`&&aC[1]===`n`&&aC[2]===`-`}e.isDefaultVariant=n;function r(){return aC===`en`}e.isDefault=r})(oC||={});var sC=typeof ZS.postMessage==`function`&&!ZS.importScripts;(()=>{if(sC){let e=[];ZS.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),ZS.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var cC=!!(iC&&iC.indexOf(`Chrome`)>=0);iC&&iC.indexOf(`Firefox`),!cC&&iC&&iC.indexOf(`Safari`),iC&&iC.indexOf(`Edg/`),iC&&iC.indexOf(`Android`);var lC=typeof navigator==`object`?navigator:{};rC||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||lC&&lC.clipboard&&lC.clipboard.writeText,rC||lC&&lC.clipboard&&lC.clipboard.readText,rC||HS()||lC.keyboard,`ontouchstart`in pS||lC.maxTouchPoints,pS.PointerEvent&&(`ontouchstart`in pS||navigator.maxTouchPoints);var uC=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},dC=new uC,fC=new uC,pC=new uC,mC=Array(230),hC;(e=>{function t(e){return dC.keyCodeToStr(e)}e.toString=t;function n(e){return dC.strToKeyCode(e)}e.fromString=n;function r(e){return fC.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return pC.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return fC.strToKeyCode(e)||pC.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return dC.keyCodeToStr(e)}e.toElectronAccelerator=o})(hC||={});var gC=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new _C([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},_C=class{constructor(e){if(e.length===0)throw qx(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function vC(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return hC.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(LS)switch(t){case 59:return 85;case 60:if(nC)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(tC)return 57}else if(RS&&(tC&&t===93||!tC&&t===92))return 57;return mC[t]||0}var yC=tC?256:2048,bC=512,xC=1024,SC=tC?2048:256,CC=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=vC(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=yC),this.altKey&&(t|=bC),this.shiftKey&&(t|=xC),this.metaKey&&(t|=SC),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new gC(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},wC=new WeakMap;function TC(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var EC=class{static getSameOriginWindowChain(e){let t=wC.get(e);if(!t){t=[],wC.set(e,t);let n=e,r;do r=TC(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},DC=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=EC.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},OC=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(zS){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?LS&&!tC?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=BS&&eC?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?LS&&!tC?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},kC=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),AC;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof jC?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:yS.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:kC})})(AC||={});var jC=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?kC:(this._emitter||=new J,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},MC=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Yx(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Yx(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},NC=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Yx(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=cS(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var PC;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(PC||={});var FC=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new J,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await yS.toPromise(this._onStateChanged.event)}while(1)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};FC.EMPTY=FC.fromArray([]);function IC(e){return LC(e,0)}function LC(e,t){switch(typeof e){case`object`:return e===null?RC(349,t):Array.isArray(e)?VC(e,t):HC(e,t);case`string`:return BC(e,t);case`boolean`:return zC(e,t);case`number`:return RC(e,t);case`undefined`:return RC(937,t);default:return RC(617,t)}}function RC(e,t){return(t<<5)-t+e|0}function zC(e,t){return RC(e?433:863,t)}function BC(e,t){t=RC(149417,t);for(let n=0,r=e.length;n<r;n++)t=RC(e.charCodeAt(n),t);return t}function VC(e,t){return t=RC(104579,t),e.reduce((e,t)=>LC(t,e),t)}function HC(e,t){return t=RC(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=BC(n,t),LC(e[n],t)),t)}var{registerWindow:UC,getWindow:WC,getDocument:GC,getWindows:KC,getWindowsCount:qC,getWindowId:JC,getWindowById:YC,hasWindow:XC,onDidRegisterWindow:ZC,onWillUnregisterWindow:QC,onDidUnregisterWindow:$C}=function(){let e=new Map,t={window:pS,disposables:new uS};e.set(pS.vscodeWindowId,t);let n=new J,r=new J,i=new J;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return dS.None;let a=new uS,o={window:t,disposables:a.add(new uS)};return e.set(t.vscodeWindowId,o),a.add(cS(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(Y(t,lw.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:pS},getDocument(e){return WC(e).document}}}(),ew=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function Y(e,t,n,r){return new ew(e,t,n,r)}function tw(e,t){return function(n){return t(new DC(e,n))}}function nw(e){return function(t){return e(new CC(t))}}var rw=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=tw(WC(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=nw(n)),Y(e,t,i,r)},iw,aw=class extends NC{constructor(e){super(),this.defaultTarget=e&&WC(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},ow=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ux(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(ow.sort),a.shift().execute();r.set(i,!1)};iw=(t,r,a=0)=>{let o=JC(t),s=new ow(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var sw=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};sw.None=new sw(0,0);function cw(e){let t=e.getBoundingClientRect(),n=WC(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=IC(n),a=r.get(i);if(a)a.users+=1;else{let o=new J,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(cS(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var lw={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:RS?`webkitAnimationStart`:`animationstart`,ANIMATION_END:RS?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:RS?`webkitAnimationIteration`:`animationiteration`},uw=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=dw(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=dw(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=dw(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=dw(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=dw(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=dw(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=dw(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=dw(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=dw(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=dw(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=dw(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=dw(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=dw(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=dw(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function dw(e){return typeof e==`number`?`${e}px`:e}function fw(e){return new uw(e)}var pw=class{constructor(){this._hooks=new uS,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(cS(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=WC(e)}this._hooks.add(Y(a,lw.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(Y(a,lw.POINTER_UP,e=>this.stopMonitoring(!0)))}};function mw(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var hw;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(hw||={});var gw=class e extends dS{constructor(){super(),this.dispatched=!1,this.targets=new gS,this.ignoreTargets=new gS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(yS.runAndSubscribe(ZC,({window:e,disposables:t})=>{t.add(Y(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(Y(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(Y(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:pS,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=aS(new e),cS(e.INSTANCE.targets.push(t))):dS.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=aS(new e),cS(e.INSTANCE.ignoreTargets.push(t))):dS.None}static isTouchDevice(){return`ontouchstart`in pS||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(hw.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-Xx(s.rollingPageX))<30&&Math.abs(s.initialPageY-Xx(s.rollingPageY))<30){let e=this.newGestureEvent(hw.Tap,s.initialTarget);e.pageX=Xx(s.rollingPageX),e.pageY=Xx(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-Xx(s.rollingPageX))<30&&Math.abs(s.initialPageY-Xx(s.rollingPageY))<30){let e=this.newGestureEvent(hw.Contextmenu,s.initialTarget);e.pageX=Xx(s.rollingPageX),e.pageY=Xx(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=Xx(s.rollingPageX),n=Xx(s.rollingPageY),i=Xx(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(hw.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===hw.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===hw.Change||t.type===hw.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=iw(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(hw.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(hw.Change,i.initialTarget);a.translationX=r.pageX-Xx(i.rollingPageX),a.translationY=r.pageY-Xx(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};gw.SCROLL_FRICTION=-.005,gw.HOLD_DELAY=700,gw.CLEAR_TAP_COUNT_TIME=400,Yb([mw],gw,`isTouchDevice`,1);var _w=gw,vw=class extends dS{onclick(e,t){this._register(Y(e,lw.CLICK,n=>t(new DC(WC(e),n))))}onmousedown(e,t){this._register(Y(e,lw.MOUSE_DOWN,n=>t(new DC(WC(e),n))))}onmouseover(e,t){this._register(Y(e,lw.MOUSE_OVER,n=>t(new DC(WC(e),n))))}onmouseleave(e,t){this._register(Y(e,lw.MOUSE_LEAVE,n=>t(new DC(WC(e),n))))}onkeydown(e,t){this._register(Y(e,lw.KEY_DOWN,e=>t(new CC(e))))}onkeyup(e,t){this._register(Y(e,lw.KEY_UP,e=>t(new CC(e))))}oninput(e,t){this._register(Y(e,lw.INPUT,t))}onblur(e,t){this._register(Y(e,lw.BLUR,t))}onfocus(e,t){this._register(Y(e,lw.FOCUS,t))}onchange(e,t){this._register(Y(e,lw.CHANGE,t))}ignoreGesture(e){return _w.ignoreTarget(e)}},yw=11,bw=class extends vw{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=yw+`px`,this.domNode.style.height=yw+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new pw),this._register(rw(this.bgDomNode,lw.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(rw(this.domNode,lw.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new aw),this._pointerdownScheduleRepeatTimer=this._register(new MC)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,WC(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},xw=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},Sw=class extends dS{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new xw(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new Ew(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=Ew.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},Cw=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function ww(e,t){let n=t-e;return function(t){return e+n*Ow(t)}}function Tw(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Ew=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),Tw(ww(e,r),ww(i,t),.33)}return ww(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new Cw(this.scrollLeft(t),this.scrollTop(t),!1):new Cw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function Dw(e){return e**3}function Ow(e){return 1-Dw(1-e)}var kw=class extends dS{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new MC)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},Aw=140,jw=class extends vw{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new kw(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new pw),this._shouldRender=!0,this.domNode=fw(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(Y(this.domNode.domNode,lw.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new bw(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=fw(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Y(this.slider.domNode,lw.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=cw(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(eC&&a>Aw){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Mw=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},Nw=class extends jw{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Mw(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Pw=class extends jw{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Mw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},Fw=500,Iw=50,Lw=!0,Rw=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},zw=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(1);return t<=.5}acceptStandardWheelEvent(e){if(zS){let t=FS(WC(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new Rw(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};zw.INSTANCE=new zw;var Bw=zw,Vw=class extends vw{constructor(e,t,n){super(),this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new J),this.onWillScroll=this._onWillScroll.event,this._options=Uw(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Pw(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Nw(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fw(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fw(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fw(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new MC),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=oS(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,tC&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new OC(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=oS(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(Y(this._listenOnDomNode,lw.MOUSE_WHEEL,e=>{this._onMouseWheel(new OC(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Bw.INSTANCE;Lw&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!tC&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=Iw*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=Iw*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(Lw&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Fw)}},Hw=class extends Vw{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Uw(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,tC&&(t.className+=` mac`),t}var Ww=class extends dS{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new J),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new Sw({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>iw(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Hw(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(yS.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(cS(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(cS(()=>this._styleElement.remove())),this._register(yS.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
64
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Ww=Yb([q(2,Sx),q(3,Fx),q(4,Cx),q(5,Bx),q(6,Ox),q(7,Lx)],Ww);var Gw=class extends dS{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(cS(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Gw=Yb([q(1,Sx),q(2,Fx),q(3,jx),q(4,Lx)],Gw);var Kw=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},qw={full:0,left:0,center:0,right:0},Jw={full:0,left:0,center:0,right:0},Yw={full:0,left:0,center:0,right:0},Xw=class extends dS{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new Kw,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(cS(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Jw.full=this._canvas.width,Jw.left=e,Jw.center=t,Jw.right=e,this._refreshDrawHeightConstants(),Yw.full=1,Yw.left=1,Yw.center=1+Jw.left,Yw.right=1+Jw.left+Jw.center}_refreshDrawHeightConstants(){qw.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);qw.left=t,qw.center=t,qw.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*qw.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*qw.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*qw.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*qw.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Yw[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-qw[e.position||`full`]/2),Jw[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+qw[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Xw=Yb([q(2,Sx),q(3,jx),q(4,Lx),q(5,Ox),q(6,Bx),q(7,Fx)],Xw);var X;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
65
+ `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(X||={});var Zw;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(Zw||={});var Qw;(e=>e.ST=`${X.ESC}\\`)(Qw||={});var $w=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${X.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};$w=Yb([q(2,Sx),q(3,Ox),q(4,wx),q(5,Lx)],$w);var eT=0,tT=0,nT=0,rT=0,iT={css:`#00000000`,rgba:0},aT;(e=>{function t(e,t,n,r){return r===void 0?`#${uT(e)}${uT(t)}${uT(n)}`:`#${uT(e)}${uT(t)}${uT(n)}${uT(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(aT||={});var oT;(e=>{function t(e,t){if(rT=(t.rgba&255)/255,rT===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return eT=a+Math.round((n-a)*rT),tT=o+Math.round((r-o)*rT),nT=s+Math.round((i-s)*rT),{css:aT.toCss(eT,tT,nT),rgba:aT.toRgba(eT,tT,nT)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=lT.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return aT.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[eT,tT,nT]=lT.toChannels(t),{css:aT.toCss(eT,tT,nT),rgba:t}}e.opaque=i;function a(e,t){return rT=Math.round(t*255),[eT,tT,nT]=lT.toChannels(e.rgba),{css:aT.toCss(eT,tT,nT,rT),rgba:aT.toRgba(eT,tT,nT,rT)}}e.opacity=a;function o(e,t){return rT=e.rgba&255,a(e,rT*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(oT||={});var sT;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return eT=parseInt(e.slice(1,2).repeat(2),16),tT=parseInt(e.slice(2,3).repeat(2),16),nT=parseInt(e.slice(3,4).repeat(2),16),aT.toColor(eT,tT,nT);case 5:return eT=parseInt(e.slice(1,2).repeat(2),16),tT=parseInt(e.slice(2,3).repeat(2),16),nT=parseInt(e.slice(3,4).repeat(2),16),rT=parseInt(e.slice(4,5).repeat(2),16),aT.toColor(eT,tT,nT,rT);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return eT=parseInt(r[1]),tT=parseInt(r[2]),nT=parseInt(r[3]),rT=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),aT.toColor(eT,tT,nT,rT);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[eT,tT,nT,rT]=t.getImageData(0,0,1,1).data,rT!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:aT.toRgba(eT,tT,nT,rT),css:e}}e.toColor=r})(sT||={});var cT;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(cT||={});var lT;(e=>{function t(e,t){if(rT=(t&255)/255,rT===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return eT=a+Math.round((n-a)*rT),tT=o+Math.round((r-o)*rT),nT=s+Math.round((i-s)*rT),aT.toRgba(eT,tT,nT)}e.blend=t;function n(e,t,n){let a=cT.relativeLuminance(e>>8),o=cT.relativeLuminance(t>>8);if(dT(a,o)<n){if(o<a){let o=r(e,t,n),s=dT(a,cT.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>dT(a,cT.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=dT(a,cT.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>dT(a,cT.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=dT(cT.relativeLuminance2(o,s,c),cT.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=dT(cT.relativeLuminance2(o,s,c),cT.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=dT(cT.relativeLuminance2(o,s,c),cT.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=dT(cT.relativeLuminance2(o,s,c),cT.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(lT||={});function uT(e){let t=e.toString(16);return t.length<2?`0`+t:t}function dT(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var fT=class extends px{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},pT=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new hx}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||fx.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)pT._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||fx.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};pT=Yb([q(0,Sx)],pT);function mT(e){return 57508<=e&&e<=57558}function hT(e){return 9472<=e&&e<=9631}function gT(e){return mT(e)||hT(e)}function _T(){return{css:{canvas:vT(),cell:vT()},device:{canvas:vT(),cell:vT(),char:{width:0,height:0,left:0,top:0}}}}function vT(){return{width:0,height:0}}var yT=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new hx,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,E=0,D=[],O=l!==-1&&u!==-1;for(let k=0;k<m;k++){e.loadCell(k,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let A=!1,j=k>=E,M=k,N=this._workCell;if(f.length>0&&k===f[0][0]&&j){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)j&&=i===this._isCellInSelection(v,t);j&&=!n||a<r[0]||a>=r[1],j?(A=!0,N=new fT(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),M=r[1]-1,m=N.getWidth()):E=r[1]}let P=this._isCellInSelection(k,t),F=n&&k===a,I=O&&k>=l&&k<=u,ee=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{ee=!0});let L=N.getChars()||fx;if(L===` `&&(N.isUnderline()||N.isOverline())&&(L=`\xA0`),T=m*s-c.get(L,N.isBold(),N.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(P&&w||!P&&!w&&N.bg===y)&&(P&&w&&p.selectionForeground||N.fg===b)&&N.extended.ext===x&&I===S&&T===C&&!F&&!A&&!ee&&j){N.isInvisible()?_+=fx:_+=L,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=N.bg,b=N.fg,x=N.extended.ext,S=I,C=T,w=P,A&&a>=k&&a<=M&&(a=k),!this._coreService.isCursorHidden&&F&&this._coreService.isCursorInitialized){if(D.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&D.push(`xterm-cursor-blink`),D.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:D.push(`xterm-cursor-outline`);break;case`block`:D.push(`xterm-cursor-block`);break;case`bar`:D.push(`xterm-cursor-bar`);break;case`underline`:D.push(`xterm-cursor-underline`)}}if(N.isBold()&&D.push(`xterm-bold`),N.isItalic()&&D.push(`xterm-italic`),N.isDim()&&D.push(`xterm-dim`),_=N.isInvisible()?fx:N.getChars()||fx,N.isUnderline()&&(D.push(`xterm-underline-${N.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!N.isUnderlineColorDefault())){if(N.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${px.toColorRGB(N.getUnderlineColor()).join(`,`)})`;else{let e=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}N.isOverline()&&(D.push(`xterm-overline`),_===` `&&(_=`\xA0`)),N.isStrikethrough()&&D.push(`xterm-strikethrough`),I&&(h.style.textDecoration=`underline`);let te=N.getFgColor(),ne=N.getFgColorMode(),re=N.getBgColor(),ie=N.getBgColorMode(),ae=!!N.isInverse();if(ae){let e=te;te=re,re=e;let t=ne;ne=ie,ie=t}let oe,se,ce=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{e.options.layer!==`top`&&ce||(e.backgroundColorRGB&&(ie=50331648,re=e.backgroundColorRGB.rgba>>8&16777215,oe=e.backgroundColorRGB),e.foregroundColorRGB&&(ne=50331648,te=e.foregroundColorRGB.rgba>>8&16777215,se=e.foregroundColorRGB),ce=e.options.layer===`top`)}),!ce&&P&&(oe=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,re=oe.rgba>>8&16777215,ie=50331648,ce=!0,p.selectionForeground&&(ne=50331648,te=p.selectionForeground.rgba>>8&16777215,se=p.selectionForeground)),ce&&D.push(`xterm-decoration-top`);let le;switch(ie){case 16777216:case 33554432:le=p.ansi[re],D.push(`xterm-bg-${re}`);break;case 50331648:le=aT.toColor(re>>16,re>>8&255,re&255),this._addStyle(h,`background-color:#${bT((re>>>0).toString(16),`0`,6)}`);break;default:ae?(le=p.foreground,D.push(`xterm-bg-257`)):le=p.background}switch(oe||N.isDim()&&(oe=oT.multiplyOpacity(le,.5)),ne){case 16777216:case 33554432:N.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(h,le,p.ansi[te],N,oe,void 0)||D.push(`xterm-fg-${te}`);break;case 50331648:let e=aT.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(h,le,e,N,oe,se)||this._addStyle(h,`color:#${bT(te.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,le,p.foreground,N,oe,se)||ae&&D.push(`xterm-fg-257`)}D.length&&=(h.className=D.join(` `),0),!F&&!A&&!ee&&j?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),k=M}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||gT(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=oT.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};yT=Yb([q(1,zx),q(2,Ox),q(3,Fx),q(4,wx),q(5,jx),q(6,Bx)],yT);function bT(e,t,n){for(;e.length<n;)e=t+e;return e}var xT=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},ST=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function CT(){return new ST}var wT=`xterm-dom-renderer-owner-`,TT=`xterm-rows`,ET=`xterm-fg-`,DT=`xterm-bg-`,OT=`xterm-focus`,kT=`xterm-selection`,AT=1,jT=class extends dS{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=AT++,this._rowElements=[],this._selectionRenderModel=CT(),this.onRequestRedraw=this._register(new J).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(TT),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(kT),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=_T(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(yT,document),this._element.classList.add(wT+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(cS(()=>{this._element.classList.remove(wT+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new xT(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${TT} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${TT} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${TT} .xterm-dim { color: ${oT.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${TT}.${OT} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${TT}.${OT} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${TT}.${OT} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${TT} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${TT} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${TT} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${TT} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${TT} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${kT} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${kT} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${kT} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${ET}${n} { color: ${r.css}; }${this._terminalSelector} .${ET}${n}.xterm-dim { color: ${oT.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${DT}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${ET}257 { color: ${oT.opaque(e.background).css}; }${this._terminalSelector} .${ET}257.xterm-dim { color: ${oT.multiplyOpacity(oT.opaque(e.background),.5).css}; }${this._terminalSelector} .${DT}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(OT),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(OT),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${wT}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};jT=Yb([q(7,Ex),q(8,Px),q(9,Ox),q(10,Sx),q(11,wx),q(12,Fx),q(13,Bx)],jT);var MT=class extends dS{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new J),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new FT(this._optionsService))}catch{this._measureStrategy=this._register(new PT(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};MT=Yb([q(2,Ox)],MT);var NT=class extends dS{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},PT=class extends NT{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},FT=class extends NT{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},IT=class extends dS{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new LT(this._window)),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new J),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(yS.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Y(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(Y(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},LT=class extends dS{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new fS),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(cS(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Y(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},RT=class extends dS{constructor(){super(),this.linkProviders=[],this._register(cS(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function zT(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function BT(e,t,n,r,i,a,o,s,c){if(!a)return;let l=zT(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var VT=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return BT(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=zT(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};VT=Yb([q(0,Lx),q(1,Px)],VT);var HT=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},UT={};Jb(UT,{getSafariVersion:()=>XT,isChromeOS:()=>nE,isFirefox:()=>qT,isIpad:()=>QT,isIphone:()=>$T,isLegacyEdge:()=>JT,isLinux:()=>tE,isMac:()=>ZT,isNode:()=>WT,isSafari:()=>YT,isWindows:()=>eE});var WT=typeof process<`u`&&`title`in process,GT=WT?`node`:navigator.userAgent,KT=WT?`node`:navigator.platform,qT=GT.includes(`Firefox`),JT=GT.includes(`Edge`),YT=/^((?!chrome|android).)*safari/i.test(GT);function XT(){if(!YT)return 0;let e=GT.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ZT=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(KT),QT=KT===`iPad`,$T=KT===`iPhone`,eE=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(KT),tE=KT.indexOf(`Linux`)>=0,nE=/\bCrOS\b/.test(GT),rE=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},iE=class extends rE{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},aE=class extends rE{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},oE=!WT&&`requestIdleCallback`in window?aE:iE,sE=class{constructor(){this._queue=new oE}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},cE=class extends dS{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new fS),this._pausedResizeTask=new sE,this._observerDisposable=this._register(new fS),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new J),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new J),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new J),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new HT((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new lE(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(cS(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=cS(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};cE=Yb([q(2,Ox),q(3,Px),q(4,wx),q(5,jx),q(6,Sx),q(7,Fx),q(8,Bx)],cE);var lE=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function uE(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return pE(i,a,e,t,n,r)+mE(a,t,n,r)+hE(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,SE(Math.abs(i-e),xE(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return SE(fE(a>t?e:i,n)+(s-1)*n.cols+1+dE(a>t?i:e,n),xE(o,r))}function dE(e,t){return e-1}function fE(e,t){return t.cols-e}function pE(e,t,n,r,i,a){return mE(t,r,i,a).length===0?``:SE(bE(e,t,e,t-_E(t,i),!1,i).length,xE(`D`,a))}function mE(e,t,n,r){let i=e-_E(e,n),a=t-_E(t,n);return SE(Math.abs(i-a)-gE(e,t,n),xE(yE(e,t),r))}function hE(e,t,n,r,i,a){let o;o=mE(t,r,i,a).length>0?r-_E(r,i):t;let s=r,c=vE(e,t,n,r,i,a);return SE(bE(e,o,n,s,c===`C`,i).length,xE(c,a))}function gE(e,t,n){let r=0,i=e-_E(e,n),a=t-_E(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=yE(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function _E(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function vE(e,t,n,r,i,a){let o;return o=mE(n,r,i,a).length>0?r-_E(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function yE(e,t){return e>t?`A`:`B`}function bE(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function xE(e,t){let n=t?`O`:`[`;return X.ESC+n+e}function SE(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var CE=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function wE(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var TE=50,EE=15,DE=50,OE=500,kE=RegExp(`\xA0`,`g`),AE=class extends dS{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new hx,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new J),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new J),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new J),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new CE(this._bufferService),this._activeSelectionMode=0,this._register(cS(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(kE,` `)).join(eE?`\r
66
+ `:`
67
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),tE&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=wE(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=zT(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-TE),TE),t/=TE,t/Math.abs(t)+Math.round(t*(EE-1)))}shouldForceSelection(e){return ZT?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),DE)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(ZT&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<OE&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=uE(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=wE(n,this._bufferService.cols)}};AE=Yb([q(3,Sx),q(4,wx),q(5,Ix),q(6,Ox),q(7,Lx),q(8,Fx)],AE);var jE=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ME=class{constructor(){this._color=new jE,this._css=new jE}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},NE=Object.freeze((()=>{let e=[sT.toColor(`#2e3436`),sT.toColor(`#cc0000`),sT.toColor(`#4e9a06`),sT.toColor(`#c4a000`),sT.toColor(`#3465a4`),sT.toColor(`#75507b`),sT.toColor(`#06989a`),sT.toColor(`#d3d7cf`),sT.toColor(`#555753`),sT.toColor(`#ef2929`),sT.toColor(`#8ae234`),sT.toColor(`#fce94f`),sT.toColor(`#729fcf`),sT.toColor(`#ad7fa8`),sT.toColor(`#34e2e2`),sT.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:aT.toCss(r,i,a),rgba:aT.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:aT.toCss(n,n,n),rgba:aT.toRgba(n,n,n)})}return e})()),PE=sT.toColor(`#ffffff`),FE=sT.toColor(`#000000`),IE=sT.toColor(`#ffffff`),LE=FE,RE={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},zE=PE,BE=class extends dS{constructor(e){super(),this._optionsService=e,this._contrastCache=new ME,this._halfContrastCache=new ME,this._onChangeColors=this._register(new J),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:PE,background:FE,cursor:IE,cursorAccent:LE,selectionForeground:void 0,selectionBackgroundTransparent:RE,selectionBackgroundOpaque:oT.blend(FE,RE),selectionInactiveBackgroundTransparent:RE,selectionInactiveBackgroundOpaque:oT.blend(FE,RE),scrollbarSliderBackground:oT.opacity(PE,.2),scrollbarSliderHoverBackground:oT.opacity(PE,.4),scrollbarSliderActiveBackground:oT.opacity(PE,.5),overviewRulerBorder:PE,ansi:NE.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=VE(e.foreground,PE),t.background=VE(e.background,FE),t.cursor=oT.blend(t.background,VE(e.cursor,IE)),t.cursorAccent=oT.blend(t.background,VE(e.cursorAccent,LE)),t.selectionBackgroundTransparent=VE(e.selectionBackground,RE),t.selectionBackgroundOpaque=oT.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=VE(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=oT.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?VE(e.selectionForeground,iT):void 0,t.selectionForeground===iT&&(t.selectionForeground=void 0),oT.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=oT.opacity(t.selectionBackgroundTransparent,.3)),oT.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=oT.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=VE(e.scrollbarSliderBackground,oT.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=VE(e.scrollbarSliderHoverBackground,oT.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=VE(e.scrollbarSliderActiveBackground,oT.opacity(t.foreground,.5)),t.overviewRulerBorder=VE(e.overviewRulerBorder,zE),t.ansi=NE.slice(),t.ansi[0]=VE(e.black,NE[0]),t.ansi[1]=VE(e.red,NE[1]),t.ansi[2]=VE(e.green,NE[2]),t.ansi[3]=VE(e.yellow,NE[3]),t.ansi[4]=VE(e.blue,NE[4]),t.ansi[5]=VE(e.magenta,NE[5]),t.ansi[6]=VE(e.cyan,NE[6]),t.ansi[7]=VE(e.white,NE[7]),t.ansi[8]=VE(e.brightBlack,NE[8]),t.ansi[9]=VE(e.brightRed,NE[9]),t.ansi[10]=VE(e.brightGreen,NE[10]),t.ansi[11]=VE(e.brightYellow,NE[11]),t.ansi[12]=VE(e.brightBlue,NE[12]),t.ansi[13]=VE(e.brightMagenta,NE[13]),t.ansi[14]=VE(e.brightCyan,NE[14]),t.ansi[15]=VE(e.brightWhite,NE[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=VE(e.extendedAnsi[r],NE[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};BE=Yb([q(0,Ox)],BE);function VE(e,t){if(e!==void 0)try{return sT.toColor(e)}catch{}return t}var HE=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},UE=class{constructor(){this._services=new HE,this._services.set(Ex,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=yx(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},WE={trace:0,debug:1,info:2,warn:3,error:4,off:5},GE=`xterm.js: `,KE=class extends dS{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),qE=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=WE[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:GE)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};KE=Yb([q(0,Ox)],KE);var qE,JE=class extends dS{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new J),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new J),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new J),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},YE=3,XE=Object.freeze(new px),ZE=0,QE=2,$E=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*YE);let r=t||hx.fromCharData([0,dx,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*YE+0],n=t&2097151;return[this._data[e*YE+1],t&2097152?this._combined[e]:n?sx(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*YE+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*YE+0]=e|2097152|t[2]<<22):this._data[e*YE+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*YE+0]>>22}hasWidth(e){return this._data[e*YE+0]&12582912}getFg(e){return this._data[e*YE+1]}getBg(e){return this._data[e*YE+2]}hasContent(e){return this._data[e*YE+0]&4194303}getCodePoint(e){let t=this._data[e*YE+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*YE+0]&2097152}getString(e){let t=this._data[e*YE+0];return t&2097152?this._combined[e]:t&2097151?sx(t&2097151):``}isProtected(e){return this._data[e*YE+2]&536870912}loadCell(e,t){return ZE=e*YE,t.content=this._data[ZE+0],t.fg=this._data[ZE+1],t.bg=this._data[ZE+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*YE+0]=t.content,this._data[e*YE+1]=t.fg,this._data[e*YE+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*YE+0]=t|n<<22,this._data[e*YE+1]=r.fg,this._data[e*YE+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*YE+0];r&2097152?this._combined[e]+=sx(t):r&2097151?(this._combined[e]=sx(r&2097151)+sx(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*YE+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new hx;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new hx;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*QE<this._data.buffer.byteLength;let n=e*YE;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*QE<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*QE<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t){for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);return}this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*YE+0]&4194303)return e+(this._data[e*YE+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*YE+0]&4194303||this._data[e*YE+2]&50331648)return e+(this._data[e*YE+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<YE;e++)this._data[(n+i)*YE+e]=a[(t+i)*YE+e];a[(t+i)*YE+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<YE;e++)this._data[(n+i)*YE+e]=a[(t+i)*YE+e];a[(t+i)*YE+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*YE+0],n=e&2097151,a=e&2097152?this._combined[t]:n?sx(n):fx;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function eD(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=iD(u,d,t),p=1,m=0;for(;p<u.length;){let e=iD(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function tD(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function nD(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function rD(e,t,n){let r=[],i=e.map((n,r)=>iD(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=iD(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function iD(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var aD=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new J),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),oS(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};aD._nextId=1;var oD=aD,sD={},cD=sD.B;sD[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},sD.A={"#":`£`},sD.B=void 0,sD[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},sD.C=sD[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},sD.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},sD.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},sD.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},sD.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},sD.E=sD[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},sD.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},sD.H=sD[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},sD[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var lD=4294967295,uD=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=XE.clone(),this.savedCharset=cD,this.markers=[],this._nullCell=hx.fromCharData([0,dx,1,0]),this._whitespaceCell=hx.fromCharData([0,fx,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new oE,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new JE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new mx),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new mx),this._whitespaceCell}getBlankLine(e,t){return new $E(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>lD?lD:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=XE);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new JE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(XE),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new $E(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new $E(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=eD(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(XE),n);if(r.length>0){let n=tD(this.lines,r);nD(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(XE),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new $E(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(XE),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=rD(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(XE,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=iD(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new oD(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},dD=class extends dS{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new J),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new uD(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new uD(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},fD=2,pD=1,mD=class extends dS{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,fD),this.rows=Math.max(e.rawOptions.rows||0,pD),this.buffers=this._register(new dD(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};mD=Yb([q(0,Ox)],mD);var hD={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:ZT,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},gD=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],_D=class extends dS{constructor(e){super(),this._onOptionChange=this._register(new J),this.onOptionChange=this._onOptionChange.event;let t={...hD};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(cS(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in hD))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in hD))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=hD[e],!vD(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=hD[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=gD.includes(t)?t:hD[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function vD(e){return e===`block`||e===`underline`||e===`bar`}function yD(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&yD(e[r],t-1);return n}var bD=Object.freeze({insertMode:!1}),xD=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),SD=class extends dS{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new J),this.onData=this._onData.event,this._onUserInput=this._register(new J),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new J),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=yD(bD),this.decPrivateModes=yD(xD)}reset(){this.modes=yD(bD),this.decPrivateModes=yD(xD)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};SD=Yb([q(0,Sx),q(1,Dx),q(2,Ox)],SD);var CD={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function wD(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var TD=String.fromCharCode,ED={DEFAULT:e=>{let t=[wD(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${TD(t[0])}${TD(t[1])}${TD(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${wD(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${wD(e,!0)};${e.x};${e.y}${t}`}},DD=class extends dS{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new J),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(CD))this.addProtocol(e,CD[e]);for(let e of Object.keys(ED))this.addEncoding(e,ED[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};DD=Yb([q(0,Sx),q(1,wx),q(2,Ox)],DD);var OD=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],kD=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],AD;function jD(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var MD=class{constructor(){if(this.version=`6`,!AD){AD=new Uint8Array(65536),AD.fill(1),AD[0]=0,AD.fill(0,1,32),AD.fill(0,127,160),AD.fill(2,4352,4448),AD[9001]=2,AD[9002]=2,AD.fill(2,11904,42192),AD[12351]=1,AD.fill(2,44032,55204),AD.fill(2,63744,64256),AD.fill(2,65040,65050),AD.fill(2,65072,65136),AD.fill(2,65280,65377),AD.fill(2,65504,65511);for(let e=0;e<OD.length;++e)AD.fill(0,OD[e][0],OD[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?AD[e]:jD(e,kD)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=ND.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return ND.createPropertyValue(0,n,r)}},ND=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new J,this.onChange=this._onChange.event;let e=new MD;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},PD=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function FD(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var ID=2147483647,LD=256,RD=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>LD)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>ID?ID:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>ID?ID:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,ID):e}},zD=[],BD=class{constructor(){this._state=0,this._active=zD,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=zD}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=zD,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||zD,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,cx(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3){if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}}this._active=zD,this._id=-1,this._state=0}}},VD=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=cx(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},HD=[],UD=class{constructor(){this._handlers=Object.create(null),this._active=HD,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=HD}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=HD,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||HD,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,cx(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=HD,this._ident=0}},WD=new RD;WD.addParam(0);var GD=class{constructor(e){this._handler=e,this._data=``,this._params=WD,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():WD,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=cx(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=WD,this._data=``,this._hitLimit=!1,e));return this._params=WD,this._data=``,this._hitLimit=!1,t}},KD=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},qD=160,JD=function(){let e=new KD(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(qD,0,2,0),e.add(qD,8,5,8),e.add(qD,6,0,6),e.add(qD,11,0,11),e.add(qD,13,13,13),e}(),YD=class extends dS{constructor(e=JD){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new RD,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(cS(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new BD),this._dcsParser=this._register(new UD),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:qD)],i>>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r<qD){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<qD){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<qD){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<qD){this._printHandler(e,n,i),n=i-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<qD){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<qD){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},XD=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,ZD=/^[\da-f]+$/;function QD(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=XD.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),ZD.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function $D(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function eO(e,t=16){let[n,r,i]=e;return`rgb:${$D(n,t)}/${$D(r,t)}/${$D(i,t)}`}var tO={"(":0,")":1,"*":2,"+":3,"-":1,".":2},nO=131072,rO=10;function iO(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var aO=5e3,oO=0,sO=class extends dS{constructor(e,t,n,r,i,a,o,s,c=new YD){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new lx,this._utf8Decoder=new ux,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=XE.clone(),this._eraseAttrDataInternal=XE.clone(),this._onRequestBell=this._register(new J),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new J),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new J),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new J),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new J),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new J),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new J),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new J),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new J),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new cO(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(X.BEL,()=>this.bell()),this._parser.setExecuteHandler(X.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(X.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(X.BS,()=>this.backspace()),this._parser.setExecuteHandler(X.HT,()=>this.tab()),this._parser.setExecuteHandler(X.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(X.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Zw.IND,()=>this.index()),this._parser.setExecuteHandler(Zw.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Zw.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new VD(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new VD(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new VD(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new VD(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new VD(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new VD(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new VD(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new VD(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new VD(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new VD(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new VD(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new VD(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in sD)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new GD((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),aO))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${aO} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>nO&&(a=this._parseStack.position+nO)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<nO&&(this._parseBuffer=new Uint32Array(Math.min(e.length,nO))),o||this._dirtyRowTracker.clearRange(),e.length>nO)for(let t=a;t<e.length;t+=nO){let a=t+nO<e.length?t+nO:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=ND.extractWidth(t);let n=ND.extractShouldJoin(t),m=n?ND.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(sx(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof $E&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!iO(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new GD(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new VD(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(XE));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=ND.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(X.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(X.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(X.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(X.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(X.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,cD),this._charsetService.setgCharset(1,cD),this._charsetService.setgCharset(2,cD),this._charsetService.setgCharset(3,cD);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${X.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=px.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=XE.fg,e.bg=XE.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=XE.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=XE.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=XE.fg&16777215,r.bg&=-67108864,r.bg|=XE.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${X.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=XE.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!iO(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${X.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>rO&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>rO&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(lO(n)){if(r===`?`)t.push({type:0,index:n});else{let e=QD(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=QD(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);lO(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,cD),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(tO[e[0]],sD[e[1]]||cD),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=XE.clone(),this._eraseAttrDataInternal=XE.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new hx;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${X.ESC}${e}${X.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},cO=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(oO=e,e=t,t=oO),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};cO=Yb([q(0,Sx)],cO);function lO(e){return 0<=e&&e<256}var uO=5e7,dO=12,fO=50,pO=class extends dS{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new J),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>uO)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=dO?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=dO)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>fO&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},mO=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};mO=Yb([q(0,Sx)],mO);var hO=!1,gO=class extends dS{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new fS),this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onData=this._register(new J),this.onData=this._onData.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new J),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new J),this._instantiationService=new UE,this.optionsService=this._register(new _D(e)),this._instantiationService.setService(Ox,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(mD)),this._instantiationService.setService(Sx,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(KE)),this._instantiationService.setService(Dx,this._logService),this.coreService=this._register(this._instantiationService.createInstance(SD)),this._instantiationService.setService(wx,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(DD)),this._instantiationService.setService(Cx,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ND)),this._instantiationService.setService(Ax,this.unicodeService),this._charsetService=this._instantiationService.createInstance(PD),this._instantiationService.setService(Tx,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(mO),this._instantiationService.setService(kx,this._oscLinkService),this._inputHandler=this._register(new sO(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(yS.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(yS.forward(this._bufferService.onResize,this._onResize)),this._register(yS.forward(this.coreService.onData,this._onData)),this._register(yS.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new pO((e,t)=>this._inputHandler.parse(e,t))),this._register(yS.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new J),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!hO&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),hO=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,fD),t=Math.max(t,pD),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(FD.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(FD(this._bufferService),!1))),this._windowsWrappingHeuristics.value=cS(()=>{for(let t of e)t.dispose()})}}},_O={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function vO(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=+!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?X.ESC+`OA`:X.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?X.ESC+`OD`:X.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?X.ESC+`OC`:X.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?X.ESC+`OB`:X.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:X.DEL,e.altKey&&(i.key=X.ESC+i.key);break;case 9:if(e.shiftKey){i.key=X.ESC+`[Z`;break}i.key=X.HT,i.cancel=!0;break;case 13:i.key=e.altKey?X.ESC+X.CR:X.CR,i.cancel=!0;break;case 27:i.key=X.ESC,e.altKey&&(i.key=X.ESC+X.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`D`:t?X.ESC+`OD`:X.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`C`:t?X.ESC+`OC`:X.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`A`:t?X.ESC+`OA`:X.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`B`:t?X.ESC+`OB`:X.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=X.ESC+`[2~`);break;case 46:i.key=a?X.ESC+`[3;`+(a+1)+`~`:X.ESC+`[3~`;break;case 36:i.key=a?X.ESC+`[1;`+(a+1)+`H`:t?X.ESC+`OH`:X.ESC+`[H`;break;case 35:i.key=a?X.ESC+`[1;`+(a+1)+`F`:t?X.ESC+`OF`:X.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?X.ESC+`[5;`+(a+1)+`~`:X.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?X.ESC+`[6;`+(a+1)+`~`:X.ESC+`[6~`;break;case 112:i.key=a?X.ESC+`[1;`+(a+1)+`P`:X.ESC+`OP`;break;case 113:i.key=a?X.ESC+`[1;`+(a+1)+`Q`:X.ESC+`OQ`;break;case 114:i.key=a?X.ESC+`[1;`+(a+1)+`R`:X.ESC+`OR`;break;case 115:i.key=a?X.ESC+`[1;`+(a+1)+`S`:X.ESC+`OS`;break;case 116:i.key=a?X.ESC+`[15;`+(a+1)+`~`:X.ESC+`[15~`;break;case 117:i.key=a?X.ESC+`[17;`+(a+1)+`~`:X.ESC+`[17~`;break;case 118:i.key=a?X.ESC+`[18;`+(a+1)+`~`:X.ESC+`[18~`;break;case 119:i.key=a?X.ESC+`[19;`+(a+1)+`~`:X.ESC+`[19~`;break;case 120:i.key=a?X.ESC+`[20;`+(a+1)+`~`:X.ESC+`[20~`;break;case 121:i.key=a?X.ESC+`[21;`+(a+1)+`~`:X.ESC+`[21~`;break;case 122:i.key=a?X.ESC+`[23;`+(a+1)+`~`:X.ESC+`[23~`;break;case 123:i.key=a?X.ESC+`[24;`+(a+1)+`~`:X.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=X.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=X.DEL:e.keyCode===219?i.key=X.ESC:e.keyCode===220?i.key=X.FS:e.keyCode===221&&(i.key=X.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=_O[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=X.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=X.ESC+n}else if(e.keyCode===32)i.key=X.ESC+(e.ctrlKey?X.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=X.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=X.US),e.key===`@`&&(i.key=X.NUL))}return i}var yO=0,bO=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new oE,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new oE,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(yO=this._search(t),yO===-1)||this._getKey(this._array[yO])!==t)return!1;do if(this._array[yO]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(yO),!0;while(++yO<this._array.length&&this._getKey(this._array[yO])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(yO=this._search(e),!(yO<0||yO>=this._array.length)&&this._getKey(this._array[yO])===e))do yield this._array[yO];while(++yO<this._array.length&&this._getKey(this._array[yO])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(yO=this._search(e),!(yO<0||yO>=this._array.length)&&this._getKey(this._array[yO])===e))do t(this._array[yO]);while(++yO<this._array.length&&this._getKey(this._array[yO])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},xO=0,SO=0,CO=class extends dS{constructor(){super(),this._decorations=new bO(e=>e?.marker.line),this._onDecorationRegistered=this._register(new J),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new J),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(cS(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new wO(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{xO=t.options.x??0,SO=xO+(t.options.width??1),e>=xO&&e<SO&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},wO=class extends uS{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new J),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new J),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?sT.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?sT.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},TO=1e3,EO=class{constructor(e,t=TO){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},DO=20,OO=class extends dS{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new EO(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
68
+ `))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Y(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(cS(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<DO+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
69
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===DO+1&&(this._liveRegion.textContent+=$b.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};OO=Yb([q(1,Ex),q(2,Fx),q(3,Lx)],OO);var kO=class extends dS{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new J),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new J),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(cS(()=>{oS(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Y(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Y(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(Y(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(Y(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&AO(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,oS(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};kO=Yb([q(1,Ix),q(2,Lx),q(3,Sx),q(4,Vx)],kO);function AO(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var jO=class extends gO{constructor(e={}){super(e),this._linkifier=this._register(new fS),this.browser=UT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new fS),this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new J),this.onKey=this._onKey.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new J),this.onBell=this._onBell.event,this._onFocus=this._register(new J),this._onBlur=this._register(new J),this._onA11yCharEmitter=this._register(new J),this._onA11yTabEmitter=this._register(new J),this._onWillOpen=this._register(new J),this._setup(),this._decorationService=this._instantiationService.createInstance(CO),this._instantiationService.setService(jx,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(RT),this._instantiationService.setService(Vx,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Mx)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(yS.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(yS.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(yS.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(yS.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(cS(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=oT.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${X.ESC}]${n};${eO(r)}${Qw.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=aT.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=aT.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(OO,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(Y(this.element,`copy`,e=>{this.hasSelection()&&nx(e,this._selectionService)}));let e=e=>rx(e,this.textarea,this.coreService,this.optionsService);this._register(Y(this.textarea,`paste`,e)),this._register(Y(this.element,`paste`,e)),qT?this._register(Y(this.element,`mousedown`,e=>{e.button===2&&ox(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Y(this.element,`contextmenu`,e=>{ox(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),tE&&this._register(Y(this.element,`auxclick`,e=>{e.button===1&&ax(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Y(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(Y(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(Y(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(Y(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(Y(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(Y(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(Y(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(Y(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,Zb.get()),nE||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(IT,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(Fx,this._coreBrowserService),this._register(Y(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(Y(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(MT,this._document,this._helperContainer),this._instantiationService.setService(Px,this._charSizeService),this._themeService=this._instantiationService.createInstance(BE),this._instantiationService.setService(Bx,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(pT),this._instantiationService.setService(zx,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(cE,this.rows,this.screenElement)),this._instantiationService.setService(Lx,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance($w,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(VT),this._instantiationService.setService(Ix,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(kO,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Ww,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(AE,this.element,this.screenElement,r)),this._instantiationService.setService(Rx,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(yS.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Gw,this.screenElement)),this._register(Y(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(OO,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Xw,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Xw,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(jT,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Y(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(Y(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=X.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){ix(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=vO(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===X.ETX||n.key===X.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(MO(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(XE));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(X.ESC+`[I`):this.coreService.triggerDataEvent(X.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}};function MO(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var NO=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},PO=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new hx)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},FO=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new PO(t)}getNullCell(){return new hx}},IO=class extends dS{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new J),this.onBufferChange=this._onBufferChange.event,this._normal=new FO(this._core.buffers.normal,`normal`),this._alternate=new FO(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},LO=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},RO=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},zO=[`cols`,`rows`],BO=0,VO=class extends dS{constructor(e){super(),this._core=this._register(new jO(e)),this._addonManager=this._register(new NO),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(zO.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new LO(this._core),this._parser}get unicode(){return this._checkProposedApi(),new RO(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new IO(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
70
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Zb.get()},set promptLabel(e){Zb.set(e)},get tooMuchOutput(){return $b.get()},set tooMuchOutput(e){$b.set(e)}}}_verifyIntegers(...e){for(BO of e)if(BO===1/0||isNaN(BO)||BO%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(BO of e)if(BO&&(BO===1/0||isNaN(BO)||BO%1!=0||BO<0))throw Error(`This API only accepts positive integers`)}};function HO({enabled:e}){let{t}=Nb(),n=(0,y.useRef)(null),[r,i]=(0,y.useState)(0),[a,o]=(0,y.useState)(`starting`),[s,c]=(0,y.useState)(``);(0,y.useEffect)(()=>{if(!e)return;let r=n.current;if(!r)return;let i=!1,a,s,l=new VO({cursorBlink:!0,fontFamily:`Cascadia Mono, Consolas, monospace`,fontSize:12,theme:{background:`#0a0a0a`,foreground:`#e4e4e7`,cursor:`#e4e4e7`,selectionBackground:`#3f3f46`}}),u=new Gb;l.loadAddon(u),l.open(r);let d=()=>{if(!(r.clientWidth<=0||r.clientHeight<=0))try{u.fit(),s?.readyState===WebSocket.OPEN&&s.send(JSON.stringify({type:`resize`,cols:l.cols,rows:l.rows}))}catch(e){c(e instanceof Error?e.message:String(e))}},f=new ResizeObserver(d);f.observe(r);let p=l.onData(e=>{s?.readyState===WebSocket.OPEN&&s.send(JSON.stringify({type:`input`,data:e}))});async function m(){try{d();let e=await Vv(l.cols,l.rows);if(a=e.id,i){await Hv(e.id);return}s=new WebSocket(Uv(e.id)),s.onopen=()=>{i||(o(`connected`),c(``),d(),l.focus())},s.onmessage=e=>{let n;try{n=JSON.parse(e.data)}catch{c(t(`terminal.invalidData`));return}n.type===`output`&&typeof n.data==`string`?l.write(n.data):n.type===`exit`?(o(`disconnected`),l.write(`\r\n${t(`terminal.exited`,{code:String(n.exitCode??`?`)})}\r\n`)):n.type===`error`&&c(typeof n.message==`string`?n.message:t(`terminal.serverError`))},s.onerror=()=>{i||(o(`error`),c(t(`terminal.connectionError`)))},s.onclose=()=>{i||o(e=>e===`error`?e:`disconnected`)}}catch(e){i||(o(`error`),c(e instanceof Error?e.message:String(e)))}}return m(),()=>{i=!0,f.disconnect(),p.dispose(),s?.readyState===WebSocket.OPEN?(s.send(JSON.stringify({type:`dispose`})),s.close()):a&&Hv(a).catch(e=>{B.error(e instanceof Error?e.message:String(e))}),l.dispose()}},[e,r,t]);let l={starting:t(`terminal.starting`),connected:t(`terminal.connected`),disconnected:t(`terminal.disconnected`),error:t(`terminal.error`)};return(0,H.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-3`,children:[(0,H.jsx)(`span`,{className:`size-2 rounded-full ${a===`connected`?`bg-emerald-500`:a===`error`?`bg-destructive`:`bg-muted-foreground`}`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,role:`status`,children:l[a]}),(0,H.jsx)(K,{size:`icon-xs`,variant:`ghost`,title:t(`terminal.restart`),"aria-label":t(`terminal.restart`),onClick:()=>{c(``),o(`starting`),i(e=>e+1)},children:a===`starting`?(0,H.jsx)(pa,{}):(0,H.jsx)(ya,{})})]}),s?(0,H.jsx)(`p`,{className:`shrink-0 border-b px-3 py-2 text-xs text-destructive`,role:`alert`,children:s}):null,(0,H.jsx)(`div`,{ref:n,className:`min-h-0 flex-1 overflow-hidden bg-[#0a0a0a] p-2`,"aria-label":t(`rightSidebar.terminal`)})]})}function UO({tab:e,onTabChange:t,onClose:n,open:r}){let{t:i}=Nb(),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)({path:``,entries:[],error:``}),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(0),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(null),b=Hb(),x=`${d?`diff`:`file`}/${l??``}/${p}`,S=s.path===a,C=S?s.entries:[],w=S?s.error:``,T=_?.key===x,E=T?_:null,D=(!!l||d)&&!T;(0,y.useEffect)(()=>{let e=!0;return Rv(a).then(t=>{e&&c({path:a,entries:t.entries,error:``})}).catch(t=>{e&&c({path:a,entries:[],error:t instanceof Error?t.message:String(t)})}),()=>{e=!1}},[a,p]),(0,y.useEffect)(()=>{if(!l&&!d)return;let e=!0;return(d?Bv(l??``):zv(l)).then(t=>{e&&v({key:x,content:t.content,error:``,notice:`binary`in t&&t.binary?i(`workspace.binary`):`truncated`in t&&t.truncated?i(`workspace.truncated`):``})}).catch(t=>{e&&v({key:x,content:``,error:t instanceof Error?t.message:String(t),notice:``})}),()=>{e=!1}},[l,d,p,i,x]);function O(e){u(e.directory?null:e.path),f(!1),e.directory&&o(e.path)}return(0,H.jsxs)(`aside`,{className:`${r?`flex`:`hidden`} h-svh w-80 shrink-0 flex-col border-l bg-sidebar text-sidebar-foreground`,"aria-label":i(`rightSidebar.title`),children:[(0,H.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-1 border-b px-3`,children:[(0,H.jsxs)(K,{variant:e===`files`?`secondary`:`ghost`,size:`sm`,"aria-pressed":e===`files`,onClick:()=>t(`files`),children:[(0,H.jsx)(Li,{}),i(`rightSidebar.files`)]}),(0,H.jsxs)(K,{variant:e===`terminal`?`secondary`:`ghost`,size:`sm`,"aria-pressed":e===`terminal`,onClick:()=>{g(!0),t(`terminal`)},children:[(0,H.jsx)(Fa,{}),i(`rightSidebar.terminal`)]}),(0,H.jsx)(K,{className:`ml-auto`,variant:`ghost`,size:`icon`,"aria-label":i(`rightSidebar.close`),title:i(`rightSidebar.close`),onClick:n,children:(0,H.jsx)(sa,{})})]}),e===`files`?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b p-2`,children:[(0,H.jsx)(K,{size:`icon-sm`,variant:`ghost`,"aria-label":i(`workspace.up`),title:i(`workspace.up`),disabled:!a,onClick:()=>{o(a.split(/[\\/]/).slice(0,-1).join(`/`)),u(null),f(!1)},children:(0,H.jsx)($r,{})}),(0,H.jsx)(K,{size:`icon-sm`,variant:`ghost`,"aria-label":i(`workspace.refresh`),title:i(`workspace.refresh`),onClick:()=>m(e=>e+1),children:(0,H.jsx)(_a,{})}),(0,H.jsx)(K,{size:`sm`,variant:d?`secondary`:`ghost`,className:`ml-auto`,onClick:()=>{u(null),f(!0)},children:i(`workspace.diff`)})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,H.jsxs)(`p`,{className:`truncate border-b px-3 py-2 text-xs text-muted-foreground`,title:b.info?.workspace,children:[b.info?.workspace??i(`workspace.scope`),a?` / ${a}`:``]}),w?(0,H.jsx)(`p`,{role:`alert`,className:`p-3 text-xs text-destructive`,children:w}):null,!w&&S&&C.length===0?(0,H.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:i(`browser.empty`)}):null,!w&&!S?(0,H.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:i(`workspace.loading`)}):null,C.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-9 w-full items-center gap-2 px-3 text-left text-sm hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>O(e),children:[e.directory?(0,H.jsx)(Li,{className:`size-4 shrink-0 text-muted-foreground`}):(0,H.jsx)(ji,{className:`size-4 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))]}),(0,H.jsxs)(`section`,{className:`flex min-h-0 max-h-[45%] shrink-0 flex-col border-t`,children:[(0,H.jsx)(`div`,{className:`flex h-9 shrink-0 items-center border-b px-3 text-xs font-medium`,children:(0,H.jsx)(`span`,{className:`truncate`,children:d?i(`workspace.diff`):l??i(`workspace.file`)})}),E?.error?(0,H.jsx)(`p`,{role:`alert`,className:`overflow-auto p-3 text-xs text-destructive`,children:E.error}):null,E?.notice?(0,H.jsx)(`p`,{className:`shrink-0 p-2 text-xs text-muted-foreground`,children:E.notice}):null,(0,H.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5`,children:D?i(`workspace.loading`):E?.content||i(`workspace.empty`)})]})]}):null,(0,H.jsx)(`div`,{className:e===`terminal`?`flex min-h-0 flex-1 flex-col`:`hidden`,children:(0,H.jsx)(HO,{enabled:h})})]})}var WO=nb(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function GO({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?ts:`span`;return(0,H.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:W(WO({variant:t}),e),...r})}function KO({className:e,size:t=`default`,...n}){return(0,H.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:W(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function qO({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-header`,className:W(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function JO({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-title`,className:W(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function YO({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-description`,className:W(`text-sm text-muted-foreground`,e),...t})}function XO({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-content`,className:W(`px-(--card-spacing)`,e),...t})}function ZO({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:W(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}var QO=[`stdio`,`http`,`sse`];function $O(){return{name:``,transport:`stdio`,command:``,args:``,env:``,url:``,headers:``}}function ek(e){let t=e.trim();if(t.length===0)return[];if(t.startsWith(`[`)){let e=JSON.parse(t);if(!Array.isArray(e))throw Error(`args must be a JSON array.`);return e.map(e=>String(e))}return t.split(/\s+/)}function tk(e,t){if(e.trim().length===0)return;let n=JSON.parse(e);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`${t} must be a JSON object.`);return n}function nk(e,t){let n=typeof t.type==`string`?t.type.toLowerCase():``;return{name:e,transport:t.url?n===`sse`?`sse`:`http`:`stdio`,command:typeof t.command==`string`?t.command:``,args:Array.isArray(t.args)?t.args.join(` `):``,env:t.env?JSON.stringify(t.env,null,2):``,url:typeof t.url==`string`?t.url:``,headers:t.headers?JSON.stringify(t.headers,null,2):``}}function rk(e){if(e.transport===`stdio`){let t={type:`stdio`,command:e.command.trim()},n=ek(e.args);n.length>0&&(t.args=n);let r=tk(e.env,`env`);return r&&(t.env=r),t}let t={type:e.transport,url:e.url.trim()},n=tk(e.headers,`headers`);return n&&(t.headers=n),t}function ik(){let{t:e}=Nb(),[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)([]),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)({}),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(null),p=(0,y.useCallback)(()=>{vy().then(e=>{n(e.servers.filter(e=>e.scope===`project`).map(e=>nk(e.name,e.config))),i(Object.entries(e.map).map(([e,t])=>nk(e,t))),c(Object.fromEntries(e.servers.map(e=>[e.name,e.authenticated])))}).catch(e=>B.error(e instanceof Error?e.message:String(e))),yy().then(o).catch(()=>o(null))},[]);(0,y.useEffect)(p,[p]),(0,y.useEffect)(()=>{if(!l)return;let t=!1,n=async()=>{try{let n=await Ry(l.flowId);if(t)return;n.status===`success`?(B.success(e(`connectors.authenticated`)),u(null),p()):n.status===`error`&&(B.error(n.error??e(`oauth.signInFailed`)),u(null))}catch(e){t||(B.error(e instanceof Error?e.message:String(e)),u(null))}},r=setInterval(()=>void n(),2e3);return()=>{t=!0,clearInterval(r)}},[l,e,p]);async function m(e){let t=e.name.trim(),n=e.url.trim();if(t.length!==0&&n.length!==0)try{let e=await xy(t,n);u({name:t,flowId:e.flowId}),e.verificationUrl&&window.open(e.verificationUrl,`_blank`,`noopener`)}catch(e){B.error(e instanceof Error?e.message:String(e))}}function h(e,t,r){(e===`project`?n:i)(e=>e.map((e,n)=>n===t?{...e,...r}:e))}function g(e){(e===`project`?n:i)(e=>[...e,$O()])}function _(e,t){(e===`project`?n:i)(e=>e.filter((e,n)=>n!==t))}async function v(t,n){let r={};try{for(let t of n){let n=t.name.trim();if(n.length===0){B.error(e(`connectors.name`));return}r[n]=rk(t)}}catch(e){B.error(e instanceof Error?e.message:String(e));return}f(t);try{await Sy(r,t),B.success(e(`connectors.saved`)),p()}catch(e){B.error(e instanceof Error?e.message:String(e))}finally{f(null)}}async function b(t){try{let n=await by(t.name.trim()||`test`,rk(t));B.success(e(`connectors.testOk`,{count:n.tools.length}))}catch(n){let r=n instanceof Error?n.message:String(n);t.transport!==`stdio`&&!s[t.name.trim()]?B.error(e(`connectors.loginFirst`)):B.error(r)}}function x(t,n){return(0,H.jsxs)(KO,{children:[(0,H.jsxs)(qO,{className:`flex-row items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(JO,{className:`text-sm`,children:e(t===`project`?`connectors.project`:`connectors.global`)}),(0,H.jsx)(GO,{variant:`outline`,children:n.length})]}),(0,H.jsx)(K,{size:`sm`,onClick:()=>void v(t,n),disabled:d===t,children:e(`settings.save`)})]}),(0,H.jsxs)(XO,{className:`space-y-3`,children:[n.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`connectors.empty`)}):n.map((n,r)=>(0,H.jsxs)(`div`,{className:`space-y-2 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Sb,{value:n.name,onChange:e=>h(t,r,{name:e.target.value}),placeholder:e(`connectors.name`),className:`font-medium`}),(0,H.jsx)(`select`,{value:n.transport,onChange:e=>h(t,r,{transport:e.target.value}),className:`h-9 rounded-md border bg-transparent px-2 text-sm`,children:QO.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))}),n.transport!==`stdio`&&s[n.name]?(0,H.jsx)(GO,{variant:`default`,children:e(`connectors.authenticated`)}):null,n.transport===`stdio`?null:(0,H.jsx)(K,{size:`icon`,variant:`ghost`,title:e(`connectors.login`),onClick:()=>void m(n),disabled:l?.name===n.name.trim()||n.url.trim().length===0,children:(0,H.jsx)(Ui,{})}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,title:e(`connectors.test`),onClick:()=>void b(n),children:(0,H.jsx)(Ni,{})}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,onClick:()=>_(t,r),children:(0,H.jsx)(Ua,{})})]}),n.transport===`stdio`?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Sb,{value:n.command,onChange:e=>h(t,r,{command:e.target.value}),placeholder:e(`connectors.command`),className:`font-mono text-xs`}),(0,H.jsx)(Sb,{value:n.args,onChange:e=>h(t,r,{args:e.target.value}),placeholder:e(`connectors.args`),className:`font-mono text-xs`}),(0,H.jsx)(ZO,{value:n.env,onChange:e=>h(t,r,{env:e.target.value}),spellCheck:!1,className:`min-h-16 font-mono text-xs`,placeholder:e(`connectors.env`)})]}):(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Sb,{value:n.url,onChange:e=>h(t,r,{url:e.target.value}),placeholder:e(`connectors.url`),className:`font-mono text-xs`}),(0,H.jsx)(ZO,{value:n.headers,onChange:e=>h(t,r,{headers:e.target.value}),spellCheck:!1,className:`min-h-16 font-mono text-xs`,placeholder:e(`connectors.headers`)})]})]},r)),(0,H.jsxs)(K,{variant:`outline`,size:`sm`,onClick:()=>g(t),children:[(0,H.jsx)(ha,{"data-icon":`inline-start`}),e(`connectors.add`)]})]})]})}return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:e(`settings.connectors`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`connectors.hint`)})]}),a?(0,H.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,H.jsx)(`p`,{className:`mb-2 text-xs font-medium`,children:e(`connectors.connected`)}),a.servers.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`connectors.noneConnected`)}):(0,H.jsx)(`ul`,{className:`space-y-1`,children:a.servers.map(t=>(0,H.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(GO,{variant:`default`,children:t.name}),(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:e(`connectors.toolCount`,{count:t.tools.length})})]},t.name))}),a.errors.map(e=>(0,H.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[e.name,`: `,e.message]},e.name))]}):null,x(`project`,t),x(`global`,r)]})}var ak=2e3,ok={"openai-oauth":`ChatGPT (Codex OAuth)`,"github-copilot":`GitHub Copilot`,"xai-oauth":`xAI (Grok OAuth)`,"anthropic-oauth":`Anthropic (Claude Pro/Max)`};function sk(e){return ok[e]??e}function ck(e,t){return e instanceof Error?e.message:t}function lk(e){let t=e-Date.now();if(t<=0)return``;let n=Math.floor(t/6e4),r=Math.floor(n/1440),i=Math.floor(n%1440/60);return r>0?`${r}d${i}h`:i>0?`${i}h${n%60}m`:`${n}m`}function uk({account:e}){return e.avatarUrl?(0,H.jsx)(`img`,{src:e.avatarUrl,alt:``,className:`size-6 shrink-0 rounded-full`}):(0,H.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center rounded-full bg-muted`,children:(0,H.jsx)(qa,{className:`size-3.5 text-muted-foreground`})})}function dk(){let{t:e}=Nb(),t=Hb(),[n,r]=(0,y.useState)({domains:[]}),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)({}),[u,d]=(0,y.useState)({}),f=(0,y.useCallback)(()=>{Iy().then(r).catch(t=>B.error(ck(t,e(`oauth.loadFailed`))))},[e]);(0,y.useEffect)(f,[f]),(0,y.useEffect)(()=>{if(!o)return;let n=!1,i=async()=>{try{let i=await Ry(o.data.flowId);if(n)return;i.status===`success`?(B.success(e(`oauth.signedInToast`)),s(null),r(await Iy()),t.refreshInfo()):i.status===`error`&&(B.error(i.error??e(`oauth.signInFailed`)),s(null))}catch(t){n||(B.error(ck(t,e(`oauth.signInFailed`))),s(null))}};i();let a=setInterval(()=>void i(),ak);return()=>{n=!0,clearInterval(a)}},[o,e,t]),(0,y.useEffect)(()=>{let e=n.domains.filter(e=>e.domain===`openai-oauth`||e.domain===`xai-oauth`).flatMap(e=>e.accounts.map(t=>({domain:e.domain,id:t.uuid})));for(let t of e)c[t.id]||u[t.id]||zy(t.domain,t.id).then(e=>l(n=>({...n,[t.id]:e}))).catch(()=>d(e=>({...e,[t.id]:!0})))},[n,c,u]);function p(t){return t===`5_hour`?e(`oauth.window5h`):t===`7_day`?e(`oauth.window7d`):t===`30_day`?e(`oauth.window30d`):t===`weekly`?e(`oauth.windowWeekly`):t===`monthly`?e(`oauth.windowMonthly`):t===`daily`?e(`oauth.windowDaily`):t}async function m(t){a(t);try{let e=await Ly(t);s({domain:t,data:e})}catch(t){B.error(ck(t,e(`oauth.signInFailed`)))}finally{a(null)}}async function h(n,i){a(`${n}:${i}`);try{r(await Vy(n,i)),t.refreshInfo(),B.success(e(`oauth.signedOutToast`))}catch(t){B.error(ck(t,e(`oauth.signOutFailed`)))}finally{a(null)}}async function g(n,i){a(`${n}:${i}`);try{r(await By(n,i)),t.refreshInfo()}catch(t){B.error(ck(t,e(`oauth.signOutFailed`)))}finally{a(null)}}async function _(t){try{await navigator.clipboard.writeText(t),B.success(e(`oauth.copied`))}catch{B.error(e(`oauth.copyFailed`))}}return(0,H.jsxs)(KO,{children:[(0,H.jsxs)(qO,{children:[(0,H.jsx)(JO,{children:e(`oauth.title`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`oauth.intro`)})]}),(0,H.jsx)(XO,{className:`space-y-3`,children:n.domains.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.empty`)}):n.domains.map(t=>{let n=o?.domain===t.domain;return(0,H.jsxs)(`div`,{className:`space-y-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:sk(t.domain)}),(0,H.jsx)(GO,{variant:`secondary`,children:e(`oauth.accountCount`,{count:t.accounts.length})}),(0,H.jsxs)(K,{size:`sm`,variant:`outline`,className:`ml-auto`,onClick:()=>void m(t.domain),disabled:i===t.domain||n,children:[(0,H.jsx)(ha,{"data-icon":`inline-start`}),e(`oauth.addAccount`)]})]}),t.accounts.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.noAccounts`)}):(0,H.jsx)(`ul`,{className:`space-y-1.5`,children:t.accounts.map(n=>(0,H.jsxs)(`li`,{className:`rounded-md border px-2 py-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(uk,{account:n}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n.login||e(`oauth.signedIn`)}),n.reauthRequired?(0,H.jsx)(GO,{variant:`destructive`,children:e(`oauth.reauth`)}):null,n.isDefault?(0,H.jsx)(GO,{variant:`default`,children:e(`oauth.default`)}):(0,H.jsxs)(K,{size:`sm`,variant:`ghost`,onClick:()=>void g(t.domain,n.uuid),disabled:i===`${t.domain}:${n.uuid}`,children:[(0,H.jsx)(ja,{"data-icon":`inline-start`}),e(`oauth.setDefault`)]}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,title:e(`oauth.removeAccount`),onClick:()=>void h(t.domain,n.uuid),disabled:i===`${t.domain}:${n.uuid}`,children:(0,H.jsx)(Ua,{})})]}),t.domain===`openai-oauth`||t.domain===`xai-oauth`?(0,H.jsxs)(`div`,{className:`mt-2 space-y-1 pl-8`,children:[c[n.uuid]?.plan?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c[n.uuid]?.plan}):null,c[n.uuid]&&c[n.uuid].tiers.length>0?c[n.uuid].tiers.map(t=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`w-9 shrink-0`,children:p(t.name)}),(0,H.jsx)(`div`,{className:`h-1.5 w-36 overflow-hidden rounded-full bg-muted`,children:(0,H.jsx)(`div`,{className:W(`h-full rounded-full transition-all`,t.utilization>=90?`bg-destructive`:t.utilization>=70?`bg-amber-500`:`bg-primary`),style:{width:`${Math.min(100,Math.max(0,t.utilization))}%`}})}),(0,H.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(t.utilization),`%`]}),t.resetsAt?(0,H.jsxs)(`span`,{children:[`· `,e(`oauth.quotaResets`,{time:lk(t.resetsAt)})]}):null]},t.name)):(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u[n.uuid]?e(`oauth.quotaFailed`):e(`oauth.quotaLoading`)})]}):null]},n.uuid))}),n?(0,H.jsxs)(`div`,{className:`space-y-2 rounded-md border border-dashed p-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.deviceHint`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`code`,{className:`bg-muted rounded px-2 py-1 font-mono text-sm`,children:o.data.userCode}),(0,H.jsxs)(K,{size:`sm`,variant:`outline`,onClick:()=>void _(o.data.userCode),children:[(0,H.jsx)(xi,{"data-icon":`inline-start`}),e(`oauth.copyCode`)]}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,asChild:!0,children:(0,H.jsxs)(`a`,{href:o.data.verificationUrl,target:`_blank`,rel:`noreferrer`,children:[(0,H.jsx)(ki,{"data-icon":`inline-start`}),e(`oauth.open`)]})})]}),(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(Zi,{className:`size-3.5 animate-spin`}),e(`oauth.waiting`)]}),(0,H.jsx)(K,{size:`sm`,variant:`ghost`,onClick:()=>s(null),children:e(`oauth.cancel`)})]}):null]},t.domain)})})]})}function fk(){let{t:e}=Nb(),t=Hb(),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(!1),u=(0,y.useCallback)(()=>{gy().then(r).catch(e=>B.error(e instanceof Error?e.message:String(e)))},[]);(0,y.useEffect)(()=>{u()},[u]);async function d(e,n){l(!0);try{r(await e()),t.refreshInfo(),t.refreshSessions(),B.success(n)}catch(e){B.error(e instanceof Error?e.message:String(e))}finally{l(!1)}}async function f(){let t=i.trim();t.length!==0&&(await d(()=>Oy(t,o.trim()||void 0),e(`projects.added`)),a(``),s(``))}return(0,H.jsxs)(KO,{children:[(0,H.jsxs)(qO,{children:[(0,H.jsx)(JO,{children:e(`settings.projects`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`projects.hint`)})]}),(0,H.jsxs)(XO,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,H.jsx)(Sb,{value:i,onChange:e=>a(e.target.value),placeholder:e(`projects.path`),className:`flex-1 font-mono text-xs`}),(0,H.jsx)(Sb,{value:o,onChange:e=>s(e.target.value),placeholder:e(`projects.name`),className:`sm:w-40`}),(0,H.jsxs)(K,{onClick:()=>void f(),disabled:c||i.trim().length===0,children:[(0,H.jsx)(Fi,{"data-icon":`inline-start`}),e(`projects.add`)]})]}),!n||n.projects.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`projects.empty`)}):(0,H.jsx)(`div`,{className:`space-y-2`,children:n.projects.map(t=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:t.name}),n.current===t.id?(0,H.jsx)(GO,{children:e(`projects.current`)}):null]}),(0,H.jsx)(`p`,{className:`truncate font-mono text-xs text-muted-foreground`,children:t.path})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[n.current===t.id?(0,H.jsx)(ai,{className:`size-4 text-primary`}):(0,H.jsx)(K,{size:`sm`,variant:`outline`,disabled:c,onClick:()=>void d(()=>Ay(t.id),e(`projects.switched`)),children:e(`projects.use`)}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,disabled:c,onClick:()=>void d(()=>ky(t.id),e(`projects.removed`)),children:(0,H.jsx)(Ua,{})})]})]},t.id))})]})]})}function pk(e){let t=(e??``).toLowerCase();return t===`openai-oauth`||t===`oauth`||t===`chatgpt`||t===`github-copilot`||t===`copilot`||t===`xai-oauth`||t===`xai`||t===`grok`||t===`anthropic-oauth`||t===`claude-oauth`}var mk=[`openai-compatible`,`openai`,`anthropic`,`google`];function hk(){return{name:`new-provider`,type:`openai-compatible`,baseURL:``,apiKey:``,models:[]}}function gk(){let{t:e}=Nb(),t=Hb(),[n,r]=(0,y.useState)({providers:[]}),[i,a]=(0,y.useState)(`visual`),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)([]),[f,p]=(0,y.useState)(``),m=(0,y.useCallback)(()=>{jy().then(e=>{r(e),s(JSON.stringify({model:e.model??``,small_model:e.small_model??``,providers:e.providers??[]},null,2))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))},[]);(0,y.useEffect)(()=>{m()},[m]),(0,y.useEffect)(()=>{My().then(e=>d(e.presets)).catch(()=>{})},[]);function h(){let e=u.find(e=>e.id===f);if(!e)return;let t={name:e.id,type:e.type,models:[]};e.baseURL&&(t.baseURL=e.baseURL),r(e=>({...e,providers:[...e.providers??[],t]})),p(``)}let g=(n.providers??[]).map((e,t)=>({provider:e,index:t})).filter(({provider:e})=>!pk(e.type??e.vendor));function _(e,t){r(n=>({...n,providers:(n.providers??[]).map((n,r)=>r===e?{...n,...t}:n)}))}async function v(){l(!0);try{let r;if(i===`json`)try{r=JSON.parse(o)}catch{B.error(e(`settings.invalidJson`));return}else r=n;await Ny(r),t.refreshInfo(),B.success(e(`settings.saved`)),m()}catch(e){B.error(e instanceof Error?e.message:String(e))}finally{l(!1)}}return(0,H.jsxs)(KO,{children:[(0,H.jsxs)(qO,{className:`flex-row items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(JO,{children:e(`settings.providers`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`settings.providersHint`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex rounded-md border p-0.5`,children:[(0,H.jsx)(K,{size:`sm`,variant:i===`visual`?`secondary`:`ghost`,onClick:()=>a(`visual`),children:e(`settings.visual`)}),(0,H.jsx)(K,{size:`sm`,variant:i===`json`?`secondary`:`ghost`,onClick:()=>a(`json`),children:e(`settings.json`)})]}),(0,H.jsx)(K,{size:`sm`,onClick:()=>void v(),disabled:c,children:e(`settings.save`)})]})]}),(0,H.jsx)(XO,{className:`space-y-4`,children:i===`json`?(0,H.jsx)(ZO,{value:o,onChange:e=>s(e.target.value),spellCheck:!1,className:`min-h-96 font-mono text-xs`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`settings.oauthHint`)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value),className:`h-9 flex-1 rounded-md border bg-transparent px-2 text-sm`,children:[(0,H.jsx)(`option`,{value:``,children:e(`settings.fromPreset`)}),u.map(e=>(0,H.jsxs)(`option`,{value:e.id,children:[e.label,e.apiKeyEnv?` · ${e.apiKeyEnv}`:``]},e.id))]}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:h,disabled:f===``,children:e(`settings.addProvider`)})]}),g.map(({provider:t,index:n})=>(0,H.jsxs)(`div`,{className:`space-y-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Sb,{value:t.name,onChange:e=>_(n,{name:e.target.value}),placeholder:e(`settings.providerName`),className:`font-medium`}),(0,H.jsx)(Sb,{value:t.type??``,onChange:e=>_(n,{type:e.target.value}),placeholder:e(`settings.providerType`),list:`ringko-provider-types`,className:`w-48`}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,onClick:()=>r(e=>({...e,providers:(e.providers??[]).filter((e,t)=>t!==n)})),children:(0,H.jsx)(Ua,{})})]}),(0,H.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,H.jsx)(Sb,{value:t.baseURL??``,onChange:e=>_(n,{baseURL:e.target.value}),placeholder:e(`settings.baseUrl`),className:`font-mono text-xs`}),(0,H.jsx)(Sb,{type:`password`,value:t.apiKey??``,onChange:e=>_(n,{apiKey:e.target.value}),placeholder:e(`settings.apiKey`),className:`font-mono text-xs`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(t.models??[]).map((r,i)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Sb,{value:r.id,onChange:e=>_(n,{models:(t.models??[]).map((t,n)=>n===i?{...t,id:e.target.value}:t)}),placeholder:e(`settings.modelId`),className:`font-mono text-xs`}),(0,H.jsx)(Sb,{value:r.name,onChange:e=>_(n,{models:(t.models??[]).map((t,n)=>n===i?{...t,name:e.target.value}:t)}),placeholder:e(`settings.modelName`),className:`text-xs`}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,onClick:()=>_(n,{models:(t.models??[]).filter((e,t)=>t!==i)}),children:(0,H.jsx)(Ua,{})})]},i)),(0,H.jsxs)(K,{size:`sm`,variant:`outline`,onClick:()=>_(n,{models:[...t.models??[],{id:``,name:``}]}),children:[(0,H.jsx)(ha,{"data-icon":`inline-start`}),e(`settings.addModel`)]})]})]},n)),(0,H.jsxs)(K,{variant:`outline`,onClick:()=>r(e=>({...e,providers:[...e.providers??[],hk()]})),children:[(0,H.jsx)(ha,{"data-icon":`inline-start`}),e(`settings.addProvider`)]})]})}),(0,H.jsx)(`datalist`,{id:`ringko-provider-types`,children:mk.map(e=>(0,H.jsx)(`option`,{value:e},e))})]})}function _k(){let{t:e}=Nb(),[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(!1),d=(0,y.useCallback)(()=>{Cy().then(n).catch(e=>B.error(e instanceof Error?e.message:String(e)))},[]);(0,y.useEffect)(d,[d]);async function f(){let t=r.trim();if(t.length!==0){u(!0);try{let r=await wy({name:t,...a.trim().length>0?{description:a.trim()}:{},...s.length>0?{body:s}:{}});n(r),i(``),o(``),c(``),B.success(e(`skills.created`))}catch(e){B.error(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){try{n(await Ty(t)),B.success(e(`skills.removed`))}catch(e){B.error(e instanceof Error?e.message:String(e))}}function m(n){let r=t.filter(e=>e.scope===n);return(0,H.jsxs)(KO,{children:[(0,H.jsxs)(qO,{className:`flex-row items-center gap-2`,children:[(0,H.jsx)(JO,{className:`text-sm`,children:e(n===`project`?`skills.project`:`skills.global`)}),(0,H.jsx)(GO,{variant:`outline`,children:r.length})]}),(0,H.jsx)(XO,{className:`space-y-2`,children:r.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`skills.empty`)}):r.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,H.jsx)(GO,{variant:`outline`,children:e.source})]}),e.description?(0,H.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.description}):null,(0,H.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.dir})]}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,onClick:()=>void p(e.dir),children:(0,H.jsx)(Ua,{})})]},e.dir))})]})}return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:e(`settings.skills`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`skills.hint`)})]}),(0,H.jsxs)(KO,{children:[(0,H.jsx)(qO,{children:(0,H.jsx)(JO,{className:`text-sm`,children:e(`skills.create`)})}),(0,H.jsxs)(XO,{className:`space-y-2`,children:[(0,H.jsx)(Sb,{value:r,onChange:e=>i(e.target.value),placeholder:e(`skills.name`)}),(0,H.jsx)(Sb,{value:a,onChange:e=>o(e.target.value),placeholder:e(`skills.description`)}),(0,H.jsx)(ZO,{value:s,onChange:e=>c(e.target.value),placeholder:e(`skills.body`),className:`min-h-24 font-mono text-xs`}),(0,H.jsxs)(K,{size:`sm`,onClick:()=>void f(),disabled:l||r.trim().length===0,children:[(0,H.jsx)(ha,{"data-icon":`inline-start`}),e(`skills.create`)]})]})]}),m(`project`),m(`global`)]})}var vk={name:`RingKo`,version:`0.1.0`,repo:`https://github.com/RingKoAI/ringko-harness`},yk=[{slug:`general`,label:`settings.general`},{slug:`projects`,label:`settings.projects`},{slug:`providers`,label:`settings.providers`},{slug:`oauth`,label:`settings.oauth`},{slug:`models`,label:`settings.models`},{slug:`connectors`,label:`settings.connectors`},{slug:`skills`,label:`settings.skills`},{slug:`permissions`,label:`settings.permissions`},{slug:`about`,label:`settings.about`}];function bk({label:e,children:t}){return(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-3`,children:[(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e}),(0,H.jsx)(`span`,{className:`text-sm`,children:t})]})}function xk(){let{t:e,locale:t,setLocale:n}=Nb(),{theme:r,setTheme:i}=E(),a=Hb();return(0,H.jsxs)(KO,{children:[(0,H.jsx)(qO,{children:(0,H.jsx)(JO,{children:e(`settings.general`)})}),(0,H.jsxs)(XO,{className:`divide-y`,children:[(0,H.jsx)(bk,{label:e(`settings.workspace`),children:(0,H.jsx)(`span`,{className:`font-mono text-xs`,children:a.info?.workspace??`—`})}),(0,H.jsx)(bk,{label:e(`settings.access`),children:a.info?.access.label??`—`}),(0,H.jsx)(bk,{label:e(`settings.authRequired`),children:(0,H.jsx)(GO,{variant:a.info?.auth.required?`default`:`secondary`,children:a.info?.auth.required?e(`settings.authOn`):e(`settings.authOff`)})}),(0,H.jsx)(bk,{label:e(`theme.toggle`),children:(0,H.jsx)(`div`,{className:`flex gap-2`,children:[{value:`light`,label:`theme.light`},{value:`dark`,label:`theme.dark`},{value:`system`,label:`theme.system`}].map(t=>(0,H.jsx)(K,{size:`sm`,variant:r===t.value?`default`:`outline`,onClick:()=>i(t.value),children:e(t.label)},t.value))})}),(0,H.jsx)(bk,{label:e(`language.toggle`),children:(0,H.jsx)(`div`,{className:`flex gap-2`,children:Db.map(e=>(0,H.jsx)(K,{size:`sm`,variant:t===e.value?`default`:`outline`,onClick:()=>n(e.value),children:e.label},e.value))})})]})]})}function Sk(){let{t:e}=Nb(),t=Hb(),n=t.info?.providers??[],r=t.info?.modelId??``;function i(n){n!==r&&Jy(n).then(()=>{t.refreshInfo(),B.success(e(`model.switched`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))}return(0,H.jsxs)(KO,{children:[(0,H.jsx)(qO,{children:(0,H.jsx)(JO,{children:e(`settings.models`)})}),(0,H.jsx)(XO,{className:`space-y-3`,children:n.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`settings.noProviders`)}):n.map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,H.jsx)(GO,{variant:`secondary`,children:e.type??`—`})]}),(0,H.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.models.map(t=>{let n=`${e.name}/${t}`;return(0,H.jsx)(K,{size:`sm`,variant:n===r?`default`:`outline`,className:`font-mono text-xs`,onClick:()=>i(n),children:t},n)})})]},e.name))})]})}function Ck(){let{t:e}=Nb(),t=Hb().info?.workspace,[n,r]=(0,y.useState)([]),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!0;return r([]),a(null),s(null),d(null),Iv().then(t=>{e&&(r(t.rules),a(t.workspace))}).catch(t=>{e&&d(t instanceof Error?t.message:String(t))}),()=>{e=!1}},[t]);async function f(n){if(!i||i!==t){d(e(`permissions.workspaceChanged`));return}l(!0);try{await Lv(i,n),r(e=>e.filter(e=>e.tool!==n.tool||e.target!==n.target||e.behavior!==n.behavior)),s(null),d(null),B.success(e(`permissions.removed`))}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}}return(0,H.jsxs)(KO,{children:[(0,H.jsx)(qO,{children:(0,H.jsx)(JO,{children:e(`settings.permissions`)})}),(0,H.jsxs)(XO,{className:`space-y-3`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`permissions.hint`)}),u&&(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:u}),i&&!n.length&&!u&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`permissions.empty`)}),n.map(t=>(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border p-3`,children:[(0,H.jsx)(GO,{variant:`secondary`,children:t.behavior}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 break-all font-mono text-xs`,children:[(0,H.jsx)(`span`,{children:t.tool}),t.target!==void 0&&(0,H.jsx)(`div`,{className:`text-muted-foreground`,children:t.target})]}),o?.tool===t.tool&&o.target===t.target&&o.behavior===t.behavior?(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(K,{size:`sm`,variant:`destructive`,disabled:c,onClick:()=>void f(t),children:e(`permissions.confirm`)}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,disabled:c,onClick:()=>s(null),children:e(`permissions.cancel`)})]}):(0,H.jsx)(K,{size:`sm`,variant:`outline`,disabled:c,onClick:()=>s(t),children:e(`permissions.remove`)})]},`${t.behavior}\0${t.tool}\0${t.target??``}`))]})]})}function wk(){let{t:e}=Nb();return(0,H.jsxs)(KO,{children:[(0,H.jsx)(qO,{children:(0,H.jsx)(JO,{children:e(`settings.about`)})}),(0,H.jsxs)(XO,{className:`divide-y`,children:[(0,H.jsx)(bk,{label:e(`settings.version`),children:vk.version}),(0,H.jsx)(bk,{label:e(`nav.settings`),children:(0,H.jsx)(`a`,{href:vk.repo,className:`text-primary hover:underline`,target:`_blank`,rel:`noreferrer`,children:vk.repo.replace(/^https?:\/\//,``)})})]})]})}function Tk({page:e,onNavigate:t}){let{t:n}=Nb(),r=yk.some(t=>t.slug===e)?e:`general`,i=r===`projects`?(0,H.jsx)(fk,{}):r===`providers`?(0,H.jsx)(gk,{}):r===`oauth`?(0,H.jsx)(dk,{}):r===`models`?(0,H.jsx)(Sk,{}):r===`connectors`?(0,H.jsx)(ik,{}):r===`skills`?(0,H.jsx)(_k,{}):r===`permissions`?(0,H.jsx)(Ck,{}):r===`about`?(0,H.jsx)(wk,{}):(0,H.jsx)(xk,{});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col sm:flex-row`,children:[(0,H.jsx)(`nav`,{"aria-label":n(`settings.title`),className:`flex shrink-0 gap-1 overflow-x-auto border-b p-2 pr-12 sm:w-44 sm:flex-col sm:overflow-x-hidden sm:overflow-y-auto sm:border-r sm:border-b-0 sm:pr-2`,children:yk.map(e=>(0,H.jsx)(K,{variant:`ghost`,size:`sm`,"aria-current":r===e.slug?`page`:void 0,className:W(`shrink-0 justify-start`,r===e.slug&&`bg-accent text-accent-foreground`),onClick:()=>t(e.slug),children:n(e.label)},e.slug))}),(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`div`,{className:`flex h-10 shrink-0 items-center border-b px-4 text-sm font-medium`,children:n(`settings.title`)}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-4xl`,children:i})})]})]})}function Ek({children:e}){let{t}=Nb(),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(`general`);return(0,H.jsxs)(mb,{open:n,onOpenChange:r,children:[(0,H.jsx)(hb,{asChild:!0,children:e}),(0,H.jsxs)(vb,{className:`h-[min(52rem,calc(100dvh-2rem))] w-[calc(100vw-2rem)]! max-w-[72rem]! gap-0 overflow-hidden p-0 sm:max-w-[72rem]!`,children:[(0,H.jsx)(xb,{className:`sr-only`,children:t(`settings.title`)}),(0,H.jsx)(Tk,{page:i,onNavigate:a})]})]})}function Dk({...e}){return(0,H.jsx)(fg,{"data-slot":`dropdown-menu`,...e})}function Ok({...e}){return(0,H.jsx)(pg,{"data-slot":`dropdown-menu-trigger`,...e})}function kk({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,H.jsx)(mg,{children:(0,H.jsx)(hg,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:W(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function Ak({className:e,inset:t,variant:n=`default`,...r}){return(0,H.jsx)(gg,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:W(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function jk({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(B_,{"data-slot":`separator`,decorative:n,orientation:t,className:W(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}var Mk=768;function Nk(){let[e,t]=y.useState(void 0);return y.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Mk)};return e.addEventListener(`change`,n),t(window.innerWidth<Mk),()=>e.removeEventListener(`change`,n)},[]),!!e}function Pk({...e}){return(0,H.jsx)(Ru,{"data-slot":`sheet`,...e})}function Fk({...e}){return(0,H.jsx)(Wu,{"data-slot":`sheet-portal`,...e})}function Ik({className:e,...t}){return(0,H.jsx)(Ku,{"data-slot":`sheet-overlay`,className:W(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Lk({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,H.jsxs)(Fk,{children:[(0,H.jsx)(Ik,{}),(0,H.jsxs)(Xu,{"data-slot":`sheet-content`,"data-side":n,className:W(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,H.jsx)(ad,{"data-slot":`sheet-close`,asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,H.jsx)(Za,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function Rk({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`sheet-header`,className:W(`flex flex-col gap-0.5 p-4`,e),...t})}function zk({className:e,...t}){return(0,H.jsx)(td,{"data-slot":`sheet-title`,className:W(`font-heading text-base font-medium text-foreground`,e),...t})}function Bk({className:e,...t}){return(0,H.jsx)(rd,{"data-slot":`sheet-description`,className:W(`text-sm text-muted-foreground`,e),...t})}var Vk=`sidebar_state`,Hk=604800,Uk=`16rem`,Wk=`18rem`,Gk=`3rem`,Kk=`b`,qk=y.createContext(null);function Jk(){let e=y.useContext(qk);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Yk({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=Nk(),[c,l]=y.useState(!1),[u,d]=y.useState(e),f=t??u,p=y.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${Vk}=${t}; path=/; max-age=${Hk}`},[n,f]),m=y.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);y.useEffect(()=>{let e=e=>{e.key===Kk&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=y.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,H.jsx)(qk.Provider,{value:g,children:(0,H.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Uk,"--sidebar-width-icon":Gk,...i},className:W(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function Xk({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Jk();return n===`none`?(0,H.jsx)(`div`,{"data-slot":`sidebar`,className:W(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,H.jsx)(Pk,{open:l,onOpenChange:u,...o,children:(0,H.jsxs)(Lk,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Wk},side:e,children:[(0,H.jsxs)(Rk,{className:`sr-only`,children:[(0,H.jsx)(zk,{children:`Sidebar`}),(0,H.jsx)(Bk,{children:`Displays the mobile sidebar.`})]}),(0,H.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,H.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,H.jsx)(`div`,{"data-slot":`sidebar-gap`,className:W(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,H.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:W(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,H.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Zk({className:e,onClick:t,...n}){let{toggleSidebar:r}=Jk();return(0,H.jsxs)(K,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:W(e),onClick:e=>{t?.(e),r()},...n,children:[(0,H.jsx)(aa,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Qk({className:e,...t}){return(0,H.jsx)(`main`,{"data-slot":`sidebar-inset`,className:W(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function $k({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:W(`flex flex-col gap-2 p-2`,e),...t})}function eA({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:W(`flex flex-col gap-2 p-2`,e),...t})}function tA({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:W(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-x-hidden group-data-[collapsible=icon]:overflow-y-auto`,e),...t})}function nA({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:W(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function rA({className:e,asChild:t=!1,...n}){let r=t?ts:`div`;return(0,H.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:W(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e),...n})}function iA({className:e,...t}){return(0,H.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:W(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function aA({className:e,...t}){return(0,H.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:W(`group/menu-item relative`,e),...t})}var oA=nb(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function sA({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?ts:`button`,{isMobile:c,state:l}=Jk(),u=(0,H.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:W(oA({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,H.jsxs)(Dv,{children:[(0,H.jsx)(Ov,{asChild:!0,children:u}),(0,H.jsx)(kv,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function cA({className:e,asChild:t=!1,showOnHover:n=!1,...r}){let i=t?ts:`button`;return(0,H.jsx)(i,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:W(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,e),...r})}function lA(e){let t=Math.round((Date.now()-e)/6e4);if(t<1)return`now`;if(t<60)return`${t}m`;let n=Math.round(t/60);return n<24?`${n}h`:`${Math.round(n/24)}d`}function uA(){let{t:e}=Nb(),t=Hb(),n=Ot(),r=Tt(),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(``),[g,_]=(0,y.useState)(!1),[v,b]=(0,y.useState)(null),[x,S]=(0,y.useState)(!1),[C,w]=(0,y.useState)(!1),[T,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(`files`),k=t.info?.auth.required===!0&&Qv()===null,A=(0,y.useCallback)(()=>{t.info===null||k||gy().then(e=>{b(e),w(!1)}).catch(e=>{w(!0),B.error(e instanceof Error?e.message:String(e))})},[t.info,k]);if((0,y.useEffect)(A,[A]),(0,y.useEffect)(()=>{t.unauthorized&&n(`/auth/login`)},[t.unauthorized,n]),k&&r.pathname!==`/auth/login`)return(0,H.jsx)(tn,{to:`/auth/login`,replace:!0});let j=t.sessions.filter(e=>i||!e.archived);function M(e){O(e),E(!0)}async function N(e){try{await e(),t.refreshInfo(),t.refreshSessions()}catch(e){B.error(e instanceof Error?e.message:String(e))}}function P(){_(!0)}function F(e){_(!1),p(e),h(e.split(/[\\/]/).filter(Boolean).pop()??``)}async function I(){let r=(f??``).trim();if(r.length===0)return;let i=m.trim();p(null);try{let a=await Oy(r,i.length>0?i:void 0);b(a),t.clearSession(),t.refreshInfo(),t.refreshSessions(),n(`/`),B.success(e(`projects.added`))}catch(e){B.error(e instanceof Error?e.message:String(e))}}async function ee(r){if(!(r===v?.current||x)){S(!0);try{b(await Ay(r)),t.clearSession(),t.refreshInfo(),t.refreshSessions(),n(`/`),B.success(e(`projects.switched`))}catch(e){B.error(e instanceof Error?e.message:String(e))}finally{S(!1)}}}function L(){let e=o,t=c.trim();e&&t.length!==0&&(s(null),N(()=>fy(e.id,t)))}function te(){let e=u;e&&(d(null),N(async()=>{await my(e),t.sessionId===e&&t.clearSession()}))}async function ne(r){try{let{sessionId:i}=await iy(r);t.refreshSessions(),t.openSession(i),n(`/${i}`),B.success(e(`session.forked`))}catch(e){B.error(e instanceof Error?e.message:String(e))}}return(0,H.jsxs)(Yk,{children:[(0,H.jsxs)(Xk,{collapsible:`icon`,children:[(0,H.jsxs)($k,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 group-data-[collapsible=icon]:justify-center`,children:[(0,H.jsx)(iA,{className:`min-w-0 flex-1 group-data-[collapsible=icon]:hidden`,children:(0,H.jsx)(aA,{children:(0,H.jsxs)(sA,{size:`lg`,onClick:()=>{t.newChat(),n(`/`)},children:[(0,H.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-primary text-primary-foreground`,children:`R`}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 leading-none`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e(`app.name`)}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.info?.model??e(`header.noModel`)})]})]})})}),(0,H.jsx)(Zk,{className:`shrink-0`})]}),(0,H.jsxs)(iA,{children:[(0,H.jsx)(aA,{children:(0,H.jsxs)(sA,{tooltip:e(`sidebar.new`),onClick:()=>{t.newChat(),n(`/`)},children:[(0,H.jsx)(ha,{}),(0,H.jsx)(`span`,{children:e(`sidebar.new`)})]})}),(0,H.jsx)(aA,{children:(0,H.jsxs)(sA,{tooltip:e(`projects.add`),onClick:()=>void P(),children:[(0,H.jsx)(Fi,{}),(0,H.jsx)(`span`,{children:e(`projects.add`)})]})})]})]}),(0,H.jsxs)(tA,{children:[(0,H.jsxs)(nA,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between pr-1`,children:[(0,H.jsx)(rA,{children:e(`settings.projects`)}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-6 group-data-[collapsible=icon]:hidden`,title:e(`projects.add`),onClick:()=>void P(),children:(0,H.jsx)(Fi,{className:`size-3.5`})})]}),(0,H.jsx)(iA,{children:C?(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`h-auto justify-start px-2 py-2 text-xs text-destructive`,onClick:A,children:[e(`projects.loadFailed`),` · `,e(`settings.reload`)]}):v?v.projects.length===0?(0,H.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:e(`projects.empty`)}):v.projects.map(e=>(0,H.jsx)(aA,{children:(0,H.jsxs)(sA,{isActive:e.id===v.current,disabled:x,title:e.path,tooltip:`${e.name} · ${e.path}`,onClick:()=>void ee(e.id),children:[(0,H.jsx)(Li,{}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 group-data-[collapsible=icon]:hidden`,children:[(0,H.jsx)(`span`,{className:`block truncate text-xs`,children:e.name}),(0,H.jsx)(`span`,{className:`block truncate text-[10px] text-muted-foreground`,children:e.path})]})]})},e.id)):(0,H.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:e(`projects.loading`)})})]}),(0,H.jsxs)(nA,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between pr-1`,children:[(0,H.jsx)(rA,{children:e(`sidebar.sessions`)}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-6 group-data-[collapsible=icon]:hidden`,title:e(i?`session.hideArchived`:`session.showArchived`),onClick:()=>a(e=>!e),children:(0,H.jsx)(Zr,{className:`size-3.5`})})]}),(0,H.jsx)(iA,{children:j.length===0?(0,H.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:e(`sidebar.empty`)}):j.map(i=>(0,H.jsxs)(aA,{children:[(0,H.jsxs)(sA,{isActive:i.id===t.sessionId&&r.pathname===`/`,className:i.archived?`opacity-60`:void 0,tooltip:i.title??e(`sidebar.untitled`),onClick:()=>{t.openSession(i.id),n(`/${i.id}`)},children:[(0,H.jsx)($i,{}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 group-data-[collapsible=icon]:hidden`,children:[(0,H.jsxs)(`span`,{className:`block truncate text-xs`,children:[i.title??e(`sidebar.untitled`),t.runningSessions.includes(i.id)?(0,H.jsxs)(`span`,{className:`ml-2 text-primary`,children:[` · `,e(`session.running`)]}):null,i.archived?` · ${e(`session.archived`)}`:``]}),(0,H.jsx)(`span`,{className:`block truncate text-[10px] text-muted-foreground`,title:i.summary??void 0,children:i.summary?i.summary:lA(i.createdAt)})]})]}),(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsx)(cA,{showOnHover:!0,title:e(`session.actions`),children:(0,H.jsx)(Di,{})})}),(0,H.jsxs)(kk,{side:`right`,align:`start`,children:[(0,H.jsxs)(Ak,{onClick:()=>{s(i),l(i.title??``)},children:[(0,H.jsx)(da,{}),e(`session.rename`)]}),(0,H.jsxs)(Ak,{onClick:()=>void ne(i.id),children:[(0,H.jsx)(zi,{}),e(`session.fork`)]}),(0,H.jsxs)(Ak,{onClick:()=>void N(()=>py(i.id,!i.archived)),children:[i.archived?(0,H.jsx)(Yr,{}):(0,H.jsx)(Zr,{}),i.archived?e(`session.unarchive`):e(`session.archive`)]}),(0,H.jsxs)(Ak,{variant:`destructive`,onClick:()=>d(i.id),children:[(0,H.jsx)(Ua,{}),e(`session.delete`)]})]})]})]},i.id))})]})]}),(0,H.jsxs)(eA,{children:[(0,H.jsxs)(iA,{children:[(0,H.jsx)(aA,{children:(0,H.jsx)(sA,{asChild:!0,isActive:r.pathname===`/`,tooltip:e(`nav.chat`),children:(0,H.jsxs)(Kn,{to:`/`,children:[(0,H.jsx)($i,{}),(0,H.jsx)(`span`,{children:e(`nav.chat`)})]})})}),(0,H.jsx)(aA,{children:(0,H.jsx)(Ek,{children:(0,H.jsxs)(sA,{tooltip:e(`nav.settings`),children:[(0,H.jsx)(Ca,{}),(0,H.jsx)(`span`,{children:e(`nav.settings`)})]})})})]}),(0,H.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2 rounded-md px-2 text-xs text-muted-foreground group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0`,title:t.info?`${e(`header.tools`,{count:t.info.tools.length})} · ${t.info.access.label}`:void 0,children:[(0,H.jsx)(Ya,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate group-data-[collapsible=icon]:hidden`,children:t.info?`${e(`header.tools`,{count:t.info.tools.length})} · ${t.info.access.label}`:``})]})]})]}),(0,H.jsxs)(Qk,{className:`flex h-svh min-w-0 flex-col overflow-hidden`,children:[(0,H.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-2 border-b px-4`,children:[(0,H.jsx)(jk,{orientation:`vertical`,className:`mr-1 h-4`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(Li,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:t.info?.project?`${t.info.project.name} · ${t.info.workspace}`:t.info?.workspace??``})]}),(0,H.jsx)(K,{className:`ml-auto`,variant:T?`secondary`:`ghost`,size:`icon-sm`,"aria-label":e(T?`rightSidebar.close`:`rightSidebar.title`),"aria-expanded":T,title:e(T?`rightSidebar.close`:`rightSidebar.title`),onClick:()=>E(e=>!e),children:(0,H.jsx)(sa,{})})]}),(0,H.jsx)(nn,{context:{openRightSidebar:M}})]}),(0,H.jsx)(UO,{open:T,tab:D,onTabChange:O,onClose:()=>E(!1)}),(0,H.jsx)(ib,{open:t.approval!==null,children:(0,H.jsxs)(sb,{children:[(0,H.jsxs)(cb,{children:[(0,H.jsx)(ub,{children:e(`approval.title`,{tool:t.approval?.toolName??``})}),(0,H.jsx)(db,{children:t.approval?.reason})]}),(0,H.jsxs)(lb,{children:[(0,H.jsx)(pb,{onClick:()=>t.decide(!1),children:e(`approval.deny`)}),(0,H.jsx)(fb,{onClick:()=>t.decide(!0),children:e(`approval.approve`)}),(0,H.jsx)(fb,{onClick:()=>t.decide(!0,`session`),children:e(`approval.session`)}),(0,H.jsx)(fb,{onClick:()=>t.decide(!0,`saved`),children:e(`approval.saved`)})]})]})}),(0,H.jsx)(mb,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,H.jsxs)(vb,{children:[(0,H.jsx)(yb,{children:(0,H.jsx)(xb,{children:e(`session.renameTitle`)})}),(0,H.jsx)(Sb,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&L()},placeholder:e(`session.titlePlaceholder`),autoFocus:!0}),(0,H.jsxs)(bb,{children:[(0,H.jsx)(K,{variant:`outline`,onClick:()=>s(null),children:e(`common.cancel`)}),(0,H.jsx)(K,{onClick:L,disabled:c.trim().length===0,children:e(`common.save`)})]})]})}),(0,H.jsx)(Pb,{open:g,onOpen:F,onClose:()=>_(!1)}),(0,H.jsx)(mb,{open:f!==null,onOpenChange:e=>{e||p(null)},children:(0,H.jsxs)(vb,{children:[(0,H.jsx)(yb,{children:(0,H.jsx)(xb,{children:e(`projects.addTitle`)})}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Sb,{value:f??``,onChange:e=>p(e.target.value),placeholder:e(`projects.path`),className:`font-mono text-xs`}),(0,H.jsx)(Sb,{value:m,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Enter`&&I()},placeholder:e(`projects.name`),autoFocus:!0})]}),(0,H.jsxs)(bb,{children:[(0,H.jsx)(K,{variant:`outline`,onClick:()=>p(null),children:e(`common.cancel`)}),(0,H.jsx)(K,{onClick:()=>void I(),disabled:(f??``).trim().length===0,children:e(`common.save`)})]})]})}),(0,H.jsx)(ib,{open:u!==null,onOpenChange:e=>{e||d(null)},children:(0,H.jsxs)(sb,{children:[(0,H.jsxs)(cb,{children:[(0,H.jsx)(ub,{children:e(`session.deleteTitle`)}),(0,H.jsx)(db,{children:e(`session.deleteDesc`)})]}),(0,H.jsxs)(lb,{children:[(0,H.jsx)(pb,{children:e(`common.cancel`)}),(0,H.jsx)(fb,{onClick:te,children:e(`session.delete`)})]})]})})]})}function dA(e=new Date){let t=e.getHours();return t>=5&&t<11?`morning`:t>=11&&t<14?`noon`:t>=14&&t<17?`afternoon`:t>=17&&t<19?`dusk`:`evening`}var fA=6e4;function pA(){let{t:e}=Nb(),[t,n]=(0,y.useState)(()=>dA());return(0,y.useEffect)(()=>{let e=()=>n(dA()),t=window.setInterval(e,fA);return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.clearInterval(t),window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[]),(0,H.jsx)(`h1`,{className:`text-xl font-medium tracking-tight sm:text-2xl`,children:e(`chat.greeting.${t}`)})}var mA=[{value:`approval`,label:`access.approval`,description:`access.approval.desc`},{value:`assist`,label:`access.assist`,description:`access.assist.desc`},{value:`full`,label:`access.full`,description:`access.full.desc`}];function hA(){let{t:e}=Nb(),t=Hb(),n=t.info?.accessMode??`approval`,r=mA.find(e=>e.value===n)?.label??`access.approval`;function i(r){r!==n&&Uy(r).then(()=>{t.refreshInfo(),B.success(e(`access.changed`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))}return(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`gap-1.5 text-muted-foreground`,title:e(`access.title`),children:[(0,H.jsx)(Ta,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e(r)})]})}),(0,H.jsx)(kk,{align:`start`,side:`top`,className:`w-72`,children:mA.map(t=>(0,H.jsxs)(Ak,{className:`items-start gap-2`,onClick:()=>i(t.value),children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`text-sm`,children:e(t.label)}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(t.description)})]}),t.value===n?(0,H.jsx)(ai,{className:`mt-0.5 ml-auto size-3.5 shrink-0`}):null]},t.value))})]})}function gA(){let e=Hb(),{t}=Nb(),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(``);return e.queue.length?(0,H.jsxs)(`section`,{"aria-label":t(`queue.title`),className:`mx-auto mb-3 max-w-3xl rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(qi,{className:`size-4`}),(0,H.jsxs)(`span`,{className:`flex-1`,children:[t(`queue.title`),` · `,e.queue.length]}),e.busy?null:(0,H.jsxs)(K,{size:`sm`,variant:`outline`,onClick:e.resumeQueue,children:[(0,H.jsx)(pa,{}),t(`queue.resume`)]})]}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t(`queue.hint`)}),(0,H.jsx)(`ol`,{className:`mt-2 max-h-48 space-y-2 overflow-auto`,children:e.queue.map(o=>(0,H.jsxs)(`li`,{className:`flex items-start gap-2 border-t pt-2`,children:[n===o.id?(0,H.jsx)(ZO,{"aria-label":t(`queue.edit`),value:i,onChange:e=>a(e.target.value),maxLength:65536}):(0,H.jsxs)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-sm`,children:[o.prompt,o.attachments.length?(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:t(`queue.attachments`,{count:o.attachments.length})}):null]}),n===o.id?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{variant:`ghost`,size:`icon`,"aria-label":t(`queue.save`),disabled:!i.trim(),onClick:()=>{e.editQueued(o.id,i),r(null)},children:(0,H.jsx)(ai,{})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,"aria-label":t(`queue.cancel`),onClick:()=>r(null),children:(0,H.jsx)(Za,{})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{variant:`ghost`,size:`icon`,"aria-label":t(`queue.edit`),onClick:()=>{r(o.id),a(o.prompt)},children:(0,H.jsx)(da,{})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,"aria-label":t(`queue.remove`),onClick:()=>e.removeQueued(o.id),children:(0,H.jsx)(Ua,{})})]})]},o.id))})]}):null}function _A(){let{t:e}=Nb(),t=Hb(),n=t.info?.mode?.id??`agent`,r=t.info?.workflows??[],i=t.info?.mode?.label??n;function a(r){r!==n&&Hy(r).then(()=>{t.refreshInfo(),B.success(e(`mode.changed`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))}return(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`gap-1.5 text-muted-foreground`,title:e(`mode.title`),children:[(0,H.jsx)(yi,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:i})]})}),(0,H.jsx)(kk,{align:`start`,side:`top`,className:`w-72`,children:r.map(e=>(0,H.jsxs)(Ak,{className:`items-start gap-2`,onClick:()=>a(e.id),children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`text-sm`,children:e.label}),e.description?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description}):null]}),e.id===n?(0,H.jsx)(ai,{className:`mt-0.5 ml-auto size-3.5 shrink-0`}):null]},e.id))})]})}var vA=24,yA=3;function bA({used:e,limit:t}){let{t:n}=Nb(),r=t>0?Math.min(1,Math.max(0,e/t)):0,i=Math.round(r*100),a=21/2,o=2*Math.PI*a,s=r>=.9?`text-red-500`:r>=.7?`text-amber-500`:`text-primary`,c=n(`context.usage`,{used:e,limit:t,percent:i});return(0,H.jsxs)(Dv,{children:[(0,H.jsx)(Ov,{asChild:!0,children:(0,H.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center`,"aria-label":c,title:c,children:(0,H.jsxs)(`svg`,{width:vA,height:vA,viewBox:`0 0 ${vA} ${vA}`,className:`-rotate-90`,children:[(0,H.jsx)(`circle`,{cx:vA/2,cy:vA/2,r:a,strokeWidth:yA,className:`fill-none stroke-muted`}),(0,H.jsx)(`circle`,{cx:vA/2,cy:vA/2,r:a,strokeWidth:yA,strokeLinecap:`round`,className:W(`fill-none transition-[stroke-dashoffset]`,s),stroke:`currentColor`,strokeDasharray:o,strokeDashoffset:o*(1-r)})]})})}),(0,H.jsx)(kv,{children:c})]})}function xA({used:e,limit:t}){let{t:n}=Nb(),r=t>0?Math.min(1,Math.max(0,e/t)):0,i=Math.round(r*100);return(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(bA,{used:e,limit:t}),(0,H.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,title:n(`context.usage`,{used:e,limit:t,percent:i}),children:[i,`%`]})]})}function SA(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var CA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TA={};function EA(e,t){return((t||TA).jsx?wA:CA).test(e)}var DA=/[ \t\n\f\r]/g;function OA(e){return typeof e==`object`?e.type===`text`&&kA(e.value):kA(e)}function kA(e){return e.replace(DA,``)===``}var AA=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};AA.prototype.normal={},AA.prototype.property={},AA.prototype.space=void 0;function jA(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new AA(n,r,t)}function MA(e){return e.toLowerCase()}var NA=class{constructor(e,t){this.attribute=t,this.property=e}};NA.prototype.attribute=``,NA.prototype.booleanish=!1,NA.prototype.boolean=!1,NA.prototype.commaOrSpaceSeparated=!1,NA.prototype.commaSeparated=!1,NA.prototype.defined=!1,NA.prototype.mustUseProperty=!1,NA.prototype.number=!1,NA.prototype.overloadedBoolean=!1,NA.prototype.property=``,NA.prototype.spaceSeparated=!1,NA.prototype.space=void 0;var PA=s({boolean:()=>Z,booleanish:()=>IA,commaOrSpaceSeparated:()=>BA,commaSeparated:()=>zA,number:()=>Q,overloadedBoolean:()=>LA,spaceSeparated:()=>RA}),FA=0,Z=VA(),IA=VA(),LA=VA(),Q=VA(),RA=VA(),zA=VA(),BA=VA();function VA(){return 2**++FA}var HA=Object.keys(PA),UA=class extends NA{constructor(e,t,n,r){let i=-1;if(super(e,t),WA(this,`space`,r),typeof n==`number`)for(;++i<HA.length;){let e=HA[i];WA(this,HA[i],(n&PA[e])===PA[e])}}};UA.prototype.defined=!0;function WA(e,t,n){n&&(e[t]=n)}function GA(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new UA(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[MA(r)]=r,n[MA(a.attribute)]=r}return new AA(t,n,e.space)}var KA=GA({properties:{ariaActiveDescendant:null,ariaAtomic:IA,ariaAutoComplete:null,ariaBusy:IA,ariaChecked:IA,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:RA,ariaCurrent:null,ariaDescribedBy:RA,ariaDetails:null,ariaDisabled:IA,ariaDropEffect:RA,ariaErrorMessage:null,ariaExpanded:IA,ariaFlowTo:RA,ariaGrabbed:IA,ariaHasPopup:null,ariaHidden:IA,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:RA,ariaLevel:Q,ariaLive:null,ariaModal:IA,ariaMultiLine:IA,ariaMultiSelectable:IA,ariaOrientation:null,ariaOwns:RA,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:IA,ariaReadOnly:IA,ariaRelevant:null,ariaRequired:IA,ariaRoleDescription:RA,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:IA,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function qA(e,t){return t in e?e[t]:t}function JA(e,t){return qA(e,t.toLowerCase())}var YA=GA({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:zA,acceptCharset:RA,accessKey:RA,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:RA,autoFocus:Z,autoPlay:Z,blocking:RA,capture:null,charSet:null,checked:Z,cite:null,className:RA,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:IA,controls:Z,controlsList:RA,coords:Q|zA,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:LA,draggable:IA,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:RA,height:Q,hidden:LA,high:Q,href:null,hrefLang:null,htmlFor:RA,httpEquiv:RA,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:RA,itemRef:RA,itemScope:Z,itemType:RA,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:RA,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:RA,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:RA,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:IA,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:IA,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:RA,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:IA,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:zA,part:RA,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:JA}),XA=GA({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:BA,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:RA,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zA,g2:zA,glyphName:zA,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:BA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:RA,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:BA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:BA,rev:BA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:BA,requiredFeatures:BA,requiredFonts:BA,requiredFormats:BA,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:BA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:BA,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:BA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:qA}),ZA=GA({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),QA=GA({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:JA}),$A=GA({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ej={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},tj=/[A-Z]/g,nj=/-[a-z]/g,rj=/^data[-\w.:]+$/i;function ij(e,t){let n=MA(t),r=t,i=NA;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&rj.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(nj,oj);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!nj.test(e)){let n=e.replace(tj,aj);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=UA}return new i(r,t)}function aj(e){return`-`+e.toLowerCase()}function oj(e){return e.charAt(1).toUpperCase()}var sj=jA([KA,YA,ZA,QA,$A],`html`),cj=jA([KA,XA,ZA,QA,$A],`svg`);function lj(e){return e.join(` `).trim()}var uj=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
71
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),dj=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(uj());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),fj=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),pj=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(dj()),r=fj();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),mj=gj(`end`),hj=gj(`start`);function gj(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function _j(e){let t=hj(e),n=mj(e);if(t&&n)return{start:t,end:n}}function vj(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?bj(e.position):`start`in e||`end`in e?bj(e):`line`in e||`column`in e?yj(e):``}function yj(e){return xj(e&&e.line)+`:`+xj(e&&e.column)}function bj(e){return yj(e&&e.start)+`-`+yj(e&&e.end)}function xj(e){return e&&typeof e==`number`?e:1}var Sj=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=vj(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Sj.prototype.file=``,Sj.prototype.name=``,Sj.prototype.reason=``,Sj.prototype.message=``,Sj.prototype.stack=``,Sj.prototype.column=void 0,Sj.prototype.line=void 0,Sj.prototype.ancestors=void 0,Sj.prototype.cause=void 0,Sj.prototype.fatal=void 0,Sj.prototype.place=void 0,Sj.prototype.ruleId=void 0,Sj.prototype.source=void 0;var Cj=l(pj(),1),wj={}.hasOwnProperty,Tj=new Map,Ej=/[A-Z]/g,Dj=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Oj=new Set([`td`,`th`]),kj=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Aj(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Vj(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Bj(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?cj:sj,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=jj(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function jj(e,t,n){if(t.type===`element`)return Mj(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Nj(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Fj(e,t,n);if(t.type===`mdxjsEsm`)return Pj(e,t);if(t.type===`root`)return Ij(e,t,n);if(t.type===`text`)return Lj(e,t)}function Mj(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=cj,e.schema=i),e.ancestors.push(t);let a=qj(e,t.tagName,!1),o=Hj(e,t),s=Wj(e,t);return Dj.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!OA(e)})),Rj(e,o,a,t),zj(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Nj(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Jj(e,t.position)}function Pj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jj(e,t.position)}function Fj(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=cj,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:qj(e,t.name,!0),o=Uj(e,t),s=Wj(e,t);return Rj(e,o,a,t),zj(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ij(e,t,n){let r={};return zj(r,Wj(e,t)),e.create(t,e.Fragment,r,n)}function Lj(e,t){return t.value}function Rj(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zj(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Bj(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Vj(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=hj(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Hj(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&wj.call(t.properties,i)){let a=Gj(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Oj.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Uj(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Jj(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Jj(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Wj(e,t){let n=[],r=-1,i=e.passKeys?new Map:Tj;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=jj(e,a,o);s!==void 0&&n.push(s)}return n}function Gj(e,t,n){let r=ij(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?SA(n):lj(n)),r.property===`style`){let t=typeof n==`object`?n:Kj(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Yj(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ej[r.property]||r.property:r.attribute,n]}}function Kj(e,t){try{return(0,Cj.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Sj("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=kj+`#cannot-parse-style-attribute`,r}}function qj(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=EA(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=EA(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return wj.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jj(e)}function Jj(e,t){let n=new Sj("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=kj+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Yj(e){let t={},n;for(n in e)wj.call(e,n)&&(t[Xj(n)]=e[n]);return t}function Xj(e){let t=e.replace(Ej,Zj);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Zj(e){return`-`+e.toLowerCase()}var Qj={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},$j={};function eM(e,t){let n=t||$j;return tM(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function tM(e,t,n){if(rM(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return nM(e.children,t,n)}return Array.isArray(e)?nM(e,t,n):``}function nM(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=tM(e[i],t,n);return r.join(``)}function rM(e){return!!(e&&typeof e==`object`)}var iM=document.createElement(`i`);function aM(e){let t=`&`+e+`;`;iM.innerHTML=t;let n=iM.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function oM(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function sM(e,t){return e.length>0?(oM(e,e.length,0,t),e):t}var cM={}.hasOwnProperty;function lM(e){let t={},n=-1;for(;++n<e.length;)uM(t,e[n]);return t}function uM(e,t){let n;for(n in t){let r=(cM.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){cM.call(r,a)||(r[a]=[]);let e=i[a];dM(r[a],Array.isArray(e)?e:e?[e]:[])}}}function dM(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);oM(e,0,0,r)}function fM(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function pM(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var mM=TM(/[A-Za-z]/),hM=TM(/[\dA-Za-z]/),gM=TM(/[#-'*+\--9=?A-Z^-~]/);function _M(e){return e!==null&&(e<32||e===127)}var vM=TM(/\d/),yM=TM(/[\dA-Fa-f]/),bM=TM(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function xM(e){return e!==null&&(e<0||e===32)}function SM(e){return e===-2||e===-1||e===32}var CM=TM(/\p{P}|\p{S}/u),wM=TM(/\s/);function TM(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function EM(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&hM(e.charCodeAt(n+1))&&hM(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function DM(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return SM(r)?(e.enter(n),s(r)):t(r)}function s(r){return SM(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function OM(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&SM(t)?(e.enter(r),c(t)):l(t)}function c(t){return SM(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var kM={tokenize:AM};function AM(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),DM(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var jM=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){MM(this,e,t,n,!1)}addBefore(e,t,n){MM(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function MM(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var NM={tokenize:FM},PM={tokenize:IM};function FM(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new jM;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(PM,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(PM,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new jM;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function IM(e,t,n){return DM(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function LM(e){if(e===null||xM(e)||wM(e))return 1;if(CM(e))return 2}function RM(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var zM={name:`attention`,resolveAll:BM,tokenize:VM};function BM(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};HM(o,-a),HM(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=sM(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=sM(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=sM(r,RM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=sM(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=sM(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),oM(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function VM(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=LM(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=LM(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function HM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var UM={name:`autolink`,tokenize:WM};function WM(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return mM(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||hM(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||hM(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||_M(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):gM(t)?(e.consume(t),l):n(t)}function u(e){return hM(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||hM(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var GM={partial:!0,tokenize:KM};function KM(e,t,n){return r;function r(t){return SM(t)?DM(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var qM={continuation:{tokenize:YM},exit:XM,name:`blockQuote`,tokenize:JM};function JM(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return SM(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function YM(e,t,n){let r=this;return i;function i(t){return SM(t)?DM(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(qM,t,n)(r)}}function XM(e){e.exit(`blockQuote`)}var ZM={name:`characterEscape`,tokenize:QM};function QM(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return bM(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var $M={name:`characterReference`,tokenize:eN};function eN(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=hM,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=yM,u):(e.enter(`characterReferenceValue`),a=7,o=vM,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===hM&&!aM(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var tN={partial:!0,tokenize:nN};function nN(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var rN={concrete:!0,name:`codeFenced`,tokenize:iN};function iN(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),SM(t)?DM(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(tN,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):SM(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),DM(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&SM(t)?DM(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(tN,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),SM(t)?DM(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),SM(t)?DM(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var aN={name:`codeIndented`,tokenize:sN},oN={partial:!0,tokenize:cN};function sN(e,t,n){return r;function r(t){return e.enter(`codeIndented`),OM(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(oN,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function cN(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):OM(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}var lN={name:`codeText`,previous:dN,resolve:uN,tokenize:fN};function uN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function dN(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function fN(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var pN=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&mN(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),mN(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mN(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);mN(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);mN(this.left,t.reverse())}}}};function mN(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function hN(e){let t={},n=-1,r,i,a,o,s,c,l,u=new pN(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,gN(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return oM(e,0,1/0,u.slice(0)),!l}function gN(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var _N={resolve:yN,tokenize:bN},vN={partial:!0,tokenize:xN};function yN(e){return hN(e),e}function bN(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(vN,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function xN(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),DM(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function SN(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||_M(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||xM(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||_M(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function CN(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!SM(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function wN(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),DM(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function TN(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):SM(i)?DM(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var EN={name:`definition`,tokenize:ON},DN={partial:!0,tokenize:kN};function ON(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return CN.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=pM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return xM(t)?TN(e,l)(t):l(t)}function l(t){return SN(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(DN,d,d)(t)}function d(t){return SM(t)?DM(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function kN(e,t,n){return r;function r(t){return xM(t)?TN(e,i)(t):n(t)}function i(t){return wN(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return SM(t)?DM(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var AN={name:`hardBreakEscape`,tokenize:jN};function jN(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var MN={name:`headingAtx`,resolve:NN,tokenize:PN};function NN(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};oM(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function PN(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||xM(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):SM(n)?DM(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||xM(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var FN=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),IN=[`pre`,`script`,`style`,`textarea`],LN={concrete:!0,name:`htmlFlow`,resolveTo:zN,tokenize:BN},RN={partial:!0,tokenize:VN};function zN(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function BN(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):mM(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):mM(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return mM(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||xM(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&IN.includes(l)?(i=1,r.interrupt?t(s):O(s)):FN.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||hM(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return SM(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||mM(t)?(e.consume(t),b):SM(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||hM(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):SM(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):SM(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||xM(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||SM(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):SM(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(RN,L,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(tN,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return IN.includes(n)?(e.consume(t),ee):O(t)}return mM(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||$(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function VN(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(GM,t,n)}}var HN={name:`htmlText`,tokenize:UN};function UN(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):mM(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):mM(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return mM(t)?(e.consume(t),S):n(t)}function S(t){return t===45||hM(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):SM(t)?(e.consume(t),C):M(t)}function w(t){return t===45||hM(t)?(e.consume(t),w):t===47||t===62||xM(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||mM(t)?(e.consume(t),E):$(t)?(o=T,N(t)):SM(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||hM(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):SM(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):SM(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||xM(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||xM(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return SM(t)?DM(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var WN={name:`labelEnd`,resolveAll:JN,resolveTo:YN,tokenize:XN},GN={tokenize:ZN},KN={tokenize:QN},qN={tokenize:$N};function JN(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&oM(e,0,e.length,n),e}function YN(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=sM(o,e.slice(i+1,i+r+3)),o=sM(o,[[`enter`,l,t]]),o=sM(o,RM(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=sM(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=sM(o,e.slice(a+1)),o=sM(o,[[`exit`,s,t]]),oM(e,i,e.length,o),e}function XN(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(pM(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(GN,u,o?u:d)(t):t===91?e.attempt(KN,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(qN,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function ZN(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return xM(t)?TN(e,a)(t):a(t)}function a(t){return t===41?u(t):SN(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return xM(t)?TN(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?wN(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return xM(t)?TN(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function QN(e,t,n){let r=this;return i;function i(t){return CN.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(pM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function $N(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var eP={name:`labelStartImage`,resolveAll:WN.resolveAll,tokenize:tP};function tP(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var nP={name:`labelStartLink`,resolveAll:WN.resolveAll,tokenize:rP};function rP(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var iP={name:`lineEnding`,tokenize:aP};function aP(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),DM(e,t,`linePrefix`)}}var oP={name:`thematicBreak`,tokenize:sP};function sP(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),SM(t)?DM(e,s,`whitespace`)(t):s(t))}}var cP={continuation:{tokenize:fP},exit:mP,name:`list`,tokenize:dP},lP={partial:!0,tokenize:hP},uP={partial:!0,tokenize:pP};function dP(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:vM(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(oP,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return vM(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(GM,r.interrupt?n:u,e.attempt(lP,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return SM(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function fP(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(GM,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,DM(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!SM(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uP,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,DM(e,e.attempt(cP,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function pP(e,t,n){let r=this;return DM(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function mP(e){e.exit(this.containerState.type)}function hP(e,t,n){let r=this;return DM(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!SM(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var gP={name:`setextUnderline`,resolveTo:_P,tokenize:vP};function _P(e,t){let n=new jM,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function vP(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),SM(t)?DM(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var yP={tokenize:bP};function bP(e){let t=this,n=e.attempt(GM,r,e.attempt(this.parser.constructs.flowInitial,i,DM(e,e.attempt(this.parser.constructs.flow,i,e.attempt(_N,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var xP={resolveAll:TP()},SP=wP(`string`),CP=wP(`text`);function wP(e){return{resolveAll:TP(e===`text`?EP:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function TP(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function EP(e,t){let n=new jM,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var DP=s({attentionMarkers:()=>FP,contentInitial:()=>kP,disable:()=>IP,document:()=>OP,flow:()=>jP,flowInitial:()=>AP,insideSpan:()=>PP,string:()=>MP,text:()=>NP}),OP={42:cP,43:cP,45:cP,48:cP,49:cP,50:cP,51:cP,52:cP,53:cP,54:cP,55:cP,56:cP,57:cP,62:qM},kP={91:EN},AP={[-2]:aN,[-1]:aN,32:aN},jP={35:MN,42:oP,45:[gP,oP],60:LN,61:gP,95:oP,96:rN,126:rN},MP={38:$M,92:ZM},NP={[-5]:iP,[-4]:iP,[-3]:iP,33:eP,38:$M,42:zM,60:[UM,HN],91:nP,92:[AN,ZM],93:WN,95:zM,96:lN},PP={null:[zM,xP]},FP={null:[42,95]},IP={null:[]};function LP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=sM(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=RM(a,l.events,l),l.events):[]}function f(e,t){return zP(p(e),t)}function p(e){return RP(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&oM(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function RP(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function zP(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
72
+ `;break;case-3:o=`\r
73
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function BP(e){let t={constructs:lM([DP,...(e||{}).extensions||[]]),content:n(kM),defined:[],document:n(NM),flow:n(yP),lazy:{},string:n(SP),text:n(CP)};return t;function n(e){return n;function n(n){return LP(t,e,n)}}}function VP(e){for(;!hN(e););return e}var HP=/[\0\t\n\r]/g;function UP(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){HP.lastIndex=c;let n=HP.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var WP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GP(e){return e.replace(WP,KP)}function KP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return fM(n.slice(t?2:1),t?16:10)}return aM(n)||e}var qP={}.hasOwnProperty;function JP(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),YP(n)(VP(BP(n).document().write(UP()(e,t,!0))))}function YP(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(he),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(R),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(z),hardBreakTrailing:a(z),htmlFlow:a(pe,o),htmlFlowData:T,htmlText:a(pe,o),htmlTextData:T,image:a(me),label:o,link:a(he),listItem:a(_e),listItemValue:f,listOrdered:a(ge,d),listUnordered:a(ge),paragraph:a(ve),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(R),strong:a(ye),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ie,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:I,resourceTitleString:ee,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ZP(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];qP.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||$P).call(a,void 0,e[0])}for(r.position={start:XP(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:XP(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:XP(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||$P).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+vj({start:e.start,end:e.end})+`): it’s not open`);n.position.end=XP(e.end)}function u(){return eM(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pM(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=be(),n.position={start:XP(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=XP(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=XP(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=GP(t),n.identifier=pM(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pM(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function re(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=fM(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=aM(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=XP(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function R(){return{type:`heading`,depth:0,children:[]}}function z(){return{type:`break`}}function pe(){return{type:`html`,value:``}}function me(){return{type:`image`,title:null,url:``,alt:null}}function he(){return{type:`link`,title:null,url:``,children:[]}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ve(){return{type:`paragraph`,children:[]}}function ye(){return{type:`strong`,children:[]}}function be(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function XP(e){return{line:e.line,column:e.column,offset:e.offset}}function ZP(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ZP(e,r):QP(e,r)}}function QP(e,t){let n;for(n in t)if(qP.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function $P(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+vj({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vj({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+vj({start:t.start,end:t.end})+`) is still open`)}function eF(e){let t=this;t.parser=n;function n(n){return JP(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function tF(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function nF(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
74
+ `}]}function rF(e,t){let n=t.value?t.value+`
75
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function iF(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aF(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oF(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=EM(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function sF(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cF(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lF(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function uF(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lF(e,t);let i={src:EM(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function dF(e,t){let n={src:EM(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fF(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pF(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lF(e,t);let i={href:EM(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mF(e,t){let n={href:EM(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hF(e,t,n){let r=e.all(t),i=n?gF(n):_F(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
76
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
77
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function gF(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=_F(n[r])}return t}function _F(e){return e.spread??e.children.length>1}function vF(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function yF(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bF(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xF(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SF(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=hj(t.children[1]),o=mj(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function CF(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function wF(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var TF=9,EF=32;function DF(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(OF(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(OF(t.slice(i),i>0,!1)),a.join(``)}function OF(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===TF||t===EF;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===TF||t===EF;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function kF(e,t){let n={type:`text`,value:DF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function AF(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var jF={blockquote:tF,break:nF,code:rF,delete:iF,emphasis:aF,footnoteReference:oF,heading:sF,html:cF,imageReference:uF,image:dF,inlineCode:fF,linkReference:pF,link:mF,listItem:hF,list:vF,paragraph:yF,root:bF,strong:xF,table:SF,tableCell:wF,tableRow:CF,text:kF,thematicBreak:AF,toml:MF,yaml:MF,definition:MF,footnoteDefinition:MF};function MF(){}var{defineProperty:NF}=Object,PF=typeof self==`object`?self:globalThis,FF=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new PF[e](t)},IF=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?NF(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof PF[e]==`function`?FF(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(FF(a,o),i)};return r},LF=e=>IF(new Map,e)(0),RF=``,{toString:zF}={},{keys:BF,is:VF}=Object,HF=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=zF.call(e).slice(8,-1);switch(n){case`Array`:return[1,RF];case`Object`:return[2,RF];case`Date`:return[3,RF];case`RegExp`:return[4,RF];case`Map`:return[5,RF];case`Set`:return[6,RF];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},UF=([e,t])=>e===0&&(t===`function`||t===`symbol`),WF=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=HF(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&VF(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of BF(o))(e||!UF(HF(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?RF:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(UF(HF(n))||UF(HF(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!UF(HF(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},GF=(e,{json:t,lossy:n}={})=>{let r=[];return WF(!(t||n),!!t,new Map,r)(e),r},KF=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?LF(GF(e,t)):structuredClone(e):(e,t)=>LF(GF(e,t));function qF(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function JF(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function YF(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||qF,r=e.options.footnoteBackLabel||JF,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=EM(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...KF(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
78
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
79
+ `}]}}var XF=(function(e){if(e==null)return tI;if(typeof e==`function`)return eI(e);if(typeof e==`object`)return Array.isArray(e)?ZF(e):QF(e);if(typeof e==`string`)return $F(e);throw Error(`Expected function, string, or object as test`)});function ZF(e){let t=[],n=-1;for(;++n<e.length;)t[n]=XF(e[n]);return eI(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function QF(e){let t=e;return eI(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function $F(e){return eI(t);function t(t){return t&&t.type===e}}function eI(e){return t;function t(t,n,r){return!!(nI(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function tI(){return!0}function nI(e){return typeof e==`object`&&!!e&&`type`in e}function rI(e){return e}var iI=[];function aI(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=XF(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+rI(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=iI,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=oI(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function oI(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?iI:[e]}function sI(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),aI(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var cI={}.hasOwnProperty,lI={};function uI(e,t){let n=t||lI,r=new Map,i=new Map,a={all:s,applyData:fI,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...jF,...n.handlers},one:o,options:n,patch:dI,wrap:mI};return sI(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(cI.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=KF(n);return r.children=a.all(e),r}return KF(e)}return(a.options.unknownHandler||pI)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=hI(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=hI(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function dI(e,t){e.position&&(t.position=_j(e))}function fI(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,KF(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function pI(e,t){let n=t.data||{},r=`value`in t&&!(cI.call(n,`hProperties`)||cI.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mI(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
80
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
81
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
82
+ `}),n}function hI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gI(e,t){let n=uI(e,t),r=n.one(e,void 0),i=YF(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
83
+ `},i)),a}function _I(e,t){return e&&`run`in e?async function(n,r){let i=gI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gI(n,{file:r,...e||t})}}function vI(e){if(e)throw e}var yI=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function bI(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xI(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?SI(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function SI(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var CI={basename:wI,dirname:TI,extname:EI,join:DI,sep:`/`};function wI(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);AI(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function TI(e){if(AI(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function EI(e){AI(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function DI(...e){let t=-1,n;for(;++t<e.length;)AI(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:OI(n)}function OI(e){AI(e);let t=e.codePointAt(0)===47,n=kI(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function kI(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function AI(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var jI={cwd:MI};function MI(){return`/`}function NI(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function PI(e){if(typeof e==`string`)e=new URL(e);else if(!NI(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return FI(e)}function FI(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var II=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],LI=class{constructor(e){let t;t=e?NI(e)?{path:e}:typeof e==`string`||VI(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:jI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<II.length;){let e=II[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)II.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?CI.basename(this.path):void 0}set basename(e){zI(e,`basename`),RI(e,`basename`),this.path=CI.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?CI.dirname(this.path):void 0}set dirname(e){BI(this.basename,`dirname`),this.path=CI.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?CI.extname(this.path):void 0}set extname(e){if(RI(e,`extname`),BI(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=CI.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){NI(e)&&(e=PI(e)),zI(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?CI.basename(this.path,this.extname):void 0}set stem(e){zI(e,`stem`),RI(e,`stem`),this.path=CI.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Sj(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function RI(e,t){if(e&&e.includes(CI.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+CI.sep+"`")}function zI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function BI(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function VI(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HI=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),UI=l(yI(),1),WI={}.hasOwnProperty,GI=new class e extends HI{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=xI()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,UI.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(JI(`data`,this.frozen),this.namespace[e]=t,this):WI.call(this.namespace,e)&&this.namespace[e]||void 0:e?(JI(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ZI(e),n=this.parser||this.Parser;return KI(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),KI(`process`,this.parser||this.Parser),qI(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ZI(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$I(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),KI(`processSync`,this.parser||this.Parser),qI(`processSync`,this.compiler||this.Compiler),this.process(e,r),XI(`processSync`,`process`,t),n;function r(e,r){t=!0,vI(e),n=r}}run(e,t,n){YI(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ZI(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),XI(`runSync`,`run`,n),r;function i(e,t){vI(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ZI(t),r=this.compiler||this.Compiler;return qI(`stringify`,r),YI(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(JI(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,UI.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];bI(o)&&bI(r)&&(r=(0,UI.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function KI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function qI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function JI(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function YI(e){if(!bI(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function XI(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ZI(e){return QI(e)?e:new LI(e)}function QI(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $I(e){return typeof e==`string`||eL(e)}function eL(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tL=[],nL={allowDangerousHtml:!0},rL=/^(https?|ircs?|mailto|xmpp)$/i,iL=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function aL(e){let t=oL(e),n=sL(e);return cL(t.runSync(t.parse(n),n),e)}function oL(e){let t=e.rehypePlugins||tL,n=e.remarkPlugins||tL,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nL}:nL;return GI().use(eF).use(n).use(_I,r).use(t)}function sL(e){let t=e.children||``,n=new LI;return typeof t==`string`?n.value=t:``+t,n}function cL(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||lL;for(let e of iL)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return sI(e,l),Aj(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Qj)if(Object.hasOwn(Qj,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Qj[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function lL(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rL.test(e.slice(0,t))?e:``}function uL(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function dL(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fL(e,t,n){let r=XF((n||{}).ignore||[]),i=pL(t),a=-1;for(;++a<i.length;)aI(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function pL(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([mL(e[0]),hL(e[1])])}return t}function mL(e){return typeof e==`string`?new RegExp(dL(e),`g`):e}function hL(e){return typeof e==`function`?e:function(){return e}}var gL=`phrasing`,_L=[`autolink`,`link`,`image`,`label`];function vL(){return{transforms:[EL],enter:{literalAutolink:bL,literalAutolinkEmail:xL,literalAutolinkHttp:xL,literalAutolinkWww:xL},exit:{literalAutolink:TL,literalAutolinkEmail:wL,literalAutolinkHttp:SL,literalAutolinkWww:CL}}}function yL(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:gL,notInConstruct:_L},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:gL,notInConstruct:_L},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:gL,notInConstruct:_L}]}}function bL(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xL(e){this.config.enter.autolinkProtocol.call(this,e)}function SL(e){this.config.exit.autolinkProtocol.call(this,e)}function CL(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function wL(e){this.config.exit.autolinkEmail.call(this,e)}function TL(e){this.exit(e)}function EL(e){fL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DL],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,OL]],{ignore:[`link`,`linkReference`]})}function DL(e,t,n,r,i){let a=``;if(!jL(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!kL(n)))return!1;let o=AL(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function OL(e,t,n,r){return!jL(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function kL(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AL(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=uL(e,`(`),a=uL(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function jL(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||wM(n)||CM(n))&&(!t||n!==47)}VL.peek=BL;function ML(){this.buffer()}function NL(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function PL(){this.buffer()}function FL(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function IL(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pM(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LL(e){this.exit(e)}function RL(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pM(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zL(e){this.exit(e)}function BL(){return`[`}function VL(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HL(){return{enter:{gfmFootnoteCallString:ML,gfmFootnoteCall:NL,gfmFootnoteDefinitionLabelString:PL,gfmFootnoteDefinition:FL},exit:{gfmFootnoteCallString:IL,gfmFootnoteCall:LL,gfmFootnoteDefinitionLabelString:RL,gfmFootnoteDefinition:zL}}}function UL(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VL},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
84
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?GL:WL))),s(),o}}function WL(e,t,n){return t===0?e:GL(e,t,n)}function GL(e,t,n){return(n?``:` `)+e}var KL=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ZL.attention=QL,ZL.peek=$L;function qL(){return{canContainEols:[`delete`],enter:{strikethrough:YL},exit:{strikethrough:XL}}}function JL(){return{handlers:{delete:ZL},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:KL}]}}function YL(e){this.enter({type:`delete`,children:[],position:void 0},e)}function XL(e){this.exit(e)}function ZL(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function QL(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function $L(){return`~`}function eR(e){return e.length}function tR(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||eR,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=nR(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=rR(r[d]);else{let e=rR(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
85
+ `)}function nR(e){return e==null?``:String(e)}function rR(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var iR=XF([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]),aR={}.hasOwnProperty;function oR(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&aR.call(t,e)){let n=String(t[e]);i=aR.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function sR(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),cR);return i(),o}function cR(e,t,n){return`>`+(n?``:` `)+e}function lR(e,t){return uR(e,t.inConstruct,!0)&&!uR(e,t.notInConstruct,!1)}function uR(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function dR(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
86
+ `&&!e.before&&!e.after&&lR(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
87
+ `}function fR(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function pR(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function mR(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hR(e,t,n,r){let i=mR(n),a=e.value||``;if(pR(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gR);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(fR(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
88
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
89
+ `),a&&(u+=o.move(a+`
90
+ `)),u+=o.move(s),c(),u}function gR(e,t,n){return(n?``:` `)+e}function _R(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function vR(e,t,n,r){let i=_R(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
91
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function yR(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}bR.attention=xR,bR.peek=SR;function bR(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function xR(e,t){return{construct:`emphasis`,markers:yR(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function SR(e,t,n){return n.options.emphasis||`*`}function CR(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function wR(e,t){let n=!1;return sI(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&eM(e)&&(t.options.setext||n))}function TR(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(wR(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
92
+ `,after:`
93
+ `});return r(),t(),o+`
94
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
95
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
96
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=CR(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ER.peek=DR;function ER(e){return e.value||``}function DR(){return`<`}OR.peek=kR;function OR(e,t,n,r){let i=_R(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function kR(){return`!`}AR.peek=jR;function AR(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function jR(){return`!`}MR.peek=NR;function MR(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function NR(){return"`"}function PR(e,t){let n=eM(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}FR.peek=IR;function FR(e,t,n,r){let i=_R(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(PR(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function IR(e,t,n){return PR(e,n)?`<`:`[`}LR.peek=RR;function LR(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function RR(){return`[`}function zR(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function BR(e){let t=zR(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VR(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function HR(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function UR(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?VR(n):zR(n),s=e.ordered?o===`.`?`)`:`.`:BR(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),HR(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function WR(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function GR(e,t,n,r){let i=WR(n),a=n.bulletCurrent||zR(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function KR(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function qR(e,t,n,r){if(!e.children.some(function(e){return iR(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function JR(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}YR.attention=XR,YR.peek=ZR;function YR(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function XR(e,t){return{construct:`strong`,markers:JR(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function ZR(e,t,n){return n.options.strong||`*`}function QR(e,t,n,r){return n.safe(e.value,r)}function $R(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ez(e,t,n){let r=(HR(n)+(n.options.ruleSpaces?` `:``)).repeat($R(n));return n.options.ruleSpaces?r.slice(0,-1):r}var tz={blockquote:sR,break:dR,code:hR,definition:vR,emphasis:bR,hardBreak:dR,heading:TR,html:ER,image:OR,imageReference:AR,inlineCode:MR,link:FR,linkReference:LR,list:UR,listItem:GR,paragraph:KR,root:qR,strong:YR,text:QR,thematicBreak:ez};function nz(){return{enter:{table:rz,tableData:sz,tableHeader:sz,tableRow:az},exit:{codeText:cz,table:iz,tableData:oz,tableHeader:oz,tableRow:oz}}}function rz(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function iz(e){this.exit(e),this.data.inTable=void 0}function az(e){this.enter({type:`tableRow`,children:[]},e)}function oz(e){this.exit(e)}function sz(e){this.enter({type:`tableCell`,children:[]},e)}function cz(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lz));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lz(e,t){return t===`|`?t:e}function uz(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
97
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
98
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return tR(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=tz.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function dz(){return{exit:{taskListCheckValueChecked:pz,taskListCheckValueUnchecked:pz,paragraph:mz}}}function fz(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:hz}}}function pz(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function mz(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hz(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=tz.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function gz(){return[vL(),HL(),qL(),nz(),dz()]}function _z(e){return{extensions:[yL(),UL(e),JL(),uz(e),fz()]}}var vz={tokenize:Mz,partial:!0},yz={tokenize:Nz,partial:!0},bz={tokenize:Pz,partial:!0},xz={tokenize:Fz,partial:!0},Sz={tokenize:Iz,partial:!0},Cz={name:`wwwAutolink`,tokenize:Az,previous:Lz},wz={name:`protocolAutolink`,tokenize:jz,previous:Rz},Tz={name:`emailAutolink`,tokenize:kz,previous:zz},Ez={};function Dz(){return{text:Ez}}for(var Oz=48;Oz<123;)Ez[Oz]=Tz,Oz++,Oz===58?Oz=65:Oz===91&&(Oz=97);Ez[43]=Tz,Ez[45]=Tz,Ez[46]=Tz,Ez[95]=Tz,Ez[72]=[Tz,wz],Ez[104]=[Tz,wz],Ez[87]=[Tz,Cz],Ez[119]=[Tz,Cz];function kz(e,t,n){let r=this,i,a;return o;function o(t){return!Bz(t)||!zz.call(r,r.previous)||Vz(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Bz(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Sz,u,l)(t):t===45||t===95||hM(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&mM(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Az(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Lz.call(r,r.previous)||Vz(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(vz,e.attempt(yz,e.attempt(bz,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function jz(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Rz.call(r,r.previous)&&!Vz(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(mM(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||_M(t)||xM(t)||wM(t)||CM(t)?n(t):e.attempt(yz,e.attempt(bz,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Mz(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Nz(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(xz,c,s)(t):t===null||xM(t)||wM(t)||t!==45&&CM(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Pz(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(xz,t,a)(o):o===null||xM(o)||wM(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Fz(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||xM(o)||wM(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||xM(e)||wM(e)?t(e):r(e)}function a(e){return mM(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):mM(t)?(e.consume(t),o):n(t)}}function Iz(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return hM(e)?n(e):t(e)}}function Lz(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xM(e)}function Rz(e){return!mM(e)}function zz(e){return!(e===47||Bz(e))}function Bz(e){return e===43||e===45||e===46||e===95||hM(e)}function Vz(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Hz={tokenize:Xz,partial:!0};function Uz(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:qz,continuation:{tokenize:Jz},exit:Yz}},text:{91:{name:`gfmFootnoteCall`,tokenize:Kz},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Wz,resolveTo:Gz}}}}function Wz(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=pM(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Gz(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Kz(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||xM(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(pM(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return xM(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function qz(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||xM(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=pM(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return xM(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),DM(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Jz(e,t,n){return e.check(GM,t,e.attempt(Hz,t,n))}function Yz(e){e.exit(`gfmFootnoteDefinition`)}function Xz(e,t,n){let r=this;return DM(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Zz(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&oM(o,o.length,0,RM(s,e.slice(r+1,n),t)),oM(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),oM(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=LM(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=LM(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Qz=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){$z(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function $z(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function eB(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function tB(){return{flow:{null:{name:`table`,tokenize:nB,resolveAll:rB}}}}function nB(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):SM(t)?DM(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||xM(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,SM(t)?DM(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return SM(t)?DM(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return SM(t)?DM(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):SM(n)?DM(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||xM(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function rB(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Qz;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(aB(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=iB(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=iB(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=iB(f,t,o,i,n,d)):(o[0]=o[1],d=iB(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&aB(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=eB(t.events,n))}return e}function iB(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},oB(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=oB(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=oB(t.events,n[2]),a=oB(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},oB(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function aB(e,t,n,r,i){let a=[],o=oB(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function oB(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var sB={name:`tasklistCheck`,tokenize:lB};function cB(){return{text:{91:sB}}}function lB(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return xM(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):SM(r)?e.check({tokenize:uB},t,n)(r):n(r)}}function uB(e,t,n){return DM(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function dB(e){return lM([Dz(),Uz(),Zz(e),tB(),cB()])}var fB={};function pB(e){let t=this,n=e||fB,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(dB(n)),a.push(gz()),o.push(_z(n))}var mB=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function hB(e){return gB(e)}function gB(e){return Array.isArray(e)?_B(e):e instanceof RegExp?e:typeof e==`object`?vB(e):e}function _B(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=gB(e[n]);return t}function vB(e){let t={};for(let n in e)t[n]=gB(e[n]);return t}function yB(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function bB(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?bB(e.substring(0,e.length-1)):e.substr(~t+1)}var xB=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,SB=class{static hasCaptures(e){return e!==null&&(xB.lastIndex=0,xB.test(e))}static replaceCaptures(e,t,n){return e.replace(xB,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function CB(e,t){return e<t?-1:+(e>t)}function wB(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=CB(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function TB(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function EB(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var DB=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},OB=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(NB(e),t)}static createFromParsedTheme(e,t){return IB(e,t)}_cachedMatchRoot=new DB(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>AB(e.parent,t.parentScopes));return n?new MB(n.fontStyle,n.foreground,n.background):null}},kB=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function AB(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!jB(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function jB(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var MB=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function NB(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&TB(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&TB(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new PB(l,u,e,o,s,c)}}return n}var PB=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},FB=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(FB||{});function IB(e,t){e.sort((e,t)=>{let n=CB(e.scope,t.scope);return n!==0||(n=wB(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new LB(t),o=new MB(n,a.getId(r),a.getId(i)),s=new BB(new zB(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new OB(a,o,s)}var LB=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},RB=Object.freeze([]),zB=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||RB,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},BB=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),zB.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(wB(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new zB(e,t,n,r,i))}},VB=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=UB(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function HB(e){return e}function UB(e){return e}function WB(e,t){let n=[],r=KB(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(GB(i)){let e=[];do e.push(i),i=r.next();while(GB(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function GB(e){return!!e&&!!e.match(/[\w\.:]+/)}function KB(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function qB(e){typeof e.dispose==`function`&&e.dispose()}var JB=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},YB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},XB=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ZB=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new JB(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new XB;for(let n of e)QB(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof JB){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function QB(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof JB?eV({baseGrammar:a,selfGrammar:i},r):$B(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new JB(e))}function $B(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];tV([r],t,n)}}function eV(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&tV(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&tV(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function tV(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?yB({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&tV(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=sV(i);switch(a.kind){case 0:eV({...t,selfGrammar:t.baseGrammar},n);break;case 1:eV(t,n);break;case 2:$B(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?$B(a.ruleName,i,n):eV(i,n)}else a.kind===4?n.add(new YB(a.scopeName,a.ruleName)):n.add(new JB(a.scopeName))}}}var nV=class{kind=0},rV=class{kind=1},iV=class{constructor(e){this.ruleName=e}kind=2},aV=class{constructor(e){this.scopeName=e}kind=3},oV=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function sV(e){if(e===`$base`)return new nV;if(e===`$self`)return new rV;let t=e.indexOf(`#`);return t===-1?new aV(e):t===0?new iV(e.substring(1)):new oV(e.substring(0,t),e.substring(t+1))}var cV=/\\(\d+)/,lV=/\\(\d+)/g,uV=-1,dV=-2;function fV(e){return e}function pV(e){return e}var mV=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=SB.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=SB.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${bB(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:SB.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:SB.replaceCaptures(this._contentName,e,t)}},hV=class extends mV{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},gV=class extends mV{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new xV(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new SV,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_V=class extends mV{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new SV,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vV=class extends mV{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new xV(i,this.id),this.beginCaptures=a,this._end=new xV(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new SV;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},yV=class extends mV{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new xV(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new xV(o,dV),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new SV;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new SV,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},bV=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new hV(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new gV(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=yB({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new _V(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new yV(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new vV(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=sV(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof _V||e instanceof vV||e instanceof yV)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},xV=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&cV.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return lV.lastIndex=0,this.source.replace(lV,(e,t)=>EB(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},SV=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new CV(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new CV(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},CV=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
99
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},wV=class{constructor(e,t){this.languageId=e,this.tokenType=t}},TV=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new wV(e,8),this._embeddedLanguagesMatcher=new EV(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new wV(0,0);_getBasicScopeAttributes=new DB(e=>new wV(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},EV=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>EB(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var DV=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function OV(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=kV(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new DV(i,!0);f()}return new DV(i,!1);function f(){let o=AV(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===uV){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),FV(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof vV){let r=o;FV(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof yV){let r=o;FV(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(FV(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function kV(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof yV&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=PV(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==dV){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),FV(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function AV(e,t,n,r,i,a){let o=jV(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=MV(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function jV(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=NV(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function MV(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=NV(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function NV(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function PV(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function FV(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));OV(e,p,n&&d.start===0,d.start,f,i,!1,0),qB(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new IV(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var IV=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function LV(e,t,n,r,i,a,o,s){return new VV(e,t,n,r,i,a,o,s)}function RV(e,t,n,r,i){let a=WB(t,zV),o=bV.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function zV(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(BV(t[r],e))return n=r+1,!0;return!1})}function BV(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var VV=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new TV(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=HV(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=WB(e,zV);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)RV(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&RV(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(fV(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[pV(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=HV(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=bV.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===WV.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=VB.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?UV.createRootAndLookUpScopeName(a,r,this):UV.createRoot(`unknown`,r),t=new WV(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
100
+ `;let a=this.createOnigString(e),o=a.content.length,s=new KV(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=OV(this,a,i,0,t,s,!0,r);return qB(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function HV(e,t){return e=hB(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var UV=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=kB.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new kB(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new kB(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),VB.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},WV=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?UV.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:pV(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=UV.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,fV(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,UV.fromExtension(r,n.contentNameScopesList))}},GV=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):WB(e,zV).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>WB(e,zV).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},KV=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=VB.set(n,0,HB(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=VB.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},qV=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,LV(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},JV=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new qV(OB.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(OB.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new GV(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new ZB(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},YV=WV.NULL,XV=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],ZV=/["&'<>`]/g,QV=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$V=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eH=/[|\\{}()[\]^$+*?.]/g,tH=new WeakMap;function nH(e,t){return e=e.replace(t.subset?rH(t.subset):ZV,r),t.subset||t.escapeOnly?e:e.replace(QV,n).replace($V,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function rH(e){let t=tH.get(e);return t||(t=iH(e),tH.set(e,t)),t}function iH(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(eH,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var aH=/[\dA-Fa-f]/;function oH(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!aH.test(String.fromCharCode(t))?r:r+`;`}var sH=/\d/;function cH(e,t,n){let r=`&#`+String(e);return n&&t&&!sH.test(String.fromCharCode(t))?r:r+`;`}var lH=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),uH={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},dH=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],fH={}.hasOwnProperty,pH={},mH;for(mH in uH)fH.call(uH,mH)&&(pH[uH[mH]]=mH);var hH=/[^\dA-Za-z]/;function gH(e,t,n,r){let i=String.fromCharCode(e);if(fH.call(pH,i)){let e=pH[i],a=`&`+e;return n&&lH.includes(e)&&!dH.includes(e)&&(!r||t&&t!==61&&hH.test(String.fromCharCode(t)))?a:a+`;`}return``}function _H(e,t,n){let r=oH(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=gH(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=cH(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function vH(e,t){return nH(e,Object.assign({format:_H},t))}var yH=/^>|^->|<!--|-->|--!>|<!-$/g,bH=[`>`],xH=[`<`,`>`];function SH(e,t,n,r){return r.settings.bogusComments?`<?`+vH(e.value,Object.assign({},r.settings.characterReferences,{subset:bH}))+`>`:`<!--`+e.value.replace(yH,i)+`-->`;function i(e){return vH(e,Object.assign({},r.settings.characterReferences,{subset:xH}))}}function CH(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var wH=DH(1),TH=DH(-1),EH=[];function DH(e){return t;function t(t,n,r){let i=t?t.children:EH,a=(n||0)+e,o=i[a];if(!r)for(;o&&OA(o);)a+=e,o=i[a];return o}}var OH={}.hasOwnProperty;function kH(e){return t;function t(t,n,r){return OH.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var AH=kH({body:NH,caption:jH,colgroup:jH,dd:LH,dt:IH,head:jH,html:MH,li:FH,optgroup:zH,option:BH,p:PH,rp:RH,rt:RH,tbody:HH,td:GH,tfoot:UH,th:GH,thead:VH,tr:WH});function jH(e,t,n){let r=wH(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&OA(r.value.charAt(0)))}function MH(e,t,n){let r=wH(n,t);return!r||r.type!==`comment`}function NH(e,t,n){let r=wH(n,t);return!r||r.type!==`comment`}function PH(e,t,n){let r=wH(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function FH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&r.tagName===`li`}function IH(e,t,n){let r=wH(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function LH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function RH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function zH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function BH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function VH(e,t,n){let r=wH(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function HH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function UH(e,t,n){return!wH(n,t)}function WH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function GH(e,t,n){let r=wH(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var KH=kH({body:YH,colgroup:XH,head:JH,html:qH,tbody:ZH});function qH(e){let t=wH(e,-1);return!t||t.type!==`comment`}function JH(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function YH(e){let t=wH(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&OA(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function XH(e,t,n){let r=TH(n,t),i=wH(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&AH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function ZH(e,t,n){let r=TH(n,t),i=wH(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&AH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var QH={name:[[`
101
+ \f\r &/=>`.split(``),`
102
+ \f\r "&'/=>\``.split(``)],[`\0
103
+ \f\r "&'/<=>`.split(``),`\0
104
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
105
+ \f\r &>`.split(``),`\0
106
+ \f\r "&'<=>\``.split(``)],[`\0
107
+ \f\r "&'<=>\``.split(``),`\0
108
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function $H(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=cj);let l=eU(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!KH(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!AH(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function eU(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=tU(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function tU(e,t,n){let r=ij(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=vH(r.attribute,Object.assign({},e.settings.characterReferences,{subset:QH.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?SA:lj)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=vH(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:QH.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&uL(n,o)>uL(n,e.alternative)&&(o=e.alternative),s=o+vH(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?QH.single:QH.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var nU=[`<`,`&`];function rU(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:vH(e.value,Object.assign({},r.settings.characterReferences,{subset:nU}))}function iU(e,t,n,r){return r.settings.allowDangerousHtml?e.value:rU(e,t,n,r)}function aU(e,t,n,r){return r.all(e)}var oU=oR(`type`,{invalid:sU,unknown:cU,handlers:{comment:SH,doctype:CH,element:$H,raw:iU,root:aU,text:rU}});function sU(e){throw Error("Expected node, not `"+e+"`")}function cU(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var lU={},uU={},dU=[];function fU(e,t){let n=t||lU,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:pU,all:mU,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||XV,characterReferences:n.characterReferences||uU,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?cj:sj,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function pU(e,t,n){return oU(e,t,n,this)}function mU(e){let t=[],n=e&&e.children||dU,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function hU(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function gU(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _U(e){return Array.isArray(e)?e:[e]}async function vU(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function yU(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function bU(e){return e===`ansi`||yU(e)}function xU(e){return e===`none`}function SU(e){return xU(e)}function CU(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function wU(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function TU(e){let t=wU(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function EU(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var DU=`light-dark()`,OU=[`color`,`background-color`];function kU(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function AU(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?kU(e,t):e})):e}function jU(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>MU(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&OU.includes(a)){if(r===DU&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new mB('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function MU(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&FB.Italic&&(t[`font-style`]=`italic`),e.fontStyle&FB.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&FB.Underline&&n.push(`underline`),e.fontStyle&FB.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function NU(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var PU=new WeakMap;function FU(e,t){PU.set(e,t)}function IU(e){return PU.get(e)}var LU=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(_U(n).map(e=>[e,YV])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return RU(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function RU(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function zU(e,t){if(!(e instanceof LU))throw new mB(`Invalid grammar state`);return e.getInternalStack(t)}function BU(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new mB(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{let t=r.lines[e.line];if(t===void 0)throw new mB(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new mB(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=TU(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));VU(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return AU(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new mB(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=HU(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new mB(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new mB(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&CU(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function VU(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new mB(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new mB(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function HU(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(HU).join(``):``}var UU=[BU()];function WU(e){let t=GU(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...UU]}function GU(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var KU=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],qU={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function JU(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function YU(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function XU(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)qU[r]&&t.push({type:`setDecoration`,value:qU[r]});else if(r<=29){let e=qU[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:KU[r-30]}});else if(r===38){let n=YU(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:KU[r-40]}});else if(r===48){let n=YU(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:KU[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:KU[r-100+8]}})}}return t}function ZU(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=JU(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=XU(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var QU={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function $U(e=QU){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<KU.length;e++)r.push(t(KU[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var eW={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function tW(e,t,n){let r=hU(e,n),i=wU(t),a=$U(Object.fromEntries(KU.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||eW[t]]}))),o=ZU();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=gU(i,r),o=gU(o,r),n.decorations.has(`dim`)&&(i=nW(i));let s=FB.None;return n.decorations.has(`bold`)&&(s|=FB.Bold),n.decorations.has(`italic`)&&(s|=FB.Italic),n.decorations.has(`underline`)&&(s|=FB.Underline),n.decorations.has(`strikethrough`)&&(s|=FB.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function nW(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function rW(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(yU(i)||xU(r))return wU(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return tW(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new mB(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new mB(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return aW(t,s,a,o,n)}function iW(...e){if(e.length===2)return IU(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(yU(i)||xU(a))throw new mB(`Plain language does not have grammar state`);if(i===`ansi`)throw new mB(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new LU(oW(n,c,o,s,r).stateStack,c.name,o.name)}function aW(e,t,n,r,i){let a=oW(e,t,n,r,i),o=new LU(a.stateStack,t.name,n.name);return FU(a.tokens,o),a.tokens}function oW(e,t,n,r,i){let a=hU(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=wU(e),l=i.grammarState?zU(i.grammarState,n.name)??YV:i.grammarContextCode==null?YV:oW(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=gU(r[VB.getForeground(s)],a),l=VB.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?sW(t.scopes):cW(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function sW(e){return e.map(e=>({scopeName:e}))}function cW(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:dW(e,i,t.slice(0,r))}}return n}function lW(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function uW(e,t,n){if(!lW(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)lW(e[r],n[i])&&--r,--i;return r===-1}function dW(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(uW(e,t,n)){r.push(a);break}return r}function fW(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=rW(e,t,{...n,theme:r.theme});return{tokens:i,state:IU(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=pW(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new LU(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&FU(o,s),o}function pW(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function mW(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new mB("`themes` option must not be empty");let p=fW(e,t,n);if(c=IU(p),l&&DU!==l&&!f.find(e=>e.color===l))throw new mB(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>jU(e,h,u,l,d))),c&&FU(a,c);let g=f.map(e=>hU(e.theme,n));i=hW(f,m,g,u,l,`fg`,d),r=hW(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=hU(n.theme,n);a=rW(e,t,n);let l=e.getTheme(n.theme);r=gU(l.bg,s),i=gU(l.fg,s),o=l.name,c=IU(a)}else throw new mB("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function hW(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=gU(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===DU&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new mB('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${gU(t[r][a],n[r])||`inherit`}, ${gU(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function gW(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>gW(e,t,n),codeToTokens:(t,n)=>mW(e,t,n)}){let i=t;for(let e of WU(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=mW(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=vW(a):d===`never`&&(a=yW(a)),f&&(a=bW(a));let p={...r,get source(){return i}};for(let e of WU(n))a=e.tokens?.call(p,a)||a;return _W(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function _W(e,t,n,r=IU(e)){let i=WU(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:CU,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
109
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=NU(a.htmlStyle||MU(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&FU(m,r),m}function vW(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&FB.Underline||i.fontStyle&FB.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function yW(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function bW(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=NU(e.htmlStyle||MU(e)),i=NU(n.htmlStyle||MU(n)),a=e.fontStyle&&(e.fontStyle&FB.Underline||e.fontStyle&FB.Strikethrough),o=n.fontStyle&&(n.fontStyle&FB.Underline||n.fontStyle&FB.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var xW=fU;function SW(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>gW(e,t,n),codeToTokens:(t,n)=>mW(e,t,n)},i=xW(gW(e,t,n,r));for(let e of WU(n))i=e.postprocess?.call(r,i,n)||i;return i}var CW={light:`#333333`,dark:`#bbbbbb`},wW={light:`#fffffe`,dark:`#1e1e1e`},TW=`__shiki_resolved`;function EW(e){if(e?.[TW])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?CW.light:CW.dark,n||=t.type===`light`?wW.light:wW.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,TW,{enumerable:!1,writable:!1,value:!0}),t}async function DW(e){return Array.from(new Set((await Promise.all(e.filter(e=>!bU(e)).map(async e=>await vU(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function OW(e){return(await Promise.all(e.map(async e=>SU(e)?null:EW(await vU(e))))).filter(e=>!!e)}var kW=3;function AW(e,t=3){kW&&(typeof kW==`number`&&t>kW||console.trace(`[SHIKI DEPRECATE]: ${e}`))}var jW=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function MW(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new jW(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var NW=class extends JV{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=EW(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=OB.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=MW(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new jW(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},PW=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},FW=0;function IW(e){FW+=1,e.warnings!==!1&&FW>=10&&FW%10==0&&console.warn(`[Shiki] ${FW} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new jW("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(EW),i=new NW(new PW(e.engine,n),r,n,e.langAlias),a;function o(t){return MW(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new jW(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new jW(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await DW(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await OW(e))}function g(){if(t)throw new jW(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--FW)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function LW(e){e.engine||AW("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([OW(e.themes||[]),DW(e.langs||[]),e.engine]);return IW({...e,themes:t,langs:n,engine:r})}async function RW(e){let t=await LW(e);return{getLastGrammarState:(...e)=>iW(t,...e),codeToTokensBase:(e,n)=>rW(t,e,n),codeToTokensWithThemes:(e,n)=>fW(t,e,n),codeToTokens:(e,n)=>mW(t,e,n),codeToHast:(e,n)=>gW(t,e,n),codeToHtml:(e,n)=>SW(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function zW(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,bU(n))return[];let r=t[n];if(!r)throw new mB(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(SU(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new mB(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await RW({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function BW(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function VW(e,t){let n=BW(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var HW=[{id:`abap`,name:`ABAP`,import:(()=>L(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>L(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>L(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>L(()=>import(`./angular-html-CDngiajI.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>L(()=>import(`./angular-ts-BtT37Us9.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>L(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>L(()=>import(`./apex-CGTLDQj6.js`),[]))},{id:`apl`,name:`APL`,import:(()=>L(()=>import(`./apl-BvMMMvlM.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>L(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>L(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>L(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>L(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>L(()=>import(`./astro-5GH4n63k.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>L(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>L(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>L(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>L(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>L(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>L(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>L(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>L(()=>import(`./bird2-C2hNVINV.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>L(()=>import(`./blade-FVyx8_pi.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>L(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>L(()=>import(`./c-DaWGyzOq.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>L(()=>import(`./c3-CnJL0r0V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>L(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>L(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>L(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>L(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>L(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>L(()=>import(`./cobol-BR4hIuAS.js`),__vite__mapDeps([21,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>L(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>L(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>L(()=>import(`./coffee-CV_krZ_v.js`),__vite__mapDeps([22,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>L(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>L(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>L(()=>import(`./cpp-BcL5kNR1.js`).then(e=>e.n),__vite__mapDeps([23,16,24,25,26])))},{id:`crystal`,name:`Crystal`,import:(()=>L(()=>import(`./crystal-uM0LOVx9.js`),__vite__mapDeps([27,2,3,1,16,26,28])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>L(()=>import(`./csharp-Ct8U2NOr.js`),[]))},{id:`css`,name:`CSS`,import:(()=>L(()=>import(`./css-0UGFDVhs.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>L(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>L(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>L(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>L(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>L(()=>import(`./dart-DkHntEIa.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>L(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>L(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>L(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>L(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>L(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>L(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>L(()=>import(`./edge-D0oESfMY.js`),__vite__mapDeps([29,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>L(()=>import(`./elixir-CaEILBcp.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>L(()=>import(`./elm-ZyUnRSna.js`),__vite__mapDeps([31,25,26])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>L(()=>import(`./emacs-lisp-C9PiwqqW.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>L(()=>import(`./erb-BEOXg7uE.js`),__vite__mapDeps([32,1,2,3,33,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>L(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>L(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>L(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>L(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>L(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>L(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>L(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>L(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>L(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>L(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>L(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>L(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>L(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>L(()=>import(`./git-rebase-LAaHyDt5.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>L(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>L(()=>import(`./glimmer-js-DnRAU-8r.js`),__vite__mapDeps([50,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>L(()=>import(`./glimmer-ts-B_9lY4Cg.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>L(()=>import(`./glsl-Bzz9G3Ya.js`).then(e=>e.n),__vite__mapDeps([25,26])))},{id:`gn`,name:`GN`,import:(()=>L(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>L(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>L(()=>import(`./go-BJwz_mda.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>L(()=>import(`./graphql-CFv-7q2r.js`).then(e=>e.n),__vite__mapDeps([35,2,11,13,36])))},{id:`groovy`,name:`Groovy`,import:(()=>L(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>L(()=>import(`./hack-BQq89007.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>L(()=>import(`./haml-B3JO2g53.js`).then(e=>e.n),__vite__mapDeps([34,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>L(()=>import(`./handlebars-BVxFlQdu.js`),__vite__mapDeps([53,2,3,1,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>L(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>L(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>L(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>L(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>L(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>L(()=>import(`./html-CwlSby6Y.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>L(()=>import(`./html-derivative-Bp9FFIai.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>L(()=>import(`./http-OxvOel0d.js`),__vite__mapDeps([54,7,8,9,28,35,2,11,13,36])))},{id:`hurl`,name:`Hurl`,import:(()=>L(()=>import(`./hurl-BR8OTQDL.js`),__vite__mapDeps([55,7,8,56,35,2,11,13,36])))},{id:`hxml`,name:`HXML`,import:(()=>L(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>L(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>L(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>L(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>L(()=>import(`./java-DLdU51RX.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>L(()=>import(`./javascript-BOoDksQA.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>L(()=>import(`./jinja-JHLjBiC-.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>L(()=>import(`./jison-MADSp4PV.js`),__vite__mapDeps([60,2])))},{id:`json`,name:`JSON`,import:(()=>L(()=>import(`./json-BP2JFEth.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>L(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>L(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>L(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>L(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>L(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>L(()=>import(`./jsx-WD857QYb.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>L(()=>import(`./julia-DFzHTS-P.js`),__vite__mapDeps([61,2,16,20,23,24,25,26,62])))},{id:`just`,name:`Just`,import:(()=>L(()=>import(`./just-Cr1WcUSw.js`),__vite__mapDeps([63,2,11,20,28,33,3,1,7,8,16,26,23,24,25,34,35,13,36,37,38,64])))},{id:`kdl`,name:`KDL`,import:(()=>L(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>L(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>L(()=>import(`./kusto-BUv0MjJC.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>L(()=>import(`./latex-C4Jp4eq5.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>L(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>L(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>L(()=>import(`./liquid-BOlUcl5B.js`),__vite__mapDeps([67,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>L(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>L(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>L(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>L(()=>import(`./lua-Bt6jto6s.js`).then(e=>e.n),__vite__mapDeps([37,26])))},{id:`luau`,name:`Luau`,import:(()=>L(()=>import(`./luau-CNKltnaQ.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>L(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>L(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>L(()=>import(`./marko-B4gbbHnu.js`),__vite__mapDeps([68,3,5,11,69])))},{id:`matlab`,name:`MATLAB`,import:(()=>L(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>L(()=>import(`./mdc-D4PTgKs-.js`),__vite__mapDeps([70,15,1,2,3,38,40])))},{id:`mdx`,name:`MDX`,import:(()=>L(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>L(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>L(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>L(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>L(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>L(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>L(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>L(()=>import(`./nextflow-Bbiyy34d.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>L(()=>import(`./nextflow-groovy-Dc_ddanL.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>L(()=>import(`./nginx-CTDO1ewa.js`),__vite__mapDeps([73,37,26])))},{id:`nim`,name:`Nim`,import:(()=>L(()=>import(`./nim-BOQk_yKn.js`),__vite__mapDeps([74,2,3,1,7,8,26,25,40])))},{id:`nix`,name:`Nix`,import:(()=>L(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>L(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>L(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>L(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>L(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>L(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>L(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>L(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>L(()=>import(`./perl-vPUc98Xz.js`),__vite__mapDeps([64,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>L(()=>import(`./php-DeCmiyAV.js`),__vite__mapDeps([75,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>L(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>L(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>L(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>L(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>L(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>L(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>L(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>L(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>L(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>L(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>L(()=>import(`./pug-DrCcomsb.js`),__vite__mapDeps([76,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>L(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>L(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>L(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>L(()=>import(`./qml-BYMwIH9I.js`),__vite__mapDeps([77,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>L(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>L(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>L(()=>import(`./r-lYZIQvFq.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>L(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>L(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>L(()=>import(`./razor-BsZLkc5_.js`),__vite__mapDeps([78,1,2,3,79])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>L(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>L(()=>import(`./regexp-CuieyCDo.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>L(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>L(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>L(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>L(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>L(()=>import(`./rst-Buwxy6i8.js`),__vite__mapDeps([80,2,15,1,3,20,81,23,16,24,25,26,28,38,33,7,8,34,35,11,13,36,37])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>L(()=>import(`./ruby-Dbe_ekvV.js`),__vite__mapDeps([33,2,3,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>L(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>L(()=>import(`./sas-P1b9K4Ys.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>L(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>L(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>L(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>L(()=>import(`./scss-C_sc8enw.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>L(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>L(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>L(()=>import(`./shellscript-BJkeugYw.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>L(()=>import(`./shellsession-BQdMaoZE.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>L(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>L(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>L(()=>import(`./soy-CnADQkBx.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>L(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>L(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>L(()=>import(`./sql-tNQIlitF.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>L(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>L(()=>import(`./stata-Dbj2lGXX.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>L(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>L(()=>import(`./surrealql-CUlk2o6E.js`),__vite__mapDeps([90,2])))},{id:`svelte`,name:`Svelte`,import:(()=>L(()=>import(`./svelte-BnEKKmXX.js`),__vite__mapDeps([91,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>L(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>L(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>L(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>L(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>L(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>L(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>L(()=>import(`./templ-DGjxt26F.js`),__vite__mapDeps([92,2,3,93])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>L(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>L(()=>import(`./tex-BlMK__2U.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>L(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>L(()=>import(`./ts-tags-C3cZCmwl.js`),__vite__mapDeps([94,2,3,1,7,8,11,16,25,26])))},{id:`tsv`,name:`TSV`,import:(()=>L(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>L(()=>import(`./tsx-BYhombzc.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>L(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>L(()=>import(`./twig-BCBpfD3_.js`),__vite__mapDeps([95,2,3,5,20,33,1,7,8,16,26,23,24,25,28,34,35,11,13,36,37,38,75,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>L(()=>import(`./typescript-C0I5qU9Q.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>L(()=>import(`./typespec-B88KGewJ.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>L(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>L(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>L(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>L(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>L(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>L(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>L(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>L(()=>import(`./vue-Ba5J_YU2.js`),__vite__mapDeps([96,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>L(()=>import(`./vue-html-CMnkOyKm.js`),__vite__mapDeps([97,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>L(()=>import(`./vue-vine-BLdNBabV.js`),__vite__mapDeps([98,2,3,5,12,69,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>L(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>L(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>L(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>L(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>L(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>L(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>L(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>L(()=>import(`./xml-CGYBKmq2.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>L(()=>import(`./xsl-CJoMbcve.js`),__vite__mapDeps([100,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>L(()=>import(`./yaml-UlGSIJg6.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>L(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>L(()=>import(`./zig-CMLA9XwU.js`),[]))}],UW=Object.fromEntries(HW.map(e=>[e.id,e.import])),WW=Object.fromEntries(HW.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),GW={...UW,...WW},KW=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>L(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>L(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>L(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>L(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>L(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>L(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>L(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>L(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>L(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>L(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>L(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>L(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>L(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>L(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>L(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>L(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>L(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>L(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>L(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>L(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>L(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>L(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>L(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>L(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>L(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>L(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>L(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>L(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>L(()=>import(`./horizon-bright-Br1oVSNq.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>L(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>L(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>L(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>L(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>L(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>L(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>L(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>L(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>L(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>L(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>L(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>L(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>L(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>L(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>L(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>L(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>L(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>L(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>L(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>L(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>L(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>L(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>L(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>L(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>L(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>L(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>L(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>L(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>L(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>L(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>L(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>L(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>L(()=>import(`./vesper-D5bVUKB1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>L(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>L(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>L(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),qW=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function JW(){return 2147483648}function YW(){return typeof performance<`u`?performance.now():Date.now()}var XW=(e,t)=>e+(t-e%t)%t;async function ZW(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=JW();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,XW(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:YW,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var QW=Object.defineProperty,$W=(e,t,n)=>t in e?QW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eG=(e,t,n)=>$W(e,typeof t==`symbol`?t:t+``,n),tG=null;function nG(e){throw new qW(e.UTF8ToString(e.getLastOnigError()))}var rG=class e{constructor(t){eG(this,`utf16Length`),eG(this,`utf8Length`),eG(this,`utf16Value`),eG(this,`utf8Value`),eG(this,`utf16OffsetToUtf8`),eG(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},iG=class e{constructor(t){if(eG(this,`id`,++e.LAST_ID),eG(this,`_onigBinding`),eG(this,`content`),eG(this,`utf16Length`),eG(this,`utf8Length`),eG(this,`utf16OffsetToUtf8`),eG(this,`utf8OffsetToUtf16`),eG(this,`ptr`),!tG)throw new qW(`Must invoke loadWasm first.`);this._onigBinding=tG,this.content=t;let n=new rG(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=tG.omalloc(1e4),e._sharedPtrInUse=!0,tG.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(tG)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};eG(iG,`LAST_ID`,0),eG(iG,`_sharedPtr`,0),eG(iG,`_sharedPtrInUse`,!1);var aG=iG,oG=class{constructor(e){if(eG(this,`_onigBinding`),eG(this,`_ptr`),!tG)throw new qW(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new rG(e[r]);t[r]=i.createString(tG),n[r]=i.utf8Length}let r=tG.omalloc(4*e.length);tG.HEAPU32.set(t,r/4);let i=tG.omalloc(4*e.length);tG.HEAPU32.set(n,i/4);let a=tG.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)tG.ofree(t[n]);tG.ofree(i),tG.ofree(r),a===0&&nG(tG),this._onigBinding=tG,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new aG(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function sG(e){return typeof e.instantiator==`function`}function cG(e){return typeof e.default==`function`}function lG(e){return e.data!==void 0}function uG(e){return typeof Response<`u`&&e instanceof Response}function dG(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var fG;function pG(e){if(fG)return fG;async function t(){tG=await ZW(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),sG(n)?n=await n.instantiator(t):cG(n)?n=await n.default(t):(lG(n)&&(n=n.data),uG(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await hG(n)(t):await gG(n)(t):dG(n)||n instanceof WebAssembly.Module?n=await mG(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await mG(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return fG=t(),fG}function mG(e){return t=>WebAssembly.instantiate(e,t)}function hG(e){return t=>WebAssembly.instantiateStreaming(e,t)}function gG(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function _G(e){return e&&await pG(e),{createScanner(e){return new oG(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new aG(e)}}}var{codeToHtml:vG,codeToHast:yG,codeToTokens:bG,codeToTokensBase:xG,codeToTokensWithThemes:SG,getSingletonHighlighter:CG,getLastGrammarState:wG}=VW(zW({langs:GW,themes:KW,engine:()=>_G(L(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{guessEmbeddedLanguages:EU}),TG=`typescript.tsx.javascript.jsx.json.python.ruby.go.rust.java.kotlin.c.cpp.csharp.php.swift.bash.shell.powershell.markdown.yaml.toml.ini.sql.html.css.scss.xml.diff.dockerfile.graphql.lua.perl.r.vue.svelte.zig`.split(`.`),EG=null;function DG(){return EG??=CG({themes:[`github-light`,`github-dark`],langs:TG}),EG}function OG({code:e,lang:t,className:n}){let{t:r}=Nb(),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let n=!1,r=t&&t.length>0?t.toLowerCase():`text`;return DG().then(t=>{let i=t.getLoadedLanguages().includes(r)?r:`text`,o=t.codeToHtml(e,{lang:i,themes:{light:`github-light`,dark:`github-dark`},defaultColor:!1});n||a(o)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t]);async function u(){try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}}return(0,H.jsxs)(`div`,{className:W(`group relative my-3 overflow-hidden rounded-lg border`,n),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between border-b bg-muted/40 px-2 py-1`,children:[(0,H.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t&&t.length>0?t:`text`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,H.jsx)(K,{size:`icon`,variant:`ghost`,className:`size-6`,title:r(c?`code.nowrap`:`code.wrap`),onClick:()=>l(e=>!e),children:(0,H.jsx)(La,{className:`size-3.5`})}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,className:`size-6`,title:r(`code.copy`),onClick:()=>void u(),children:o?(0,H.jsx)(ai,{className:`size-3.5`}):(0,H.jsx)(xi,{className:`size-3.5`})})]})]}),i?(0,H.jsx)(`div`,{className:W(`shiki-host overflow-x-auto text-xs [&_pre]:m-0 [&_pre]:bg-transparent [&_pre]:p-3`,c&&`[&_pre]:whitespace-pre-wrap [&_pre]:break-words`),dangerouslySetInnerHTML:{__html:i}}):(0,H.jsx)(`pre`,{className:W(`overflow-x-auto p-3 text-xs`,c&&`whitespace-pre-wrap break-words`),children:(0,H.jsx)(`code`,{children:e})})]})}function kG({chart:e}){let[t,n]=(0,y.useState)(``);return(0,y.useEffect)(()=>{let t=!1;return(async()=>{try{let{default:r}=await L(async()=>{let{default:e}=await import(`./mermaid.core-CqYAvE1t.js`);return{default:e}},__vite__mapDeps([101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119]));r.initialize({startOnLoad:!1,securityLevel:`strict`,theme:document.documentElement.classList.contains(`dark`)?`dark`:`default`});let i=`mermaid-${Math.random().toString(36).slice(2)}`,a=await r.render(i,e);t||n(a.svg)}catch{t||n(``)}})(),()=>{t=!0}},[e]),t.length===0?(0,H.jsx)(`pre`,{className:`my-2 overflow-x-auto rounded-md bg-muted/40 p-3 font-mono text-xs`,children:e}):(0,H.jsx)(`div`,{className:`my-3 flex justify-center overflow-x-auto rounded-md bg-muted/20 p-3`,dangerouslySetInnerHTML:{__html:t}})}function AG({content:e,className:t}){return(0,H.jsx)(`div`,{className:W(`prose prose-sm dark:prose-invert max-w-none`,`prose-pre:bg-muted/50 prose-pre:text-foreground prose-code:before:content-none prose-code:after:content-none`,t),children:(0,H.jsx)(aL,{remarkPlugins:[pB],components:{pre({children:e}){let t=Array.isArray(e)?e[0]:e,n=t?.props?.className??``,r=/language-([\w-]+)/.exec(n)?.[1];if(r){let e=String(t?.props?.children??``);return r===`mermaid`?(0,H.jsx)(kG,{chart:e}):(0,H.jsx)(OG,{code:e,lang:r})}return(0,H.jsx)(`pre`,{children:e})},code({className:e,children:t,...n}){return(0,H.jsx)(`code`,{className:e,...n,children:t})}},children:e})})}var jG=1,MG=.9,NG=.8,PG=.17,FG=.1,IG=.999,LG=.9999,RG=.99,zG=/[\\\/_+.#"@\[\(\{&]/,BG=/[\\\/_+.#"@\[\(\{&]/g,VG=/[\s-]/,HG=/[\s-]/g;function UG(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?jG:RG;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=UG(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=jG:zG.test(e.charAt(l-1))?(d*=NG,p=e.slice(i,l-1).match(BG),p&&i>0&&(d*=IG**+p.length)):VG.test(e.charAt(l-1))?(d*=MG,m=e.slice(i,l-1).match(HG),m&&i>0&&(d*=IG**+m.length)):(d*=PG,i>0&&(d*=IG**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=LG)),(d<FG&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=UG(e,t,n,r,l+1,a+2,o),f*FG>d&&(d=f*FG)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function WG(e){return e.toLowerCase().replace(HG,` `)}function GG(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,UG(e,t,WG(e),WG(t),0,0,{})}var KG=`[cmdk-group=""]`,qG=`[cmdk-group-items=""]`,JG=`[cmdk-group-heading=""]`,YG=`[cmdk-item=""]`,XG=`${YG}:not([aria-disabled="true"])`,ZG=`cmdk-item-select`,QG=`data-value`,$G=(e,t,n)=>GG(e,t,n),eK=y.createContext(void 0),tK=()=>y.useContext(eK),nK=y.createContext(void 0),rK=()=>y.useContext(nK),iK=y.createContext(void 0),aK=y.forwardRef((e,t)=>{let n=yK(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=yK(()=>new Set),i=yK(()=>new Map),a=yK(()=>new Map),o=yK(()=>new Set),s=_K(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=bc(),b=bc(),x=bc(),S=y.useRef(null),C=SK();vK(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),vK(()=>{C(6,A)},[]);let w=y.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=y.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??$G;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(qG);t?t.appendChild(e.parentElement===t?e:e.closest(`${qG} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${qG} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${KG}[${QG}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(QG);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(KG)?.querySelector(JG))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${YG}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(XG)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(QG))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(QG))}function F(e){let t=j()?.closest(KG),n;for(;t&&!n;)t=e>0?hK(t,KG):gK(t,KG),n=t?.querySelector(XG);n?w.setState(`value`,n.getAttribute(QG)):P(e)}let I=()=>N(M().length-1),ee=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return y.createElement(gs.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ee(e);break;case`ArrowDown`:ee(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(ZG);t.dispatchEvent(e)}}}}},y.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:TK},c),wK(e,e=>y.createElement(nK.Provider,{value:w},y.createElement(eK.Provider,{value:T},e))))}),oK=y.forwardRef((e,t)=>{let n=bc(),r=y.useRef(null),i=y.useContext(iK),a=tK(),o=_K(e),s=o.current?.forceMount??i?.forceMount;vK(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=xK(n,r,[e.value,e.children,r],e.keywords),l=rK(),u=bK(e=>e.value&&e.value===c.current),d=bK(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);y.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(ZG,f),()=>t.removeEventListener(ZG,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...b}=e;return y.createElement(gs.div,{ref:Xo(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),sK=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=bc(),s=y.useRef(null),c=y.useRef(null),l=bc(),u=tK(),d=bK(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));vK(()=>u.group(o),[]),xK(o,s,[e.value,e.heading,c]);let f=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(gs.div,{ref:Xo(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&y.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),wK(e,e=>y.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},y.createElement(iK.Provider,{value:f},e))))}),cK=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=bK(e=>!e.search);return!n&&!a?null:y.createElement(gs.div,{ref:Xo(i,t),...r,"cmdk-separator":``,role:`separator`})}),lK=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=rK(),o=bK(e=>e.search),s=bK(e=>e.selectedItemId),c=tK();return y.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),y.createElement(gs.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),uK=y.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=y.useRef(null),o=y.useRef(null),s=bK(e=>e.selectedItemId),c=tK();return y.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),y.createElement(gs.div,{ref:Xo(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},wK(e,e=>y.createElement(`div`,{ref:Xo(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),dK=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return y.createElement(Ru,{open:n,onOpenChange:r},y.createElement(Wu,{container:o},y.createElement(Ku,{"cmdk-overlay":``,className:i}),y.createElement(Xu,{"aria-label":e.label,"cmdk-dialog":``,className:a},y.createElement(aK,{ref:t,...s}))))}),fK=y.forwardRef((e,t)=>bK(e=>e.filtered.count===0)?y.createElement(gs.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),pK=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return y.createElement(gs.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},wK(e,e=>y.createElement(`div`,{"aria-hidden":!0},e)))}),mK=Object.assign(aK,{List:uK,Item:oK,Input:lK,Group:sK,Separator:cK,Dialog:dK,Empty:fK,Loading:pK});function hK(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gK(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _K(e){let t=y.useRef(e);return vK(()=>{t.current=e}),t}var vK=typeof window>`u`?y.useEffect:y.useLayoutEffect;function yK(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function bK(e){let t=rK(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function xK(e,t,n,r=[]){let i=y.useRef(),a=tK();return vK(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(QG,s),i.current=s}),i}var SK=()=>{let[e,t]=y.useState(),n=yK(()=>new Map);return vK(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function CK(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function wK({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(CK(t),{ref:t.ref},n(t.props.children)):n(t)}var TK={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function EK({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:W(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var DK=nb(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function OK({className:e,align:t=`inline-start`,...n}){return(0,H.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:W(DK({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function kK({className:e,...t}){return(0,H.jsx)(mK,{"data-slot":`command`,className:W(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function AK({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,H.jsxs)(EK,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,H.jsx)(mK.Input,{"data-slot":`command-input`,className:W(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,H.jsx)(OK,{children:(0,H.jsx)(xa,{className:`size-4 shrink-0 opacity-50`})})]})})}function jK({className:e,...t}){return(0,H.jsx)(mK.List,{"data-slot":`command-list`,className:W(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function MK({className:e,...t}){return(0,H.jsx)(mK.Empty,{"data-slot":`command-empty`,className:W(`py-6 text-center text-sm`,e),...t})}function NK({className:e,...t}){return(0,H.jsx)(mK.Group,{"data-slot":`command-group`,className:W(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function PK({className:e,children:t,...n}){return(0,H.jsxs)(mK.Item,{"data-slot":`command-item`,className:W(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,H.jsx)(ai,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function FK({...e}){return(0,H.jsx)(Hg,{"data-slot":`popover`,...e})}function IK({...e}){return(0,H.jsx)(Ug,{"data-slot":`popover-trigger`,...e})}function LK({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,H.jsx)(Wg,{children:(0,H.jsx)(Gg,{"data-slot":`popover-content`,align:t,sideOffset:n,className:W(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function RK(){let{t:e}=Nb(),t=Hb(),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(``),o=t.info?.providers??[],s=t.info?.modelId??``,c=i.trim().toLowerCase(),l=o.map(e=>({...e,models:e.models.filter(t=>c.length===0||t.toLowerCase().includes(c)||e.name.toLowerCase().includes(c))})).filter(e=>e.models.length>0);function u(n){r(!1),n!==s&&Jy(n).then(()=>{t.refreshInfo(),B.success(e(`model.switched`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))}return(0,H.jsxs)(FK,{open:n,onOpenChange:e=>{r(e),e||a(``)},children:[(0,H.jsx)(IK,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`max-w-56 gap-1.5 text-muted-foreground`,title:e(`model.select`),children:[(0,H.jsx)(Ti,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:t.info?.model??e(`header.noModel`)}),(0,H.jsx)(li,{className:`size-3.5 shrink-0 opacity-60`})]})}),(0,H.jsx)(LK,{align:`start`,side:`top`,className:`w-72 p-0`,children:(0,H.jsxs)(kK,{shouldFilter:!1,children:[(0,H.jsx)(AK,{value:i,onValueChange:a,placeholder:e(`model.search`)}),(0,H.jsxs)(jK,{children:[(0,H.jsx)(MK,{children:o.length===0?e(`model.empty`):e(`model.noMatches`)}),l.map(e=>(0,H.jsx)(NK,{heading:e.name,children:e.models.map(t=>{let n=`${e.name}/${t}`;return(0,H.jsxs)(PK,{value:n,onSelect:()=>u(n),children:[(0,H.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t}),n===s?(0,H.jsx)(ai,{className:`ml-auto size-3.5`}):null]},n)})},e.name))]})]})})]})}var zK=[{value:`off`,label:`thinking.off`},{value:`low`,label:`thinking.low`},{value:`high`,label:`thinking.high`},{value:`max`,label:`thinking.max`}];function BK(){let{t:e}=Nb(),t=Hb(),n=t.info?.thinking??`high`,r=zK.find(e=>e.value===n)?.label??`thinking.high`;function i(r){r!==n&&Gy(r).then(()=>{t.refreshInfo(),B.success(e(`thinking.changed`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)))}return(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`gap-1.5 text-muted-foreground`,title:e(`thinking.title`),children:[(0,H.jsx)(ri,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e(r)})]})}),(0,H.jsx)(kk,{align:`start`,side:`top`,children:zK.map(t=>(0,H.jsxs)(Ak,{onClick:()=>i(t.value),children:[e(t.label),t.value===n?(0,H.jsx)(ai,{className:`ml-auto size-3.5`}):null]},t.value))})]})}function VK({status:e}){return e===`completed`?(0,H.jsx)(ai,{className:`size-3.5 text-emerald-500`}):e===`in_progress`?(0,H.jsx)(Zi,{className:`size-3.5 animate-spin text-primary`}):(0,H.jsx)(_i,{className:`size-3.5 text-muted-foreground`})}function HK(){let{t:e}=Nb(),t=Hb();return t.todos.length===0?null:(0,H.jsxs)(`div`,{className:`mx-auto mb-2 max-w-3xl rounded-lg border bg-muted/20 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e(`todo.title`)}),(0,H.jsx)(`ul`,{className:`space-y-0.5`,children:t.todos.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(VK,{status:e.status}),(0,H.jsx)(`span`,{className:e.status===`completed`?`text-muted-foreground line-through`:``,children:e.content})]},t))})]})}function UK({sessionId:e,taskId:t,onClose:n}){let{t:r}=Nb(),[i,a]=(0,y.useState)([]),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(``);return(0,y.useEffect)(()=>{let n=!0,r=-1,i,o=async()=>{try{let c=await Wv(e,t,r);if(!n)return;r=c.cursor,s(c.task),l(``),a(e=>[...e,...c.records].slice(-1e3)),(c.records.length===100||c.task.status===`running`)&&(i=setTimeout(o,c.records.length===100?0:1e3))}catch(e){n&&l(e instanceof Error?e.message:String(e))}};return o(),()=>{n=!1,clearTimeout(i)}},[e,t]),(0,H.jsx)(Pk,{open:!0,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(Lk,{className:`w-full! overflow-hidden sm:max-w-2xl!`,children:[(0,H.jsxs)(Rk,{children:[(0,H.jsx)(zk,{children:o?.description??r(`task.loading`)}),(0,H.jsxs)(Bk,{children:[r(`task.events`),` · `,o?.model,` · `,t]})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-auto px-4 pb-6`,children:[c?(0,H.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:c}):null,o?(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[r(`task.${o.mode}`),` · `,r(`task.${o.status}`),o.parentCallId?` · ${o.parentCallId}`:``]}):null,i.map(e=>{let t=e.data.event;return(0,H.jsxs)(`article`,{className:`rounded-lg border p-3`,children:[(0,H.jsxs)(`header`,{className:`mb-2 text-xs text-muted-foreground`,children:[`#`,e.seq,` · `,t?.toolName??t?.type??e.type,` · `,new Date(e.time).toLocaleTimeString()]}),t?.message?.role===`assistant`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(AG,{content:t.message.content}),t.message.reasoning?(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:r(`ui.showThinking`)}),(0,H.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm`,children:t.message.reasoning})]}):null,t.message.toolCalls?.length?(0,H.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap break-words text-xs`,children:JSON.stringify(t.message.toolCalls,null,2)}):null]}):(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words text-xs`,children:t?.message?.content??e.data.result?.content??e.data.reason??e.type})]},e.seq)}),!c&&o&&!i.length?(0,H.jsx)(`p`,{children:r(`task.emptyEvents`)}):null]})]})})}function WK(){let{tasks:e,jobs:t,controlJob:n,sessionId:r}=Hb(),[i,a]=(0,y.useState)(null),{t:o}=Nb();return e.length?(0,H.jsxs)(`section`,{"aria-label":o(`task.title`),className:`space-y-2`,children:[(0,H.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(zi,{className:`size-4`}),o(`task.title`)]}),e.map(e=>{let r=t.find(t=>t.jobId===e.taskId);return(0,H.jsxs)(`details`,{className:`rounded-lg border bg-muted/20`,children:[(0,H.jsxs)(`summary`,{className:`flex cursor-pointer flex-wrap items-center gap-2 px-3 py-2 text-sm`,children:[e.status===`running`?(0,H.jsx)(Zi,{"aria-hidden":!0,className:`size-4 animate-spin`}):(0,H.jsx)(zi,{"aria-hidden":!0,className:`size-4`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.description}),(0,H.jsx)(GO,{variant:`outline`,children:o(`task.${e.mode}`)}),e.model?(0,H.jsx)(GO,{variant:`outline`,children:e.model}):null,r?.background?(0,H.jsx)(GO,{variant:`secondary`,children:o(`job.background`)}):null,(0,H.jsx)(`span`,{className:W(`text-xs text-muted-foreground`,e.status===`failed`&&`text-destructive`),children:o(`task.${e.status}`)})]}),(0,H.jsxs)(`div`,{className:`space-y-2 border-t px-3 py-2 text-xs`,children:[(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>a(e.taskId),children:o(`task.inspect`)}),(0,H.jsxs)(`p`,{className:`break-all font-mono text-muted-foreground`,children:[e.taskId,e.parentCallId?` · ${e.parentCallId}`:``]}),r?.status===`running`?(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[r.background?null:(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>n(e.taskId,`background`),children:o(`job.detach`)}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>n(e.taskId,`cancel`),children:o(`job.cancel`)})]}):null,e.activity?(0,H.jsx)(`p`,{children:e.activity}):null,e.reason?(0,H.jsx)(`p`,{className:`text-destructive`,children:e.reason}):null,e.content?(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words`,children:e.content}):null,(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:o(`task.detailsHint`)})]})]},e.taskId)}),i&&r?(0,H.jsx)(UK,{sessionId:r,taskId:i,onClose:()=>a(null)},`${r}/${i}`):null]}):null}function GK({emptyContent:e}={}){let{jobs:t,controlJob:n}=Hb(),r=t.filter(e=>e.kind===`shell`),{t:i}=Nb();return r.length?(0,H.jsxs)(`section`,{"aria-label":i(`job.title`),className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:i(`job.title`)}),r.map(e=>(0,H.jsxs)(`details`,{className:`rounded-lg border bg-muted/20`,children:[(0,H.jsxs)(`summary`,{className:`flex cursor-pointer flex-wrap items-center gap-2 px-3 py-2 text-sm`,children:[e.kind===`shell`?(0,H.jsx)(Fa,{className:`size-4`}):(0,H.jsx)(zi,{className:`size-4`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.description}),(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.background?i(`job.background`):i(`job.foreground`),` · `,i(`task.${e.status}`)]})]}),(0,H.jsxs)(`div`,{className:`space-y-2 border-t p-3 text-xs`,children:[(0,H.jsxs)(`p`,{className:`break-all font-mono text-muted-foreground`,children:[e.jobId,` · #`,e.lastSeq]}),e.status===`running`?(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[e.background?null:(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>n(e.jobId,`background`),children:i(`job.detach`)}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>n(e.jobId,`cancel`),children:i(`job.cancel`)}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>n(e.jobId,`status`),children:i(`job.result`)})]}):null,e.output?(0,H.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:e.output}):null,e.result===void 0?null:(0,H.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:JSON.stringify(e.result,null,2)})]})]},e.jobId))]}):e?(0,H.jsx)(`p`,{className:`rounded-lg border border-dashed p-3 text-xs text-muted-foreground`,children:e}):null}function KK({request:e}){let t=Hb(),{t:n}=Nb(),[r,i]=(0,y.useState)(e.input.questions.map(e=>({id:e.id,selected:[]}))),a=r.every(e=>e.selected.length>0||!!e.custom?.trim());return(0,H.jsxs)(`section`,{"aria-label":n(`ask.title`),className:`mx-auto mb-3 max-h-[50vh] max-w-3xl space-y-4 overflow-auto rounded-xl border bg-card p-4`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`ask.title`)}),e.input.questions.map((t,a)=>(0,H.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,H.jsxs)(`legend`,{className:`text-sm font-medium`,children:[t.header?`${t.header} · `:``,t.question]}),t.detail?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground whitespace-pre-wrap`,children:t.detail}):null,t.options?.map(n=>(0,H.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(`input`,{type:t.multiSelect?`checkbox`:`radio`,name:`${e.id}-${t.id}`,className:`mt-1`,checked:r[a].selected.includes(n.label),onChange:e=>i(r=>r.map((r,i)=>i===a?{...r,selected:t.multiSelect?e.target.checked?[...r.selected,n.label]:r.selected.filter(e=>e!==n.label):[n.label]}:r))}),(0,H.jsxs)(`span`,{children:[n.label,n.description?(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:n.description}):null]})]},n.label)),(0,H.jsx)(ZO,{"aria-label":`${t.question} · ${n(`ask.custom`)}`,placeholder:n(`ask.custom`),maxLength:8192,value:r[a].custom??``,onChange:e=>i(t=>t.map((t,n)=>n===a?{...t,custom:e.target.value}:t))})]},t.id)),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(K,{size:`sm`,disabled:!a,onClick:()=>t.answer({answers:r}),children:n(`ask.submit`)}),(0,H.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>t.answer(),children:n(`ask.cancel`)})]})]})}function qK(){let{question:e}=Hb();return e?(0,H.jsx)(KK,{request:e},e.id):null}function JK(e){return JSON.stringify(e,null,2)??`null`}var YK={entries:[],total:0};function XK({entry:e,busy:t}){let{locale:n,t:r}=Nb(),i=e.status===`success`?r(`toolLog.success`):e.status===`error`?r(`toolLog.error`):t&&e.startedAt!==null?r(`toolLog.running`):r(`toolLog.noResult`),a=e.status===`success`?pi:e.status===`error`?di:hi,o=e.startedAt!==null&&e.completedAt!==null?Math.max(0,e.completedAt-e.startedAt):null;return(0,H.jsxs)(`details`,{className:`group rounded-xl border bg-card open:shadow-sm`,children:[(0,H.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 px-3 py-2 marker:hidden hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,H.jsx)(a,{className:e.status===`error`?`size-4 shrink-0 text-destructive`:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-medium`,children:e.name}),(0,H.jsx)(GO,{variant:e.status===`error`?`destructive`:`secondary`,children:i})]}),(0,H.jsxs)(`div`,{className:`space-y-3 border-t px-3 py-3 text-xs`,children:[(0,H.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-muted-foreground`,children:[(0,H.jsx)(`dt`,{children:r(`toolLog.callId`)}),(0,H.jsx)(`dd`,{className:`break-all font-mono text-foreground`,children:e.callId}),e.turn===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:r(`toolLog.turn`)}),(0,H.jsx)(`dd`,{className:`text-foreground`,children:e.turn})]}),(0,H.jsx)(`dt`,{children:r(`toolLog.requested`)}),(0,H.jsx)(`dd`,{className:`text-foreground`,children:new Date(e.requestedAt).toLocaleString(n)}),e.startedAt===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:r(`toolLog.started`)}),(0,H.jsx)(`dd`,{className:`text-foreground`,children:new Date(e.startedAt).toLocaleString(n)})]}),e.completedAt===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:r(`toolLog.completed`)}),(0,H.jsx)(`dd`,{className:`text-foreground`,children:new Date(e.completedAt).toLocaleString(n)})]}),o===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:r(`toolLog.duration`)}),(0,H.jsxs)(`dd`,{className:`text-foreground`,children:[o,` ms`]})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`mb-1 font-medium`,children:r(`message.arguments`)}),(0,H.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-muted/50 p-2 font-mono whitespace-pre-wrap break-words`,children:JK(e.arguments)})]}),e.result===null?null:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`mb-1 font-medium`,children:r(`message.output`)}),(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md bg-muted/50 p-2 font-mono whitespace-pre-wrap break-words`,children:e.result})]})]})]})}function ZK({open:e,onOpenChange:t,sessionId:n,busy:r}){let{t:i}=Nb(),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(0),d=(0,y.useRef)(0),f=e&&n?`${n}:${r}:${l}`:null,p=a?.key===f?a.page:YK,m=f!==null&&a?.key!==f,h=f!==null&&s===f,g=a?.key===f&&a.error;(0,y.useEffect)(()=>{let e=++d.current;if(f&&n)return ly(n).then(t=>{d.current===e&&o({key:f,page:t,error:!1})}).catch(()=>{d.current===e&&o({key:f,page:YK,error:!0})}),()=>{d.current+=1}},[f,n]);async function _(){if(!n||!f||h||p.entries.length>=p.total)return;let e=d.current;c(f);try{let t=await ly(n,p.entries.length);d.current===e&&o(e=>e?.key===f?{key:f,error:!1,page:{total:t.total,entries:[...e.page.entries,...t.entries.filter(t=>!e.page.entries.some(e=>e.id===t.id))]}}:e)}catch{d.current===e&&o(e=>e?.key===f?{...e,error:!0}:e)}finally{c(e=>e===f?null:e)}}return(0,H.jsx)(Pk,{open:e,onOpenChange:t,children:(0,H.jsxs)(Lk,{className:`w-full sm:max-w-xl`,showCloseButton:!1,children:[(0,H.jsxs)(Rk,{className:`flex-row items-start justify-between gap-3 border-b`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,H.jsx)(zk,{children:i(`toolLog.title`)}),(0,H.jsx)(Bk,{children:i(`toolLog.description`)})]}),(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsx)(K,{variant:`ghost`,size:`icon`,title:i(`toolLog.refresh`),"aria-label":i(`toolLog.refresh`),disabled:!n||m,onClick:()=>u(e=>e+1),children:(0,H.jsx)(_a,{})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,title:i(`toolLog.close`),"aria-label":i(`toolLog.close`),onClick:()=>t(!1),children:(0,H.jsx)(Za,{})})]})]}),(0,H.jsxs)(Cb,{className:`min-h-0 flex-1 px-4 pb-4`,children:[n?null:(0,H.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:i(`toolLog.noSession`)}),m?(0,H.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,role:`status`,children:i(`toolLog.loading`)}):null,g?(0,H.jsx)(`p`,{className:`py-3 text-sm text-destructive`,role:`alert`,children:i(`toolLog.loadFailed`)}):null,!m&&!g&&n&&p.entries.length===0?(0,H.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:i(`toolLog.empty`)}):null,(0,H.jsx)(`div`,{className:`space-y-2 pt-3`,children:p.entries.map(e=>(0,H.jsx)(XK,{entry:e,busy:r},e.id))}),p.entries.length<p.total?(0,H.jsx)(K,{variant:`outline`,className:`mt-4 w-full`,disabled:h,onClick:()=>void _(),children:i(h?`toolLog.loading`:`toolLog.loadMore`)}):null]})]})})}var QK=1e3,$K=3e3;function eq(e,t){return[...new Map([...e,...t].map(e=>[e.seq,e])).values()].sort((e,t)=>e.seq-t.seq).slice(-1e3)}function tq(e){let[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(0),p=(0,y.useRef)(-1),m=(0,y.useRef)(null),h=(0,y.useRef)(!1);(0,y.useEffect)(()=>{if(!e)return;let t=e,r=new AbortController;m.current=r;let a;async function s(){let e=$K;try{let a=p.current<0,s=await Fv(t,a?{}:{after:p.current},r.signal);if(r.signal.aborted)return;let l=s.records.at(-1);l&&(p.current=l.seq,n(e=>eq(e,s.records))),a&&c(s.hasOlder),i(!0),o(!1),s.hasNewer&&(e=0)}catch(e){if(r.signal.aborted||(o(!0),e instanceof Zv))return}r.signal.aborted||(a=setTimeout(()=>{s()},e))}return s(),()=>{r.abort(),clearTimeout(a),m.current=null}},[e,d]);async function g(){let r=m.current,i=t[0];if(!(!e||!i||!r||h.current||t.length>=1e3)){h.current=!0,u(!0);try{let t=await Fv(e,{before:i.seq},r.signal);if(r.signal.aborted)return;n(e=>eq(e,t.records)),c(t.hasOlder),o(!1)}catch{r.signal.aborted||o(!0)}finally{h.current=!1,u(!1)}}}return{records:t,ready:r,error:a,hasOlder:s,loadingOlder:l,loadOlder:g,refresh:()=>f(e=>e+1)}}var nq=[`user`,`model`,`assistant`,`tool`,`task`,`compaction`,`session`],rq={user:$i,model:qr,assistant:ti,tool:Ya,task:zi,compaction:Da,session:Ca};function iq({sessionId:e}){let{t,locale:n}=Nb(),r=tq(e),[i,a]=(0,y.useState)(`all`),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(new Map),d=(0,y.useRef)(!0),f=(0,y.useMemo)(()=>{let e=o.trim().toLowerCase();return r.records.filter(t=>(i===`all`||t.kind===i)&&(!e||`${t.seq} ${t.type} ${t.label} ${t.preview}`.toLowerCase().includes(e)))},[r.records,i,o]),p=f.find(e=>e.seq===c)??f.at(-1),m=f.slice(-100),h=e=>new Date(e).toLocaleString(n);return(0,y.useEffect)(()=>{if(c===null&&d.current){let e=f.at(-1);e&&u.current.get(e.seq)?.scrollIntoView({block:`nearest`})}},[f,c]),(0,H.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":t(`trajectory.title`),children:[(0,H.jsxs)(`div`,{className:`space-y-3 border-b p-3 sm:p-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:t(`trajectory.title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`trajectory.description`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(K,{variant:`ghost`,size:`sm`,onClick:()=>{d.current=!0,l(null);let e=f.at(-1);e&&u.current.get(e.seq)?.scrollIntoView({block:`nearest`})},children:t(`trajectory.latest`)}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,onClick:r.refresh,disabled:!e,title:t(`toolLog.refresh`),"aria-label":t(`toolLog.refresh`),children:(0,H.jsx)(_a,{})})]})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[`all`,...nq].map(e=>(0,H.jsx)(K,{size:`sm`,variant:i===e?`secondary`:`ghost`,onClick:()=>a(e),children:t(`trajectory.${e}`)},e))}),(0,H.jsx)(Sb,{value:o,onChange:e=>s(e.target.value),placeholder:t(`trajectory.search`),"aria-label":t(`trajectory.search`)}),m.length>0?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`mb-1 text-xs text-muted-foreground`,children:t(`trajectory.timeline`,{count:m.length})}),(0,H.jsx)(`div`,{className:`flex gap-0.5 overflow-x-auto py-1`,"aria-label":t(`trajectory.timelineLabel`),children:m.map(e=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":p?.seq===e.seq,"aria-label":`#${e.seq} ${e.label} ${h(e.time)}`,title:`#${e.seq} · ${e.type} · ${h(e.time)}`,className:W(`h-6 min-w-2 flex-1 rounded-sm bg-muted-foreground/25 hover:bg-primary/60 focus-visible:outline-2 focus-visible:outline-ring`,e.failed&&`bg-destructive/60`,p?.seq===e.seq&&`bg-primary`),onClick:()=>{l(e.seq),u.current.get(e.seq)?.scrollIntoView({block:`nearest`})}},e.seq))})]}):null]}),r.error?(0,H.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-xs text-destructive`,children:t(`trajectory.loadFailed`)}):null,e?!r.ready&&!r.error?(0,H.jsx)(`p`,{role:`status`,className:`p-6 text-sm text-muted-foreground`,children:t(`toolLog.loading`)}):null:(0,H.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:t(`toolLog.noSession`)}),(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[(0,H.jsx)(Cb,{className:`min-h-0 flex-1`,onScrollCapture:e=>{let t=e.target;d.current=t.scrollHeight-t.scrollTop-t.clientHeight<40},children:(0,H.jsxs)(`div`,{className:`space-y-1 p-3`,children:[r.hasOlder&&r.records.length<1e3?(0,H.jsx)(K,{variant:`outline`,className:`mb-2 w-full`,disabled:r.loadingOlder,onClick:()=>void r.loadOlder(),children:r.loadingOlder?t(`toolLog.loading`):t(`trajectory.older`)}):null,r.records.length>=1e3?(0,H.jsx)(`p`,{className:`p-2 text-xs text-muted-foreground`,children:t(`trajectory.windowLimit`,{count:QK})}):null,r.ready&&f.length===0?(0,H.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:t(`trajectory.empty`)}):null,f.map(e=>{let n=rq[e.kind];return(0,H.jsxs)(`button`,{type:`button`,ref:t=>{t?u.current.set(e.seq,t):u.current.delete(e.seq)},onClick:()=>l(e.seq),"aria-pressed":p?.seq===e.seq,className:W(`flex w-full items-start gap-2 rounded-lg border border-transparent p-2 text-left hover:bg-muted/50 focus-visible:outline-2 focus-visible:outline-ring`,p?.seq===e.seq&&`border-border bg-muted/50`),children:[(0,H.jsx)(n,{className:W(`mt-0.5 size-4 shrink-0 text-muted-foreground`,e.failed&&`text-destructive`)}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,H.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`#`,e.seq,` · `,e.type]}),e.failed?(0,H.jsx)(`span`,{className:`text-xs text-destructive`,children:t(`toolLog.error`)}):null]}),(0,H.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.preview}),(0,H.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[h(e.time),e.durationMs===null?``:` · ${e.durationMs} ms`]})]})]},e.seq)})]})}),p?(0,H.jsxs)(`div`,{className:`flex max-h-[45vh] min-h-0 flex-col border-t md:max-h-none md:w-[42%] md:border-t-0 md:border-l`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b p-3`,children:[(0,H.jsxs)(`h3`,{className:`truncate text-sm font-medium`,children:[`#`,p.seq,` · `,p.label]}),(0,H.jsx)(K,{size:`icon`,variant:`ghost`,title:t(`trajectory.copy`),"aria-label":t(`trajectory.copy`),onClick:()=>{navigator.clipboard.writeText(p.details).then(()=>B.success(t(`trajectory.copied`))).catch(()=>B.error(t(`trajectory.copyFailed`)))},children:(0,H.jsx)(xi,{})})]}),(0,H.jsxs)(Cb,{className:`min-h-0 flex-1 p-3`,children:[(0,H.jsxs)(`dl`,{className:`mb-3 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`trajectory.type`)}),(0,H.jsx)(`dd`,{className:`break-all font-mono`,children:p.type}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`trajectory.time`)}),(0,H.jsx)(`dd`,{children:h(p.time)}),p.turn===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`toolLog.turn`)}),(0,H.jsx)(`dd`,{children:p.turn})]}),p.durationMs===null?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`toolLog.duration`)}),(0,H.jsxs)(`dd`,{children:[p.durationMs,` ms`]})]})]}),(0,H.jsx)(`h4`,{className:`mb-2 text-xs font-medium`,children:t(`trajectory.data`)}),p.truncated?(0,H.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:t(`trajectory.truncated`)}):null,(0,H.jsx)(`pre`,{className:`rounded-md bg-muted/50 p-3 font-mono text-xs whitespace-pre-wrap break-words`,children:p.details})]})]}):null]})]})}function aq(e){let t=new Map,n=new Map,r=new Set;return e.forEach((e,i)=>{if(e.role===`assistant`)for(let n of e.toolCalls??[])t.set(n.id,i);if(e.role!==`tool`||!e.toolCallId)return;let a=t.get(e.toolCallId);if(a===void 0)return;t.delete(e.toolCallId);let o=n.get(a);o||(o=new Map,n.set(a,o)),o.set(e.toolCallId,e),r.add(i)}),{results:n,attached:r}}function oq(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;for(let e of[`file_path`,`path`,`pattern`,`command`,`url`,`description`])if(typeof t[e]==`string`&&t[e])return t[e].replace(/\s+/g,` `).slice(0,120)}var sq=[{name:`reload`,label:`command.reload`},{name:`compact`,label:`command.compact`},{name:`loop`,label:`command.loop`}];function cq(e,t,n){if(t===`glob`||t===`grep`)try{let r=JSON.parse(n);if(Array.isArray(r.matches))return e(t===`glob`?`message.files`:`message.matches`,{count:r.matches.length})}catch{}let r=n.split(`
110
+ `)[0]??``;return r.length>80?`${r.slice(0,80)}…`:r}function lq({calls:e,results:t,busy:n,showDetails:r,t:i}){return e.length===0?null:(0,H.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let a=t?.get(e.id),o=a?.failed?i(`message.failed`):i(a?`message.completed`:n?`message.working`:`message.unknown`),s=oq(e.arguments),c=a?cq(i,e.name,a.content):``,l=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ya,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`shrink-0 font-mono`,children:e.name}),s&&(0,H.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,title:s,children:s}),(0,H.jsx)(`span`,{className:W(`ml-auto shrink-0`,a?.failed?`text-destructive`:`text-muted-foreground`),children:o})]});return r?(0,H.jsxs)(`details`,{className:`rounded-md border bg-muted/20 text-xs`,children:[(0,H.jsx)(`summary`,{className:`flex min-w-0 cursor-pointer items-center gap-2 px-3 py-1.5`,children:l}),(0,H.jsxs)(`div`,{className:`space-y-2 border-t px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground`,children:i(`message.arguments`)}),(0,H.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono`,children:JSON.stringify(e.arguments??{},null,2)}),(0,H.jsx)(`div`,{className:`text-muted-foreground`,children:i(`message.output`)}),(0,H.jsx)(`pre`,{className:W(`max-h-80 overflow-auto whitespace-pre-wrap break-all font-mono`,a?.failed&&`text-destructive`),children:a?.content??o})]})]},e.id):(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 rounded-md border bg-muted/20 px-3 py-1.5 text-xs`,children:[l,a&&(0,H.jsx)(`span`,{className:W(`w-full truncate pl-5`,a.failed?`text-destructive`:`text-muted-foreground`),children:c})]},e.id)})})}function uq({message:e,t}){return(0,H.jsxs)(`details`,{className:W(`rounded-md border bg-muted/20`,e.failed&&`border-destructive/50`),children:[(0,H.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-3 py-1.5 text-xs`,children:[(0,H.jsx)(Fa,{className:`size-3 shrink-0`}),(0,H.jsx)(`span`,{className:`font-mono`,children:e.name}),(0,H.jsxs)(`span`,{className:W(`truncate`,e.failed?`text-destructive`:`text-muted-foreground`),children:[e.failed?`${t(`message.failed`)} · `:``,cq(t,e.name,e.content)]})]}),(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto px-3 pb-2 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:e.content})]})}function dq({message:e,index:t,showThinking:n,showTools:r,onBranch:i,onFeedback:a,feedback:o,toolResults:s,busy:c}){let{t:l}=Nb(),[u,d]=(0,y.useState)(!1),f=e.role===`user`,p=e.role===`tool`;return(0,H.jsxs)(`div`,{className:`group flex gap-3.5`,children:[(0,H.jsx)(`div`,{className:W(`mt-0.5 grid size-7 shrink-0 place-items-center rounded-full ring-1 ring-border`,f?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:f?(0,H.jsx)(qa,{className:`size-3.5`}):p?(0,H.jsx)(Fa,{className:`size-3.5`}):(0,H.jsx)(ri,{className:`size-3.5`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:f?l(`message.you`):p?l(`message.tool`,{name:e.name??``}):l(`message.assistant`)}),e.reasoning&&n?(0,H.jsx)(KO,{className:`gap-0 border-dashed bg-muted/30 py-0 shadow-none`,children:(0,H.jsx)(XO,{className:`px-3 py-2`,children:(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:l(`message.reasoning`)}),(0,H.jsx)(`pre`,{className:`mt-1 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:e.reasoning})]})})}):null,e.content?p?r?(0,H.jsx)(uq,{message:e,t:l}):(0,H.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.failed?`${l(`message.failed`)} · `:``,cq(l,e.name,e.content)]}):f?(0,H.jsx)(`div`,{className:`text-sm leading-relaxed whitespace-pre-wrap`,children:e.content}):(0,H.jsx)(AG,{content:e.content}):null,e.toolCalls&&e.toolCalls.length>0?(0,H.jsx)(lq,{calls:e.toolCalls,results:s,busy:c,showDetails:r,t:l}):null,p?null:(0,H.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100`,children:[!f&&e.content?(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-6`,title:l(u?`message.copied`:`message.copy`),onClick:()=>{navigator.clipboard.writeText(e.content),d(!0),B.success(l(`message.copied`)),setTimeout(()=>d(!1),1500)},children:u?(0,H.jsx)(ai,{className:`size-3`}):(0,H.jsx)(xi,{className:`size-3`})}):null,(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-6`,title:l(`message.branch`),onClick:()=>i(t),children:(0,H.jsx)(zi,{className:`size-3`})}),!f&&e.content?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:W(`size-6`,o===`up`&&`text-primary`),title:l(`message.good`),onClick:()=>a(t,`up`),children:(0,H.jsx)(Va,{className:`size-3`})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:W(`size-6`,o===`down`&&`text-destructive`),title:l(`message.bad`),onClick:()=>a(t,`down`),children:(0,H.jsx)(za,{className:`size-3`})})]}):null]})]})]})}function fq(){let{t:e}=Nb(),t=Hb(),n=Ot(),{id:r}=Nt(),{openRightSidebar:i}=jt(),a=t.draft,o=t.setDraft,[s,c]=(0,y.useState)({}),l=t.sessionId??`new`,u=s[l]??[],d=e=>c(t=>({...t,[l]:typeof e==`function`?e(t[l]??[]):e})),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(`chat`),[v,b]=(0,y.useState)({}),x=(0,y.useRef)(null);(0,y.useEffect)(()=>{r&&t.openSession(r)},[r,t.openSession]),(0,y.useEffect)(()=>{let e=t.sessionId;if(!e){b({});return}let n=!0;return ay(e).then(e=>{n&&b(e)}).catch(()=>{n&&b({})}),()=>{n=!1}},[t.sessionId]),(0,y.useEffect)(()=>{!r&&t.sessionId&&n(`/${t.sessionId}`,{replace:!0})},[r,t.sessionId,n]),(0,y.useEffect)(()=>{if(!t.sessionId){p(null);return}let e=!1;return ry(t.sessionId).then(t=>{e||p({used:t.used,limit:t.limit})}).catch(()=>{}),()=>{e=!0}},[t.sessionId,t.messages.length,t.info?.modelId]);async function S(t){if(t&&t.length!==0){if(t.length+u.length>16){B.error(e(`upload.limit`));return}try{let e=await Promise.all(Array.from(t,e=>Wy(e)));d(t=>[...t,...e])}catch(t){B.error(t instanceof Error?t.message:e(`upload.failed`))}}}let C=()=>{let n=a.trim();if(n.length===0)return;if(t.busy&&(n===`/reload`||n===`/compact`)){B.error(e(`queue.commandBusy`));return}if(n===`/loop`||n.startsWith(`/loop `)){let r=n.slice(5).trim();if(r.length===0){B.error(e(`loop.usage`));return}let i=u.map(e=>e.path);o(``),d([]),t.send(n,i,{args:r});return}if(n===`/reload`){o(``),Yy().then(()=>{t.refreshInfo(),B.success(e(`settings.reloadDone`))}).catch(e=>B.error(e instanceof Error?e.message:String(e)));return}if(n===`/compact`){if(o(``),!t.sessionId){B.error(e(`compact.none`));return}qy(t.sessionId).then(n=>{B.success(n.compacted?e(`compact.done`):e(`compact.none`)),t.refreshInfo()}).catch(e=>B.error(e instanceof Error?e.message:String(e)));return}let r=u.map(e=>e.path);o(``),d([]),t.send(n,r)};function w(e){Ky(e).then(()=>t.refreshInfo()).catch(e=>B.error(e instanceof Error?e.message:String(e)))}let T=t.info?.expandThinking??!1,E=t.info?.expandTools??!1,D=(0,y.useMemo)(()=>aq(t.messages),[t.messages]);async function O(r){let i=t.sessionId;if(i)try{let{sessionId:a}=await iy(i,r);B.success(e(`message.branched`)),n(`/${a}`),t.openSession(a)}catch(e){B.error(e instanceof Error?e.message:String(e))}}function k(e,n){let r=t.sessionId;if(!r)return;let i=v[e]===n?null:n;b(t=>{let n={...t};return i?n[e]=i:delete n[e],n}),oy(r,e,i).catch(e=>B.error(e instanceof Error?e.message:String(e)))}let A=t.messages.length===0,j=A&&g===`chat`,M=t.info?.project?.name??t.info?.workspace?.split(/[\\/]/).filter(Boolean).at(-1)??e(`workspace.title`),N=a.startsWith(`/`)&&!a.includes(` `)?sq.filter(e=>e.name.startsWith(a.slice(1))):[];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 gap-1 border-b px-3 py-2`,children:[(0,H.jsxs)(K,{size:`sm`,variant:g===`chat`?`secondary`:`ghost`,"aria-pressed":g===`chat`,onClick:()=>_(`chat`),children:[(0,H.jsx)($i,{}),e(`trajectory.chat`)]}),(0,H.jsxs)(K,{size:`sm`,variant:g===`trajectory`?`secondary`:`ghost`,"aria-pressed":g===`trajectory`,onClick:()=>_(`trajectory`),children:[(0,H.jsx)(qr,{}),e(`trajectory.title`)]}),(0,H.jsxs)(K,{size:`sm`,variant:`ghost`,onClick:()=>i(`files`),children:[(0,H.jsx)(Yi,{}),e(`workspace.title`)]})]}),g===`trajectory`?(0,H.jsx)(iq,{sessionId:t.sessionId},t.sessionId??`new`):A?null:(0,H.jsx)(Cb,{className:`min-h-0 flex-1`,children:(0,H.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-6 p-6`,children:[t.messages.map((e,n)=>e.role===`system`||D.attached.has(n)?null:(0,H.jsx)(dq,{message:e,index:n,showThinking:T,showTools:E,onBranch:O,onFeedback:k,feedback:v[n],toolResults:D.results.get(n),busy:t.busy},n)),(0,H.jsx)(WK,{}),(0,H.jsx)(GK,{}),t.partial?(0,H.jsxs)(`div`,{"aria-live":`off`,"aria-label":e(`stream.live`),className:`min-w-0`,children:[t.partial.reasoning?(0,H.jsxs)(`details`,{open:T,className:`mb-3 rounded-lg border p-3`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-sm text-muted-foreground`,children:e(`ui.showThinking`)}),(0,H.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap break-words text-sm text-muted-foreground`,children:t.partial.reasoning})]}):null,(0,H.jsx)(AG,{content:t.partial.content})]}):null,t.busy?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`size-2 animate-pulse rounded-full bg-primary`}),e(`message.working`)]}):null]})}),(0,H.jsxs)(`div`,{className:W(j?`flex min-h-0 flex-1 flex-col justify-center overflow-y-auto px-4 py-8 sm:px-8`:`shrink-0 border-t bg-background/60 p-3 backdrop-blur sm:p-4`),children:[j?(0,H.jsxs)(`div`,{className:`mx-auto mb-6 flex w-full max-w-[850px] flex-col gap-6`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-center gap-3`,children:[(0,H.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-xl bg-primary text-lg font-semibold text-primary-foreground`,"aria-hidden":`true`,children:`R`}),(0,H.jsx)(pA,{}),(0,H.jsx)(GO,{variant:`secondary`,className:`text-[10px]`,children:`RingKo`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,H.jsxs)(K,{variant:`ghost`,size:`sm`,className:`min-w-0 max-w-full text-muted-foreground`,onClick:()=>i(`files`),title:t.info?.workspace,children:[(0,H.jsx)(Li,{className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:M})]}),(0,H.jsx)(_A,{})]})]}):null,t.loop?(0,H.jsxs)(`div`,{"aria-live":`off`,className:`mx-auto mb-2 flex w-full max-w-3xl items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`inline-block size-2 animate-pulse rounded-full bg-primary`,"aria-hidden":`true`}),(0,H.jsxs)(`span`,{children:[e(`loop.running`,{iteration:t.loop.iteration}),t.loop.maxIterations>0?` / ${t.loop.maxIterations}`:``,t.loop.promise?` → ${t.loop.promise}`:``]})]}):null,(0,H.jsx)(HK,{}),(0,H.jsx)(qK,{}),(0,H.jsx)(gA,{},t.sessionId??`new`),(0,H.jsxs)(`div`,{className:W(`mx-auto w-full rounded-2xl border bg-card shadow-sm transition-all focus-within:ring-2 focus-within:ring-ring/40`,j?`max-w-[850px]`:`max-w-3xl`),children:[N.length>0?(0,H.jsx)(`div`,{className:`flex flex-col gap-0.5 px-2 pt-2`,children:N.map(t=>(0,H.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 rounded-md px-2 py-1 text-left text-xs transition-colors hover:bg-accent`,onClick:()=>o(`/${t.name}`),children:[(0,H.jsxs)(`span`,{className:`font-mono text-foreground`,children:[`/`,t.name]}),(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:e(t.label)})]},t.name))}):null,u.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5 px-3 pt-3`,children:u.map(e=>(0,H.jsxs)(GO,{variant:`secondary`,className:`gap-1 rounded-full font-normal`,children:[(0,H.jsx)(la,{className:`size-3`}),e.name,(0,H.jsx)(`button`,{type:`button`,className:`ml-0.5 rounded-full hover:text-foreground`,onClick:()=>d(t=>t.filter(t=>t.path!==e.path)),children:(0,H.jsx)(Za,{className:`size-3`})})]},e.path))}):null,(0,H.jsx)(ZO,{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},rows:j?2:1,"aria-label":e(`composer.placeholder`),placeholder:e(`composer.placeholder`),className:`min-h-11 resize-none border-0 bg-transparent px-4 pt-3 shadow-none focus-visible:ring-0`}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-2 pt-1 pb-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[j?null:(0,H.jsx)(RK,{}),(0,H.jsx)(BK,{}),j?null:(0,H.jsx)(_A,{}),(0,H.jsx)(hA,{}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-8`,title:e(`ui.showThinking`),onClick:()=>w({expandThinking:!T}),children:(0,H.jsx)(ri,{className:T?`size-3.5 text-primary`:`size-3.5`})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-8`,title:e(`ui.showTools`),onClick:()=>w({expandTools:!E}),children:(0,H.jsx)(Ya,{className:E?`size-3.5 text-primary`:`size-3.5`})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-8`,title:e(`toolLog.title`),"aria-label":e(`toolLog.title`),disabled:!t.sessionId,onClick:()=>h(!0),children:(0,H.jsx)(Yi,{className:`size-3.5`})}),(0,H.jsx)(K,{variant:`ghost`,size:`icon`,className:`size-8`,title:e(`upload.attach`),onClick:()=>x.current?.click(),children:(0,H.jsx)(la,{className:`size-3.5`})}),(0,H.jsx)(`input`,{ref:x,type:`file`,multiple:!0,hidden:!0,onChange:e=>{S(e.target.files),e.target.value=``}})]}),(0,H.jsxs)(`div`,{className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[j?(0,H.jsx)(RK,{}):null,(()=>{let e=f??t.info?.context;return e?(0,H.jsx)(xA,{used:e.used,limit:e.limit}):null})(),t.busy?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{variant:`outline`,size:`icon`,className:`rounded-full`,onClick:t.stop,title:e(`composer.stop`),children:(0,H.jsx)(ka,{})}),(0,H.jsx)(K,{size:`icon`,className:`rounded-full`,onClick:C,disabled:!a.trim(),title:e(`queue.add`),"aria-label":e(`queue.add`),children:(0,H.jsx)($r,{})})]}):(0,H.jsx)(K,{size:`icon`,className:`rounded-full`,onClick:C,disabled:a.trim().length===0,title:e(`composer.send`),children:(0,H.jsx)($r,{})})]})]})]}),j?null:(0,H.jsx)(`p`,{className:`mx-auto mt-2 max-w-3xl text-center text-[11px] text-muted-foreground`,children:e(`composer.hint`)})]}),(0,H.jsx)(ZK,{open:m,onOpenChange:h,sessionId:t.sessionId,busy:t.busy})]})}function pq(){let{locale:e,setLocale:t,t:n}=Nb();return(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`icon`,title:n(`language.toggle`),children:[(0,H.jsx)(Gi,{className:`size-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:n(`language.toggle`)})]})}),(0,H.jsx)(kk,{align:`end`,children:Db.map(n=>(0,H.jsx)(Ak,{onClick:()=>t(n.value),disabled:n.value===e,children:n.label},n.value))})]})}function mq(){let{setTheme:e}=E(),{t}=Nb();return(0,H.jsxs)(Dk,{children:[(0,H.jsx)(Ok,{asChild:!0,children:(0,H.jsxs)(K,{variant:`ghost`,size:`icon`,title:t(`theme.toggle`),children:[(0,H.jsx)(Na,{className:`size-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),(0,H.jsx)(ta,{className:`absolute size-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`}),(0,H.jsx)(`span`,{className:`sr-only`,children:t(`theme.toggle`)})]})}),(0,H.jsxs)(kk,{align:`end`,children:[(0,H.jsx)(Ak,{onClick:()=>e(`light`),children:t(`theme.light`)}),(0,H.jsx)(Ak,{onClick:()=>e(`dark`),children:t(`theme.dark`)}),(0,H.jsx)(Ak,{onClick:()=>e(`system`),children:t(`theme.system`)})]})]})}function hq(){let{t:e}=Nb(),t=Hb(),n=Ot(),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),l=t.info?.auth.required??!1;async function u(){let i=r.trim();if(i.length===0||s)return;c(!0),o(null);let a=await Xy(i).catch(()=>!1);if(c(!1),!a){o(e(`login.error`));return}$v(i),t.refreshInfo(),n(`/`)}return(0,H.jsxs)(`div`,{className:`grid h-svh place-items-center bg-background p-6`,children:[(0,H.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1`,children:[(0,H.jsx)(pq,{}),(0,H.jsx)(mq,{})]}),(0,H.jsxs)(KO,{className:`w-full max-w-sm`,children:[(0,H.jsxs)(qO,{children:[(0,H.jsx)(JO,{children:e(`login.title`)}),(0,H.jsx)(YO,{children:e(l?`login.description`:`login.disabled`)})]}),(0,H.jsx)(XO,{className:`space-y-3`,children:l?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Sb,{type:`password`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u()},placeholder:e(`login.token`),autoFocus:!0}),a?(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:a}):null,(0,H.jsx)(K,{className:`w-full`,onClick:()=>void u(),disabled:s||r.trim().length===0,children:e(`login.submit`)})]}):(0,H.jsx)(K,{className:`w-full`,onClick:()=>n(`/`),children:e(`nav.chat`)})})]})]})}function gq(){return(0,H.jsx)(Ev,{children:(0,H.jsx)(Wn,{children:(0,H.jsxs)(Vb,{children:[(0,H.jsxs)(on,{children:[(0,H.jsx)(rn,{path:`/auth/login`,element:(0,H.jsx)(hq,{})}),(0,H.jsxs)(rn,{element:(0,H.jsx)(uA,{}),children:[(0,H.jsx)(rn,{index:!0,element:(0,H.jsx)(fq,{})}),(0,H.jsx)(rn,{path:`:id`,element:(0,H.jsx)(fq,{})}),(0,H.jsx)(rn,{path:`settings`,element:(0,H.jsx)(tn,{to:`/`,replace:!0})}),(0,H.jsx)(rn,{path:`settings/:page`,element:(0,H.jsx)(tn,{to:`/`,replace:!0})})]}),(0,H.jsx)(rn,{path:`*`,element:(0,H.jsx)(tn,{to:`/`,replace:!0})})]}),(0,H.jsx)($a,{})]})})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(y.StrictMode,{children:(0,H.jsx)(D,{attribute:`class`,defaultTheme:`dark`,enableSystem:!0,disableTransitionOnChange:!0,children:(0,H.jsx)(Mb,{children:(0,H.jsx)(gq,{})})})}));export{l as a,u as i,o as n,s as r,L as t};