@aprovan/patchwork-chat 0.1.0-dev.6bd527d → 0.1.0-dev.f456953

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 (308) hide show
  1. package/.turbo/turbo-build.log +303 -6
  2. package/.utcp_config.json +17 -1
  3. package/dist/assets/abap-BdImnpbu.js +1 -0
  4. package/dist/assets/actionscript-3-CoDkCxhg.js +1 -0
  5. package/dist/assets/ada-bCR0ucgS.js +1 -0
  6. package/dist/assets/andromeeda-C4gqWexZ.js +1 -0
  7. package/dist/assets/angular-html-CU67Zn6k.js +1 -0
  8. package/dist/assets/angular-ts-BwZT4LLn.js +1 -0
  9. package/dist/assets/apache-Pmp26Uib.js +1 -0
  10. package/dist/assets/apex-D8_7TLub.js +1 -0
  11. package/dist/assets/apl-dKokRX4l.js +1 -0
  12. package/dist/assets/applescript-Co6uUVPk.js +1 -0
  13. package/dist/assets/ara-BRHolxvo.js +1 -0
  14. package/dist/assets/asciidoc-Dv7Oe6Be.js +1 -0
  15. package/dist/assets/asm-D_Q5rh1f.js +1 -0
  16. package/dist/assets/astro-CbQHKStN.js +1 -0
  17. package/dist/assets/aurora-x-D-2ljcwZ.js +1 -0
  18. package/dist/assets/awk-DMzUqQB5.js +1 -0
  19. package/dist/assets/ayu-dark-CMjwMIkn.js +1 -0
  20. package/dist/assets/ayu-light-C47S-Tmv.js +1 -0
  21. package/dist/assets/ayu-mirage-CjoLj4QM.js +1 -0
  22. package/dist/assets/ballerina-BFfxhgS-.js +1 -0
  23. package/dist/assets/bat-BkioyH1T.js +1 -0
  24. package/dist/assets/beancount-k_qm7-4y.js +1 -0
  25. package/dist/assets/berry-uYugtg8r.js +1 -0
  26. package/dist/assets/bibtex-CHM0blh-.js +1 -0
  27. package/dist/assets/bicep-Bmn6On1c.js +1 -0
  28. package/dist/assets/blade-D4QpJJKB.js +1 -0
  29. package/dist/assets/bsl-BO_Y6i37.js +1 -0
  30. package/dist/assets/c-BIGW1oBm.js +1 -0
  31. package/dist/assets/c3-VCDPK7BO.js +1 -0
  32. package/dist/assets/cadence-Bv_4Rxtq.js +1 -0
  33. package/dist/assets/cairo-KRGpt6FW.js +1 -0
  34. package/dist/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  35. package/dist/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  36. package/dist/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  37. package/dist/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  38. package/dist/assets/clarity-D53aC0YG.js +1 -0
  39. package/dist/assets/clojure-P80f7IUj.js +1 -0
  40. package/dist/assets/cmake-D1j8_8rp.js +1 -0
  41. package/dist/assets/cobol-nwyudZeR.js +1 -0
  42. package/dist/assets/codeowners-Bp6g37R7.js +1 -0
  43. package/dist/assets/codeql-DsOJ9woJ.js +1 -0
  44. package/dist/assets/coffee-Ch7k5sss.js +1 -0
  45. package/dist/assets/common-lisp-Cg-RD9OK.js +1 -0
  46. package/dist/assets/coq-DkFqJrB1.js +1 -0
  47. package/dist/assets/cpp-CofmeUqb.js +1 -0
  48. package/dist/assets/crystal-tKQVLTB8.js +1 -0
  49. package/dist/assets/csharp-COcwbKMJ.js +1 -0
  50. package/dist/assets/css-DPfMkruS.js +1 -0
  51. package/dist/assets/csv-fuZLfV_i.js +1 -0
  52. package/dist/assets/cue-D82EKSYY.js +1 -0
  53. package/dist/assets/cypher-COkxafJQ.js +1 -0
  54. package/dist/assets/d-85-TOEBH.js +1 -0
  55. package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
  56. package/dist/assets/dart-CF10PKvl.js +1 -0
  57. package/dist/assets/dax-CEL-wOlO.js +1 -0
  58. package/dist/assets/desktop-BmXAJ9_W.js +1 -0
  59. package/dist/assets/diff-D97Zzqfu.js +1 -0
  60. package/dist/assets/docker-BcOcwvcX.js +1 -0
  61. package/dist/assets/dotenv-Da5cRb03.js +1 -0
  62. package/dist/assets/dracula-BzJJZx-M.js +1 -0
  63. package/dist/assets/dracula-soft-BXkSAIEj.js +1 -0
  64. package/dist/assets/dream-maker-BtqSS_iP.js +1 -0
  65. package/dist/assets/edge-BkV0erSs.js +1 -0
  66. package/dist/assets/elixir-CDX3lj18.js +1 -0
  67. package/dist/assets/elm-DbKCFpqz.js +1 -0
  68. package/dist/assets/emacs-lisp-C9XAeP06.js +1 -0
  69. package/dist/assets/erb-CgJxNhIT.js +1 -0
  70. package/dist/assets/erlang-DsQrWhSR.js +1 -0
  71. package/dist/assets/everforest-dark-BgDCqdQA.js +1 -0
  72. package/dist/assets/everforest-light-C8M2exoo.js +1 -0
  73. package/dist/assets/fennel-BYunw83y.js +1 -0
  74. package/dist/assets/fish-BvzEVeQv.js +1 -0
  75. package/dist/assets/fluent-C4IJs8-o.js +1 -0
  76. package/dist/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  77. package/dist/assets/fortran-free-form-BxgE0vQu.js +1 -0
  78. package/dist/assets/fsharp-CXgrBDvD.js +1 -0
  79. package/dist/assets/gdresource-BOOCDP_w.js +1 -0
  80. package/dist/assets/gdscript-C5YyOfLZ.js +1 -0
  81. package/dist/assets/gdshader-DkwncUOv.js +1 -0
  82. package/dist/assets/genie-D0YGMca9.js +1 -0
  83. package/dist/assets/gherkin-DyxjwDmM.js +1 -0
  84. package/dist/assets/git-commit-F4YmCXRG.js +1 -0
  85. package/dist/assets/git-rebase-r7XF79zn.js +1 -0
  86. package/dist/assets/github-dark-DHJKELXO.js +1 -0
  87. package/dist/assets/github-dark-default-Cuk6v7N8.js +1 -0
  88. package/dist/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  89. package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  90. package/dist/assets/github-light-DAi9KRSo.js +1 -0
  91. package/dist/assets/github-light-default-D7oLnXFd.js +1 -0
  92. package/dist/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  93. package/dist/assets/gleam-BspZqrRM.js +1 -0
  94. package/dist/assets/glimmer-js-Rg0-pVw9.js +1 -0
  95. package/dist/assets/glimmer-ts-U6CK756n.js +1 -0
  96. package/dist/assets/glsl-DplSGwfg.js +1 -0
  97. package/dist/assets/gn-n2N0HUVH.js +1 -0
  98. package/dist/assets/gnuplot-DdkO51Og.js +1 -0
  99. package/dist/assets/go-CxLEBnE3.js +1 -0
  100. package/dist/assets/graphql-ChdNCCLP.js +1 -0
  101. package/dist/assets/groovy-gcz8RCvz.js +1 -0
  102. package/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  103. package/dist/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  104. package/dist/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  105. package/dist/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  106. package/dist/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  107. package/dist/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  108. package/dist/assets/hack-CaT9iCJl.js +1 -0
  109. package/dist/assets/haml-B8DHNrY2.js +1 -0
  110. package/dist/assets/handlebars-BL8al0AC.js +1 -0
  111. package/dist/assets/haskell-Df6bDoY_.js +1 -0
  112. package/dist/assets/haxe-CzTSHFRz.js +1 -0
  113. package/dist/assets/hcl-BWvSN4gD.js +1 -0
  114. package/dist/assets/hjson-D5-asLiD.js +1 -0
  115. package/dist/assets/hlsl-D3lLCCz7.js +1 -0
  116. package/dist/assets/horizon-BUw7H-hv.js +1 -0
  117. package/dist/assets/houston-DnULxvSX.js +1 -0
  118. package/dist/assets/html-GMplVEZG.js +1 -0
  119. package/dist/assets/html-derivative-BFtXZ54Q.js +1 -0
  120. package/dist/assets/http-jrhK8wxY.js +1 -0
  121. package/dist/assets/hurl-irOxFIW8.js +1 -0
  122. package/dist/assets/hxml-Bvhsp5Yf.js +1 -0
  123. package/dist/assets/hy-DFXneXwc.js +1 -0
  124. package/dist/assets/imba-DGztddWO.js +1 -0
  125. package/dist/assets/index-Cjs5j4Ri.js +1490 -0
  126. package/dist/assets/index-jHPB7pV3.css +1 -0
  127. package/dist/assets/ini-BEwlwnbL.js +1 -0
  128. package/dist/assets/java-CylS5w8V.js +1 -0
  129. package/dist/assets/javascript-wDzz0qaB.js +1 -0
  130. package/dist/assets/jinja-4LBKfQ-Z.js +1 -0
  131. package/dist/assets/jison-wvAkD_A8.js +1 -0
  132. package/dist/assets/json-Cp-IABpG.js +1 -0
  133. package/dist/assets/json5-C9tS-k6U.js +1 -0
  134. package/dist/assets/jsonc-Des-eS-w.js +1 -0
  135. package/dist/assets/jsonl-DcaNXYhu.js +1 -0
  136. package/dist/assets/jsonnet-DFQXde-d.js +1 -0
  137. package/dist/assets/jssm-C2t-YnRu.js +1 -0
  138. package/dist/assets/jsx-g9-lgVsj.js +1 -0
  139. package/dist/assets/julia-CxzCAyBv.js +1 -0
  140. package/dist/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  141. package/dist/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  142. package/dist/assets/kanagawa-wave-DWedfzmr.js +1 -0
  143. package/dist/assets/kdl-DV7GczEv.js +1 -0
  144. package/dist/assets/kotlin-BdnUsdx6.js +1 -0
  145. package/dist/assets/kusto-DZf3V79B.js +1 -0
  146. package/dist/assets/laserwave-DUszq2jm.js +1 -0
  147. package/dist/assets/latex-DGMBWnxU.js +1 -0
  148. package/dist/assets/lean-BZvkOJ9d.js +1 -0
  149. package/dist/assets/less-B1dDrJ26.js +1 -0
  150. package/dist/assets/light-plus-B7mTdjB0.js +1 -0
  151. package/dist/assets/liquid-DYVedYrR.js +1 -0
  152. package/dist/assets/llvm-BtvRca6l.js +1 -0
  153. package/dist/assets/log-2UxHyX5q.js +1 -0
  154. package/dist/assets/logo-BtOb2qkB.js +1 -0
  155. package/dist/assets/lua-BaeVxFsk.js +1 -0
  156. package/dist/assets/luau-C-HG3fhB.js +1 -0
  157. package/dist/assets/make-CHLpvVh8.js +1 -0
  158. package/dist/assets/markdown-Cvjx9yec.js +1 -0
  159. package/dist/assets/marko-DZsq8hO1.js +1 -0
  160. package/dist/assets/material-theme-D5KoaKCx.js +1 -0
  161. package/dist/assets/material-theme-darker-BfHTSMKl.js +1 -0
  162. package/dist/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  163. package/dist/assets/material-theme-ocean-CyktbL80.js +1 -0
  164. package/dist/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  165. package/dist/assets/matlab-D7o27uSR.js +1 -0
  166. package/dist/assets/mdc-DUICxH0z.js +1 -0
  167. package/dist/assets/mdx-Cmh6b_Ma.js +1 -0
  168. package/dist/assets/mermaid-mWjccvbQ.js +1 -0
  169. package/dist/assets/min-dark-CafNBF8u.js +1 -0
  170. package/dist/assets/min-light-CTRr51gU.js +1 -0
  171. package/dist/assets/mipsasm-CKIfxQSi.js +1 -0
  172. package/dist/assets/mojo-B93PlW-d.js +1 -0
  173. package/dist/assets/monokai-D4h5O-jR.js +1 -0
  174. package/dist/assets/moonbit-Ba13S78F.js +1 -0
  175. package/dist/assets/move-IF9eRakj.js +1 -0
  176. package/dist/assets/narrat-DRg8JJMk.js +1 -0
  177. package/dist/assets/nextflow-BrzmwbiE.js +1 -0
  178. package/dist/assets/nginx-BpAMiNFr.js +1 -0
  179. package/dist/assets/night-owl-C39BiMTA.js +1 -0
  180. package/dist/assets/night-owl-light-CMTm3GFP.js +1 -0
  181. package/dist/assets/nim-CVrawwO9.js +1 -0
  182. package/dist/assets/nix-CwoSXNpI.js +1 -0
  183. package/dist/assets/nord-Ddv68eIx.js +1 -0
  184. package/dist/assets/nushell-C-sUppwS.js +1 -0
  185. package/dist/assets/objective-c-DXmwc3jG.js +1 -0
  186. package/dist/assets/objective-cpp-CLxacb5B.js +1 -0
  187. package/dist/assets/ocaml-C0hk2d4L.js +1 -0
  188. package/dist/assets/odin-BBf5iR-q.js +1 -0
  189. package/dist/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  190. package/dist/assets/one-light-C3Wv6jpd.js +1 -0
  191. package/dist/assets/openscad-C4EeE6gA.js +1 -0
  192. package/dist/assets/pascal-D93ZcfNL.js +1 -0
  193. package/dist/assets/perl-C0TMdlhV.js +1 -0
  194. package/dist/assets/php-Dhbhpdrm.js +1 -0
  195. package/dist/assets/pkl-u5AG7uiY.js +1 -0
  196. package/dist/assets/plastic-3e1v2bzS.js +1 -0
  197. package/dist/assets/plsql-ChMvpjG-.js +1 -0
  198. package/dist/assets/po-BTJTHyun.js +1 -0
  199. package/dist/assets/poimandres-CS3Unz2-.js +1 -0
  200. package/dist/assets/polar-C0HS_06l.js +1 -0
  201. package/dist/assets/postcss-CXtECtnM.js +1 -0
  202. package/dist/assets/powerquery-CEu0bR-o.js +1 -0
  203. package/dist/assets/powershell-Dpen1YoG.js +1 -0
  204. package/dist/assets/prisma-Dd19v3D-.js +1 -0
  205. package/dist/assets/prolog-CbFg5uaA.js +1 -0
  206. package/dist/assets/proto-C7zT0LnQ.js +1 -0
  207. package/dist/assets/pug-CGlum2m_.js +1 -0
  208. package/dist/assets/puppet-BMWR74SV.js +1 -0
  209. package/dist/assets/purescript-CklMAg4u.js +1 -0
  210. package/dist/assets/python-B6aJPvgy.js +1 -0
  211. package/dist/assets/qml-3beO22l8.js +1 -0
  212. package/dist/assets/qmldir-C8lEn-DE.js +1 -0
  213. package/dist/assets/qss-IeuSbFQv.js +1 -0
  214. package/dist/assets/r-Dspwwk_N.js +1 -0
  215. package/dist/assets/racket-BqYA7rlc.js +1 -0
  216. package/dist/assets/raku-DXvB9xmW.js +1 -0
  217. package/dist/assets/razor-Uh8Bk_45.js +1 -0
  218. package/dist/assets/red-bN70gL4F.js +1 -0
  219. package/dist/assets/reg-C-SQnVFl.js +1 -0
  220. package/dist/assets/regexp-CDVJQ6XC.js +1 -0
  221. package/dist/assets/rel-C3B-1QV4.js +1 -0
  222. package/dist/assets/riscv-BM1_JUlF.js +1 -0
  223. package/dist/assets/ron-BhRPY-oY.js +1 -0
  224. package/dist/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  225. package/dist/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  226. package/dist/assets/rose-pine-qdsjHGoJ.js +1 -0
  227. package/dist/assets/rosmsg-BJDFO7_C.js +1 -0
  228. package/dist/assets/rst-D5oM4XIm.js +1 -0
  229. package/dist/assets/ruby-Cw6WdidG.js +1 -0
  230. package/dist/assets/rust-B1yitclQ.js +1 -0
  231. package/dist/assets/sas-cz2c8ADy.js +1 -0
  232. package/dist/assets/sass-Cj5Yp3dK.js +1 -0
  233. package/dist/assets/scala-C151Ov-r.js +1 -0
  234. package/dist/assets/scheme-C98Dy4si.js +1 -0
  235. package/dist/assets/scss-OYdSNvt2.js +1 -0
  236. package/dist/assets/sdbl-DVxCFoDh.js +1 -0
  237. package/dist/assets/shaderlab-Dg9Lc6iA.js +1 -0
  238. package/dist/assets/shellscript-Yzrsuije.js +1 -0
  239. package/dist/assets/shellsession-BADoaaVG.js +1 -0
  240. package/dist/assets/slack-dark-BthQWCQV.js +1 -0
  241. package/dist/assets/slack-ochin-DqwNpetd.js +1 -0
  242. package/dist/assets/smalltalk-BERRCDM3.js +1 -0
  243. package/dist/assets/snazzy-light-Bw305WKR.js +1 -0
  244. package/dist/assets/solarized-dark-DXbdFlpD.js +1 -0
  245. package/dist/assets/solarized-light-L9t79GZl.js +1 -0
  246. package/dist/assets/solidity-rGO070M0.js +1 -0
  247. package/dist/assets/soy-Brmx7dQM.js +1 -0
  248. package/dist/assets/sparql-rVzFXLq3.js +1 -0
  249. package/dist/assets/splunk-BtCnVYZw.js +1 -0
  250. package/dist/assets/sql-BLtJtn59.js +1 -0
  251. package/dist/assets/ssh-config-_ykCGR6B.js +1 -0
  252. package/dist/assets/stata-BH5u7GGu.js +1 -0
  253. package/dist/assets/stylus-BEDo0Tqx.js +1 -0
  254. package/dist/assets/surrealql-Bq5Q-fJD.js +1 -0
  255. package/dist/assets/svelte-zxCyuUbr.js +1 -0
  256. package/dist/assets/swift-Dg5xB15N.js +1 -0
  257. package/dist/assets/synthwave-84-CbfX1IO0.js +1 -0
  258. package/dist/assets/system-verilog-CnnmHF94.js +1 -0
  259. package/dist/assets/systemd-4A_iFExJ.js +1 -0
  260. package/dist/assets/talonscript-CkByrt1z.js +1 -0
  261. package/dist/assets/tasl-QIJgUcNo.js +1 -0
  262. package/dist/assets/tcl-dwOrl1Do.js +1 -0
  263. package/dist/assets/templ-P3uqSqPl.js +1 -0
  264. package/dist/assets/terraform-BETggiCN.js +1 -0
  265. package/dist/assets/tex-CvyZ59Mk.js +1 -0
  266. package/dist/assets/tokyo-night-hegEt444.js +1 -0
  267. package/dist/assets/toml-vGWfd6FD.js +1 -0
  268. package/dist/assets/ts-tags-zn1MmPIZ.js +1 -0
  269. package/dist/assets/tsv-B_m7g4N7.js +1 -0
  270. package/dist/assets/tsx-COt5Ahok.js +1 -0
  271. package/dist/assets/turtle-BsS91CYL.js +1 -0
  272. package/dist/assets/twig-ChbOoGGc.js +1 -0
  273. package/dist/assets/typescript-BPQ3VLAy.js +1 -0
  274. package/dist/assets/typespec-BGHnOYBU.js +1 -0
  275. package/dist/assets/typst-DHCkPAjA.js +1 -0
  276. package/dist/assets/v-BcVCzyr7.js +1 -0
  277. package/dist/assets/vala-CsfeWuGM.js +1 -0
  278. package/dist/assets/vb-D17OF-Vu.js +1 -0
  279. package/dist/assets/verilog-BQ8w6xss.js +1 -0
  280. package/dist/assets/vesper-DU1UobuO.js +1 -0
  281. package/dist/assets/vhdl-CeAyd5Ju.js +1 -0
  282. package/dist/assets/viml-CJc9bBzg.js +1 -0
  283. package/dist/assets/vitesse-black-Bkuqu6BP.js +1 -0
  284. package/dist/assets/vitesse-dark-D0r3Knsf.js +1 -0
  285. package/dist/assets/vitesse-light-CVO1_9PV.js +1 -0
  286. package/dist/assets/vue-DN_0RTcg.js +1 -0
  287. package/dist/assets/vue-html-AaS7Mt5G.js +1 -0
  288. package/dist/assets/vue-vine-CQOfvN7w.js +1 -0
  289. package/dist/assets/vyper-CDx5xZoG.js +1 -0
  290. package/dist/assets/wasm-CG6Dc4jp.js +1 -0
  291. package/dist/assets/wasm-MzD3tlZU.js +1 -0
  292. package/dist/assets/wenyan-BV7otONQ.js +1 -0
  293. package/dist/assets/wgsl-Dx-B1_4e.js +1 -0
  294. package/dist/assets/wikitext-BhOHFoWU.js +1 -0
  295. package/dist/assets/wit-5i3qLPDT.js +1 -0
  296. package/dist/assets/wolfram-lXgVvXCa.js +1 -0
  297. package/dist/assets/xml-sdJ4AIDG.js +1 -0
  298. package/dist/assets/xsl-CtQFsRM5.js +1 -0
  299. package/dist/assets/yaml-Buea-lGh.js +1 -0
  300. package/dist/assets/zenscript-DVFEvuxE.js +1 -0
  301. package/dist/assets/zig-VOosw3JB.js +1 -0
  302. package/dist/index.html +2 -2
  303. package/package.json +6 -6
  304. package/src/lib/workspace-vfs.ts +185 -0
  305. package/src/pages/ChatPage.tsx +770 -180
  306. package/.working/widgets/27060b91-a2a5-4272-b243-6eb904bd4070/main.tsx +0 -107
  307. package/dist/assets/index-Ct0GSTdJ.css +0 -1
  308. package/dist/assets/index-ueH8ysw1.js +0 -1455
@@ -1,1455 +0,0 @@
1
- var FN=Object.defineProperty;var $N=(e,t,n)=>t in e?FN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vn=(e,t,n)=>$N(e,typeof t!="symbol"?t+"":t,n);function BN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function ja(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A0={exports:{}},Pu={},M0={exports:{}},Ot={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ek;function UN(){if(Ek)return Ot;Ek=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(W){return W===null||typeof W!="object"?null:(W=h&&W[h]||W["@@iterator"],typeof W=="function"?W:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,b={};function k(W,oe,P){this.props=W,this.context=oe,this.refs=b,this.updater=P||g}k.prototype.isReactComponent={},k.prototype.setState=function(W,oe){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,oe,"setState")},k.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(W,oe,P){this.props=W,this.context=oe,this.refs=b,this.updater=P||g}var E=_.prototype=new C;E.constructor=_,x(E,k.prototype),E.isPureReactComponent=!0;var I=Array.isArray,N=Object.prototype.hasOwnProperty,M={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function O(W,oe,P){var tt,U={},ke=null,_e=null;if(oe!=null)for(tt in oe.ref!==void 0&&(_e=oe.ref),oe.key!==void 0&&(ke=""+oe.key),oe)N.call(oe,tt)&&!j.hasOwnProperty(tt)&&(U[tt]=oe[tt]);var Pe=arguments.length-2;if(Pe===1)U.children=P;else if(1<Pe){for(var Ee=Array(Pe),$e=0;$e<Pe;$e++)Ee[$e]=arguments[$e+2];U.children=Ee}if(W&&W.defaultProps)for(tt in Pe=W.defaultProps,Pe)U[tt]===void 0&&(U[tt]=Pe[tt]);return{$$typeof:e,type:W,key:ke,ref:_e,props:U,_owner:M.current}}function R(W,oe){return{$$typeof:e,type:W.type,key:oe,ref:W.ref,props:W.props,_owner:W._owner}}function F(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function ee(W){var oe={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(P){return oe[P]})}var X=/\/+/g;function Se(W,oe){return typeof W=="object"&&W!==null&&W.key!=null?ee(""+W.key):oe.toString(36)}function ue(W,oe,P,tt,U){var ke=typeof W;(ke==="undefined"||ke==="boolean")&&(W=null);var _e=!1;if(W===null)_e=!0;else switch(ke){case"string":case"number":_e=!0;break;case"object":switch(W.$$typeof){case e:case t:_e=!0}}if(_e)return _e=W,U=U(_e),W=tt===""?"."+Se(_e,0):tt,I(U)?(P="",W!=null&&(P=W.replace(X,"$&/")+"/"),ue(U,oe,P,"",function($e){return $e})):U!=null&&(F(U)&&(U=R(U,P+(!U.key||_e&&_e.key===U.key?"":(""+U.key).replace(X,"$&/")+"/")+W)),oe.push(U)),1;if(_e=0,tt=tt===""?".":tt+":",I(W))for(var Pe=0;Pe<W.length;Pe++){ke=W[Pe];var Ee=tt+Se(ke,Pe);_e+=ue(ke,oe,P,Ee,U)}else if(Ee=m(W),typeof Ee=="function")for(W=Ee.call(W),Pe=0;!(ke=W.next()).done;)ke=ke.value,Ee=tt+Se(ke,Pe++),_e+=ue(ke,oe,P,Ee,U);else if(ke==="object")throw oe=String(W),Error("Objects are not valid as a React child (found: "+(oe==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":oe)+"). If you meant to render a collection of children, use an array instead.");return _e}function $(W,oe,P){if(W==null)return W;var tt=[],U=0;return ue(W,tt,"","",function(ke){return oe.call(P,ke,U++)}),tt}function Q(W){if(W._status===-1){var oe=W._result;oe=oe(),oe.then(function(P){(W._status===0||W._status===-1)&&(W._status=1,W._result=P)},function(P){(W._status===0||W._status===-1)&&(W._status=2,W._result=P)}),W._status===-1&&(W._status=0,W._result=oe)}if(W._status===1)return W._result.default;throw W._result}var he={current:null},te={transition:null},Me={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:te,ReactCurrentOwner:M};function D(){throw Error("act(...) is not supported in production builds of React.")}return Ot.Children={map:$,forEach:function(W,oe,P){$(W,function(){oe.apply(this,arguments)},P)},count:function(W){var oe=0;return $(W,function(){oe++}),oe},toArray:function(W){return $(W,function(oe){return oe})||[]},only:function(W){if(!F(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},Ot.Component=k,Ot.Fragment=n,Ot.Profiler=i,Ot.PureComponent=_,Ot.StrictMode=r,Ot.Suspense=u,Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Me,Ot.act=D,Ot.cloneElement=function(W,oe,P){if(W==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+W+".");var tt=x({},W.props),U=W.key,ke=W.ref,_e=W._owner;if(oe!=null){if(oe.ref!==void 0&&(ke=oe.ref,_e=M.current),oe.key!==void 0&&(U=""+oe.key),W.type&&W.type.defaultProps)var Pe=W.type.defaultProps;for(Ee in oe)N.call(oe,Ee)&&!j.hasOwnProperty(Ee)&&(tt[Ee]=oe[Ee]===void 0&&Pe!==void 0?Pe[Ee]:oe[Ee])}var Ee=arguments.length-2;if(Ee===1)tt.children=P;else if(1<Ee){Pe=Array(Ee);for(var $e=0;$e<Ee;$e++)Pe[$e]=arguments[$e+2];tt.children=Pe}return{$$typeof:e,type:W.type,key:U,ref:ke,props:tt,_owner:_e}},Ot.createContext=function(W){return W={$$typeof:s,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},W.Provider={$$typeof:o,_context:W},W.Consumer=W},Ot.createElement=O,Ot.createFactory=function(W){var oe=O.bind(null,W);return oe.type=W,oe},Ot.createRef=function(){return{current:null}},Ot.forwardRef=function(W){return{$$typeof:a,render:W}},Ot.isValidElement=F,Ot.lazy=function(W){return{$$typeof:f,_payload:{_status:-1,_result:W},_init:Q}},Ot.memo=function(W,oe){return{$$typeof:c,type:W,compare:oe===void 0?null:oe}},Ot.startTransition=function(W){var oe=te.transition;te.transition={};try{W()}finally{te.transition=oe}},Ot.unstable_act=D,Ot.useCallback=function(W,oe){return he.current.useCallback(W,oe)},Ot.useContext=function(W){return he.current.useContext(W)},Ot.useDebugValue=function(){},Ot.useDeferredValue=function(W){return he.current.useDeferredValue(W)},Ot.useEffect=function(W,oe){return he.current.useEffect(W,oe)},Ot.useId=function(){return he.current.useId()},Ot.useImperativeHandle=function(W,oe,P){return he.current.useImperativeHandle(W,oe,P)},Ot.useInsertionEffect=function(W,oe){return he.current.useInsertionEffect(W,oe)},Ot.useLayoutEffect=function(W,oe){return he.current.useLayoutEffect(W,oe)},Ot.useMemo=function(W,oe){return he.current.useMemo(W,oe)},Ot.useReducer=function(W,oe,P){return he.current.useReducer(W,oe,P)},Ot.useRef=function(W){return he.current.useRef(W)},Ot.useState=function(W){return he.current.useState(W)},Ot.useSyncExternalStore=function(W,oe,P){return he.current.useSyncExternalStore(W,oe,P)},Ot.useTransition=function(){return he.current.useTransition()},Ot.version="18.3.1",Ot}var _k;function Yc(){return _k||(_k=1,M0.exports=UN()),M0.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Tk;function VN(){if(Tk)return Pu;Tk=1;var e=Yc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,c){var f,h={},m=null,g=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(g=u.ref);for(f in u)r.call(u,f)&&!o.hasOwnProperty(f)&&(h[f]=u[f]);if(a&&a.defaultProps)for(f in u=a.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:t,type:a,key:m,ref:g,props:h,_owner:i.current}}return Pu.Fragment=n,Pu.jsx=s,Pu.jsxs=s,Pu}var Ak;function HN(){return Ak||(Ak=1,A0.exports=VN()),A0.exports}var v=HN(),T=Yc();const zo=ja(T),yy=BN({__proto__:null,default:zo},[T]);var vf={},N0={exports:{}},Fr={},I0={exports:{}},D0={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Mk;function WN(){return Mk||(Mk=1,(function(e){function t(te,Me){var D=te.length;te.push(Me);e:for(;0<D;){var W=D-1>>>1,oe=te[W];if(0<i(oe,Me))te[W]=Me,te[D]=oe,D=W;else break e}}function n(te){return te.length===0?null:te[0]}function r(te){if(te.length===0)return null;var Me=te[0],D=te.pop();if(D!==Me){te[0]=D;e:for(var W=0,oe=te.length,P=oe>>>1;W<P;){var tt=2*(W+1)-1,U=te[tt],ke=tt+1,_e=te[ke];if(0>i(U,D))ke<oe&&0>i(_e,U)?(te[W]=_e,te[ke]=D,W=ke):(te[W]=U,te[tt]=D,W=tt);else if(ke<oe&&0>i(_e,D))te[W]=_e,te[ke]=D,W=ke;else break e}}return Me}function i(te,Me){var D=te.sortIndex-Me.sortIndex;return D!==0?D:te.id-Me.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],f=1,h=null,m=3,g=!1,x=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(te){for(var Me=n(c);Me!==null;){if(Me.callback===null)r(c);else if(Me.startTime<=te)r(c),Me.sortIndex=Me.expirationTime,t(u,Me);else break;Me=n(c)}}function I(te){if(b=!1,E(te),!x)if(n(u)!==null)x=!0,Q(N);else{var Me=n(c);Me!==null&&he(I,Me.startTime-te)}}function N(te,Me){x=!1,b&&(b=!1,C(O),O=-1),g=!0;var D=m;try{for(E(Me),h=n(u);h!==null&&(!(h.expirationTime>Me)||te&&!ee());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var oe=W(h.expirationTime<=Me);Me=e.unstable_now(),typeof oe=="function"?h.callback=oe:h===n(u)&&r(u),E(Me)}else r(u);h=n(u)}if(h!==null)var P=!0;else{var tt=n(c);tt!==null&&he(I,tt.startTime-Me),P=!1}return P}finally{h=null,m=D,g=!1}}var M=!1,j=null,O=-1,R=5,F=-1;function ee(){return!(e.unstable_now()-F<R)}function X(){if(j!==null){var te=e.unstable_now();F=te;var Me=!0;try{Me=j(!0,te)}finally{Me?Se():(M=!1,j=null)}}else M=!1}var Se;if(typeof _=="function")Se=function(){_(X)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,$=ue.port2;ue.port1.onmessage=X,Se=function(){$.postMessage(null)}}else Se=function(){k(X,0)};function Q(te){j=te,M||(M=!0,Se())}function he(te,Me){O=k(function(){te(e.unstable_now())},Me)}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(te){te.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,Q(N))},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(te){switch(m){case 1:case 2:case 3:var Me=3;break;default:Me=m}var D=m;m=Me;try{return te()}finally{m=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(te,Me){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var D=m;m=te;try{return Me()}finally{m=D}},e.unstable_scheduleCallback=function(te,Me,D){var W=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?W+D:W):D=W,te){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=D+oe,te={id:f++,callback:Me,priorityLevel:te,startTime:D,expirationTime:oe,sortIndex:-1},D>W?(te.sortIndex=D,t(c,te),n(u)===null&&te===n(c)&&(b?(C(O),O=-1):b=!0,he(I,D-W))):(te.sortIndex=oe,t(u,te),x||g||(x=!0,Q(N))),te},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(te){var Me=m;return function(){var D=m;m=Me;try{return te.apply(this,arguments)}finally{m=D}}}})(D0)),D0}var Nk;function qN(){return Nk||(Nk=1,I0.exports=WN()),I0.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Ik;function ZN(){if(Ik)return Fr;Ik=1;var e=Yc(),t=qN();function n(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,p=1;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(l,d){s(l,d),s(l+"Capture",d)}function s(l,d){for(i[l]=d,l=0;l<d.length;l++)r.add(d[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,c=/^[: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]*$/,f={},h={};function m(l){return u.call(h,l)?!0:u.call(f,l)?!1:c.test(l)?h[l]=!0:(f[l]=!0,!1)}function g(l,d,p,y){if(p!==null&&p.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function x(l,d,p,y){if(d===null||typeof d>"u"||g(l,d,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function b(l,d,p,y,w,S,A){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=y,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=l,this.type=d,this.sanitizeURL=S,this.removeEmptyString=A}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];k[d]=new b(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){k[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function _(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(C,_);k[d]=new b(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(C,_);k[d]=new b(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(C,_);k[d]=new b(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function E(l,d,p,y){var w=k.hasOwnProperty(d)?k[d]:null;(w!==null?w.type!==0:y||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(x(d,p,w,y)&&(p=null),y||w===null?m(d)&&(p===null?l.removeAttribute(d):l.setAttribute(d,""+p)):w.mustUseProperty?l[w.propertyName]=p===null?w.type===3?!1:"":p:(d=w.attributeName,y=w.attributeNamespace,p===null?l.removeAttribute(d):(w=w.type,p=w===3||w===4&&p===!0?"":""+p,y?l.setAttributeNS(y,d,p):l.setAttribute(d,p))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),M=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),ee=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),Se=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),he=Symbol.for("react.offscreen"),te=Symbol.iterator;function Me(l){return l===null||typeof l!="object"?null:(l=te&&l[te]||l["@@iterator"],typeof l=="function"?l:null)}var D=Object.assign,W;function oe(l){if(W===void 0)try{throw Error()}catch(p){var d=p.stack.trim().match(/\n( *(at )?)/);W=d&&d[1]||""}return`
34
- `+W+l}var P=!1;function tt(l,d){if(!l||P)return"";P=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Y){var y=Y}Reflect.construct(l,[],d)}else{try{d.call()}catch(Y){y=Y}l.call(d.prototype)}else{try{throw Error()}catch(Y){y=Y}l()}}catch(Y){if(Y&&y&&typeof Y.stack=="string"){for(var w=Y.stack.split(`
35
- `),S=y.stack.split(`
36
- `),A=w.length-1,z=S.length-1;1<=A&&0<=z&&w[A]!==S[z];)z--;for(;1<=A&&0<=z;A--,z--)if(w[A]!==S[z]){if(A!==1||z!==1)do if(A--,z--,0>z||w[A]!==S[z]){var V=`
37
- `+w[A].replace(" at new "," at ");return l.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",l.displayName)),V}while(1<=A&&0<=z);break}}}finally{P=!1,Error.prepareStackTrace=p}return(l=l?l.displayName||l.name:"")?oe(l):""}function U(l){switch(l.tag){case 5:return oe(l.type);case 16:return oe("Lazy");case 13:return oe("Suspense");case 19:return oe("SuspenseList");case 0:case 2:case 15:return l=tt(l.type,!1),l;case 11:return l=tt(l.type.render,!1),l;case 1:return l=tt(l.type,!0),l;default:return""}}function ke(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case j:return"Fragment";case M:return"Portal";case R:return"Profiler";case O:return"StrictMode";case Se:return"Suspense";case ue:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case ee:return(l.displayName||"Context")+".Consumer";case F:return(l._context.displayName||"Context")+".Provider";case X:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case $:return d=l.displayName||null,d!==null?d:ke(l.type)||"Memo";case Q:d=l._payload,l=l._init;try{return ke(l(d))}catch{}}return null}function _e(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(d);case 8:return d===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function Pe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Ee(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function $e(l){var d=Ee(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),y=""+l[d];if(!l.hasOwnProperty(d)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,S=p.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return w.call(this)},set:function(A){y=""+A,S.call(this,A)}}),Object.defineProperty(l,d,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(A){y=""+A},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function xt(l){l._valueTracker||(l._valueTracker=$e(l))}function on(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var p=d.getValue(),y="";return l&&(y=Ee(l)?l.checked?"true":"false":l.value),l=y,l!==p?(d.setValue(l),!0):!1}function Yn(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Qn(l,d){var p=d.checked;return D({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??l._wrapperState.initialChecked})}function Gs(l,d){var p=d.defaultValue==null?"":d.defaultValue,y=d.checked!=null?d.checked:d.defaultChecked;p=Pe(d.value!=null?d.value:p),l._wrapperState={initialChecked:y,initialValue:p,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function Ys(l,d){d=d.checked,d!=null&&E(l,"checked",d,!1)}function ho(l,d){Ys(l,d);var p=Pe(d.value),y=d.type;if(p!=null)y==="number"?(p===0&&l.value===""||l.value!=p)&&(l.value=""+p):l.value!==""+p&&(l.value=""+p);else if(y==="submit"||y==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?Ar(l,d.type,p):d.hasOwnProperty("defaultValue")&&Ar(l,d.type,Pe(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function po(l,d,p){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var y=d.type;if(!(y!=="submit"&&y!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,p||d===l.value||(l.value=d),l.defaultValue=d}p=l.name,p!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,p!==""&&(l.name=p)}function Ar(l,d,p){(d!=="number"||Yn(l.ownerDocument)!==l)&&(p==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+p&&(l.defaultValue=""+p))}var Ei=Array.isArray;function Mr(l,d,p,y){if(l=l.options,d){d={};for(var w=0;w<p.length;w++)d["$"+p[w]]=!0;for(p=0;p<l.length;p++)w=d.hasOwnProperty("$"+l[p].value),l[p].selected!==w&&(l[p].selected=w),w&&y&&(l[p].defaultSelected=!0)}else{for(p=""+Pe(p),d=null,w=0;w<l.length;w++){if(l[w].value===p){l[w].selected=!0,y&&(l[w].defaultSelected=!0);return}d!==null||l[w].disabled||(d=l[w])}d!==null&&(d.selected=!0)}}function ai(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return D({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Qs(l,d){var p=d.value;if(p==null){if(p=d.children,d=d.defaultValue,p!=null){if(d!=null)throw Error(n(92));if(Ei(p)){if(1<p.length)throw Error(n(93));p=p[0]}d=p}d==null&&(d=""),p=d}l._wrapperState={initialValue:Pe(p)}}function Nr(l,d){var p=Pe(d.value),y=Pe(d.defaultValue);p!=null&&(p=""+p,p!==l.value&&(l.value=p),d.defaultValue==null&&l.defaultValue!==p&&(l.defaultValue=p)),y!=null&&(l.defaultValue=""+y)}function mo(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function re(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ie(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?re(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var dt,Tt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,p,y,w){MSApp.execUnsafeLocalFunction(function(){return l(d,p,y,w)})}:l})(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=dt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function zt(l,d){if(d){var p=l.firstChild;if(p&&p===l.lastChild&&p.nodeType===3){p.nodeValue=d;return}}l.textContent=d}var zn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_i=["Webkit","ms","Moz","O"];Object.keys(zn).forEach(function(l){_i.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),zn[d]=zn[l]})});function Ir(l,d,p){return d==null||typeof d=="boolean"||d===""?"":p||typeof d!="number"||d===0||zn.hasOwnProperty(l)&&zn[l]?(""+d).trim():d+"px"}function Vi(l,d){l=l.style;for(var p in d)if(d.hasOwnProperty(p)){var y=p.indexOf("--")===0,w=Ir(p,d[p],y);p==="float"&&(p="cssFloat"),y?l.setProperty(p,w):l[p]=w}}var go=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ln(l,d){if(d){if(go[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function li(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){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 pr=null;function ru(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ti=null,Ai=null,Mi=null;function Uo(l){if(l=vu(l)){if(typeof Ti!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Rd(d),Ti(l.stateNode,l.type,d))}}function pd(l){Ai?Mi?Mi.push(l):Mi=[l]:Ai=l}function md(){if(Ai){var l=Ai,d=Mi;if(Mi=Ai=null,Uo(l),d)for(l=0;l<d.length;l++)Uo(d[l])}}function gd(l,d){return l(d)}function L(){}var B=!1;function Z(l,d,p){if(B)return l(d,p);B=!0;try{return gd(l,d,p)}finally{B=!1,(Ai!==null||Mi!==null)&&(L(),md())}}function se(l,d){var p=l.stateNode;if(p===null)return null;var y=Rd(p);if(y===null)return null;p=y[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(l=l.type,y=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!y;break e;default:l=!1}if(l)return null;if(p&&typeof p!="function")throw Error(n(231,d,typeof p));return p}var we=!1;if(a)try{var De={};Object.defineProperty(De,"passive",{get:function(){we=!0}}),window.addEventListener("test",De,De),window.removeEventListener("test",De,De)}catch{we=!1}function be(l,d,p,y,w,S,A,z,V){var Y=Array.prototype.slice.call(arguments,3);try{d.apply(p,Y)}catch(ge){this.onError(ge)}}var Ue=!1,de=null,vt=!1,Ct=null,ct={onError:function(l){Ue=!0,de=l}};function Lt(l,d,p,y,w,S,A,z,V){Ue=!1,de=null,be.apply(ct,arguments)}function kt(l,d,p,y,w,S,A,z,V){if(Lt.apply(this,arguments),Ue){if(Ue){var Y=de;Ue=!1,de=null}else throw Error(n(198));vt||(vt=!0,Ct=Y)}}function wt(l){var d=l,p=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,(d.flags&4098)!==0&&(p=d.return),l=d.return;while(l)}return d.tag===3?p:null}function Dt(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function Ge(l){if(wt(l)!==l)throw Error(n(188))}function sn(l){var d=l.alternate;if(!d){if(d=wt(l),d===null)throw Error(n(188));return d!==l?null:l}for(var p=l,y=d;;){var w=p.return;if(w===null)break;var S=w.alternate;if(S===null){if(y=w.return,y!==null){p=y;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===p)return Ge(w),l;if(S===y)return Ge(w),d;S=S.sibling}throw Error(n(188))}if(p.return!==y.return)p=w,y=S;else{for(var A=!1,z=w.child;z;){if(z===p){A=!0,p=w,y=S;break}if(z===y){A=!0,y=w,p=S;break}z=z.sibling}if(!A){for(z=S.child;z;){if(z===p){A=!0,p=S,y=w;break}if(z===y){A=!0,y=S,p=w;break}z=z.sibling}if(!A)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?l:d}function Je(l){return l=sn(l),l!==null?Ze(l):null}function Ze(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=Ze(l);if(d!==null)return d;l=l.sibling}return null}var Oe=t.unstable_scheduleCallback,fe=t.unstable_cancelCallback,G=t.unstable_shouldYield,le=t.unstable_requestPaint,ae=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,ce=t.unstable_UserBlockingPriority,ye=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,H=t.unstable_IdlePriority,ne=null,Re=null;function ze(l){if(Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(ne,l,void 0,(l.current.flags&128)===128)}catch{}}var Ye=Math.clz32?Math.clz32:Rt,Gt=Math.log,He=Math.LN2;function Rt(l){return l>>>=0,l===0?32:31-(Gt(l)/He|0)|0}var Et=64,St=4194304;function Mn(l){switch(l&-l){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: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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Xt(l,d){var p=l.pendingLanes;if(p===0)return 0;var y=0,w=l.suspendedLanes,S=l.pingedLanes,A=p&268435455;if(A!==0){var z=A&~w;z!==0?y=Mn(z):(S&=A,S!==0&&(y=Mn(S)))}else A=p&~w,A!==0?y=Mn(A):S!==0&&(y=Mn(S));if(y===0)return 0;if(d!==0&&d!==y&&(d&w)===0&&(w=y&-y,S=d&-d,w>=S||w===16&&(S&4194240)!==0))return d;if((y&4)!==0&&(y|=p&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=y;0<d;)p=31-Ye(d),w=1<<p,y|=l[p],d&=~w;return y}function Ni(l,d){switch(l){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64: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 d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(l,d){for(var p=l.suspendedLanes,y=l.pingedLanes,w=l.expirationTimes,S=l.pendingLanes;0<S;){var A=31-Ye(S),z=1<<A,V=w[A];V===-1?((z&p)===0||(z&y)!==0)&&(w[A]=Ni(z,d)):V<=d&&(l.expiredLanes|=z),S&=~z}}function Zr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function mr(){var l=Et;return Et<<=1,(Et&4194240)===0&&(Et=64),l}function Dr(l){for(var d=[],p=0;31>p;p++)d.push(l);return d}function gr(l,d,p){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Ye(d),l[d]=p}function Or(l,d){var p=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<p;){var w=31-Ye(p),S=1<<w;d[w]=0,y[w]=-1,l[w]=-1,p&=~S}}function yo(l,d){var p=l.entangledLanes|=d;for(l=l.entanglements;p;){var y=31-Ye(p),w=1<<y;w&d|l[y]&d&&(l[y]|=d),p&=~w}}var jt=0;function yd(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var xd,Qp,ob,sb,ab,Xp=!1,bd=[],Vo=null,Ho=null,Wo=null,iu=new Map,ou=new Map,qo=[],aM="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 submit".split(" ");function lb(l,d){switch(l){case"focusin":case"focusout":Vo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":Wo=null;break;case"pointerover":case"pointerout":iu.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":ou.delete(d.pointerId)}}function su(l,d,p,y,w,S){return l===null||l.nativeEvent!==S?(l={blockedOn:d,domEventName:p,eventSystemFlags:y,nativeEvent:S,targetContainers:[w]},d!==null&&(d=vu(d),d!==null&&Qp(d)),l):(l.eventSystemFlags|=y,d=l.targetContainers,w!==null&&d.indexOf(w)===-1&&d.push(w),l)}function lM(l,d,p,y,w){switch(d){case"focusin":return Vo=su(Vo,l,d,p,y,w),!0;case"dragenter":return Ho=su(Ho,l,d,p,y,w),!0;case"mouseover":return Wo=su(Wo,l,d,p,y,w),!0;case"pointerover":var S=w.pointerId;return iu.set(S,su(iu.get(S)||null,l,d,p,y,w)),!0;case"gotpointercapture":return S=w.pointerId,ou.set(S,su(ou.get(S)||null,l,d,p,y,w)),!0}return!1}function ub(l){var d=Xs(l.target);if(d!==null){var p=wt(d);if(p!==null){if(d=p.tag,d===13){if(d=Dt(p),d!==null){l.blockedOn=d,ab(l.priority,function(){ob(p)});return}}else if(d===3&&p.stateNode.current.memoizedState.isDehydrated){l.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}l.blockedOn=null}function vd(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var p=tm(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(p===null){p=l.nativeEvent;var y=new p.constructor(p.type,p);pr=y,p.target.dispatchEvent(y),pr=null}else return d=vu(p),d!==null&&Qp(d),l.blockedOn=p,!1;d.shift()}return!0}function cb(l,d,p){vd(l)&&p.delete(d)}function uM(){Xp=!1,Vo!==null&&vd(Vo)&&(Vo=null),Ho!==null&&vd(Ho)&&(Ho=null),Wo!==null&&vd(Wo)&&(Wo=null),iu.forEach(cb),ou.forEach(cb)}function au(l,d){l.blockedOn===d&&(l.blockedOn=null,Xp||(Xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,uM)))}function lu(l){function d(w){return au(w,l)}if(0<bd.length){au(bd[0],l);for(var p=1;p<bd.length;p++){var y=bd[p];y.blockedOn===l&&(y.blockedOn=null)}}for(Vo!==null&&au(Vo,l),Ho!==null&&au(Ho,l),Wo!==null&&au(Wo,l),iu.forEach(d),ou.forEach(d),p=0;p<qo.length;p++)y=qo[p],y.blockedOn===l&&(y.blockedOn=null);for(;0<qo.length&&(p=qo[0],p.blockedOn===null);)ub(p),p.blockedOn===null&&qo.shift()}var Ha=I.ReactCurrentBatchConfig,kd=!0;function cM(l,d,p,y){var w=jt,S=Ha.transition;Ha.transition=null;try{jt=1,em(l,d,p,y)}finally{jt=w,Ha.transition=S}}function dM(l,d,p,y){var w=jt,S=Ha.transition;Ha.transition=null;try{jt=4,em(l,d,p,y)}finally{jt=w,Ha.transition=S}}function em(l,d,p,y){if(kd){var w=tm(l,d,p,y);if(w===null)xm(l,d,y,wd,p),lb(l,y);else if(lM(w,l,d,p,y))y.stopPropagation();else if(lb(l,y),d&4&&-1<aM.indexOf(l)){for(;w!==null;){var S=vu(w);if(S!==null&&xd(S),S=tm(l,d,p,y),S===null&&xm(l,d,y,wd,p),S===w)break;w=S}w!==null&&y.stopPropagation()}else xm(l,d,y,null,p)}}var wd=null;function tm(l,d,p,y){if(wd=null,l=ru(y),l=Xs(l),l!==null)if(d=wt(l),d===null)l=null;else if(p=d.tag,p===13){if(l=Dt(d),l!==null)return l;l=null}else if(p===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return wd=l,null}function db(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Le()){case Be:return 1;case ce:return 4;case ye:case Fe:return 16;case H:return 536870912;default:return 16}default:return 16}}var Zo=null,nm=null,Cd=null;function fb(){if(Cd)return Cd;var l,d=nm,p=d.length,y,w="value"in Zo?Zo.value:Zo.textContent,S=w.length;for(l=0;l<p&&d[l]===w[l];l++);var A=p-l;for(y=1;y<=A&&d[p-y]===w[S-y];y++);return Cd=w.slice(l,1<y?1-y:void 0)}function Sd(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function Ed(){return!0}function hb(){return!1}function Jr(l){function d(p,y,w,S,A){this._reactName=p,this._targetInst=w,this.type=y,this.nativeEvent=S,this.target=A,this.currentTarget=null;for(var z in l)l.hasOwnProperty(z)&&(p=l[z],this[z]=p?p(S):S[z]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Ed:hb,this.isPropagationStopped=hb,this}return D(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),d}var Wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=Jr(Wa),uu=D({},Wa,{view:0,detail:0}),fM=Jr(uu),im,om,cu,_d=D({},uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:am,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==cu&&(cu&&l.type==="mousemove"?(im=l.screenX-cu.screenX,om=l.screenY-cu.screenY):om=im=0,cu=l),im)},movementY:function(l){return"movementY"in l?l.movementY:om}}),pb=Jr(_d),hM=D({},_d,{dataTransfer:0}),pM=Jr(hM),mM=D({},uu,{relatedTarget:0}),sm=Jr(mM),gM=D({},Wa,{animationName:0,elapsedTime:0,pseudoElement:0}),yM=Jr(gM),xM=D({},Wa,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),bM=Jr(xM),vM=D({},Wa,{data:0}),mb=Jr(vM),kM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wM={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"},CM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SM(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=CM[l])?!!d[l]:!1}function am(){return SM}var EM=D({},uu,{key:function(l){if(l.key){var d=kM[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=Sd(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?wM[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:am,charCode:function(l){return l.type==="keypress"?Sd(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Sd(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),_M=Jr(EM),TM=D({},_d,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gb=Jr(TM),AM=D({},uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:am}),MM=Jr(AM),NM=D({},Wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),IM=Jr(NM),DM=D({},_d,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),OM=Jr(DM),RM=[9,13,27,32],lm=a&&"CompositionEvent"in window,du=null;a&&"documentMode"in document&&(du=document.documentMode);var PM=a&&"TextEvent"in window&&!du,yb=a&&(!lm||du&&8<du&&11>=du),xb=" ",bb=!1;function vb(l,d){switch(l){case"keyup":return RM.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kb(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var qa=!1;function jM(l,d){switch(l){case"compositionend":return kb(d);case"keypress":return d.which!==32?null:(bb=!0,xb);case"textInput":return l=d.data,l===xb&&bb?null:l;default:return null}}function zM(l,d){if(qa)return l==="compositionend"||!lm&&vb(l,d)?(l=fb(),Cd=nm=Zo=null,qa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return yb&&d.locale!=="ko"?null:d.data;default:return null}}var LM={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 wb(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!LM[l.type]:d==="textarea"}function Cb(l,d,p,y){pd(y),d=Id(d,"onChange"),0<d.length&&(p=new rm("onChange","change",null,p,y),l.push({event:p,listeners:d}))}var fu=null,hu=null;function FM(l){Bb(l,0)}function Td(l){var d=Ya(l);if(on(d))return l}function $M(l,d){if(l==="change")return d}var Sb=!1;if(a){var um;if(a){var cm="oninput"in document;if(!cm){var Eb=document.createElement("div");Eb.setAttribute("oninput","return;"),cm=typeof Eb.oninput=="function"}um=cm}else um=!1;Sb=um&&(!document.documentMode||9<document.documentMode)}function _b(){fu&&(fu.detachEvent("onpropertychange",Tb),hu=fu=null)}function Tb(l){if(l.propertyName==="value"&&Td(hu)){var d=[];Cb(d,hu,l,ru(l)),Z(FM,d)}}function BM(l,d,p){l==="focusin"?(_b(),fu=d,hu=p,fu.attachEvent("onpropertychange",Tb)):l==="focusout"&&_b()}function UM(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Td(hu)}function VM(l,d){if(l==="click")return Td(d)}function HM(l,d){if(l==="input"||l==="change")return Td(d)}function WM(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Ii=typeof Object.is=="function"?Object.is:WM;function pu(l,d){if(Ii(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var p=Object.keys(l),y=Object.keys(d);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var w=p[y];if(!u.call(d,w)||!Ii(l[w],d[w]))return!1}return!0}function Ab(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Mb(l,d){var p=Ab(l);l=0;for(var y;p;){if(p.nodeType===3){if(y=l+p.textContent.length,l<=d&&y>=d)return{node:p,offset:d-l};l=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Ab(p)}}function Nb(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Nb(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Ib(){for(var l=window,d=Yn();d instanceof l.HTMLIFrameElement;){try{var p=typeof d.contentWindow.location.href=="string"}catch{p=!1}if(p)l=d.contentWindow;else break;d=Yn(l.document)}return d}function dm(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function qM(l){var d=Ib(),p=l.focusedElem,y=l.selectionRange;if(d!==p&&p&&p.ownerDocument&&Nb(p.ownerDocument.documentElement,p)){if(y!==null&&dm(p)){if(d=y.start,l=y.end,l===void 0&&(l=d),"selectionStart"in p)p.selectionStart=d,p.selectionEnd=Math.min(l,p.value.length);else if(l=(d=p.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var w=p.textContent.length,S=Math.min(y.start,w);y=y.end===void 0?S:Math.min(y.end,w),!l.extend&&S>y&&(w=y,y=S,S=w),w=Mb(p,S);var A=Mb(p,y);w&&A&&(l.rangeCount!==1||l.anchorNode!==w.node||l.anchorOffset!==w.offset||l.focusNode!==A.node||l.focusOffset!==A.offset)&&(d=d.createRange(),d.setStart(w.node,w.offset),l.removeAllRanges(),S>y?(l.addRange(d),l.extend(A.node,A.offset)):(d.setEnd(A.node,A.offset),l.addRange(d)))}}for(d=[],l=p;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<d.length;p++)l=d[p],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var ZM=a&&"documentMode"in document&&11>=document.documentMode,Za=null,fm=null,mu=null,hm=!1;function Db(l,d,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;hm||Za==null||Za!==Yn(y)||(y=Za,"selectionStart"in y&&dm(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),mu&&pu(mu,y)||(mu=y,y=Id(fm,"onSelect"),0<y.length&&(d=new rm("onSelect","select",null,d,p),l.push({event:d,listeners:y}),d.target=Za)))}function Ad(l,d){var p={};return p[l.toLowerCase()]=d.toLowerCase(),p["Webkit"+l]="webkit"+d,p["Moz"+l]="moz"+d,p}var Ja={animationend:Ad("Animation","AnimationEnd"),animationiteration:Ad("Animation","AnimationIteration"),animationstart:Ad("Animation","AnimationStart"),transitionend:Ad("Transition","TransitionEnd")},pm={},Ob={};a&&(Ob=document.createElement("div").style,"AnimationEvent"in window||(delete Ja.animationend.animation,delete Ja.animationiteration.animation,delete Ja.animationstart.animation),"TransitionEvent"in window||delete Ja.transitionend.transition);function Md(l){if(pm[l])return pm[l];if(!Ja[l])return l;var d=Ja[l],p;for(p in d)if(d.hasOwnProperty(p)&&p in Ob)return pm[l]=d[p];return l}var Rb=Md("animationend"),Pb=Md("animationiteration"),jb=Md("animationstart"),zb=Md("transitionend"),Lb=new Map,Fb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Jo(l,d){Lb.set(l,d),o(d,[l])}for(var mm=0;mm<Fb.length;mm++){var gm=Fb[mm],JM=gm.toLowerCase(),KM=gm[0].toUpperCase()+gm.slice(1);Jo(JM,"on"+KM)}Jo(Rb,"onAnimationEnd"),Jo(Pb,"onAnimationIteration"),Jo(jb,"onAnimationStart"),Jo("dblclick","onDoubleClick"),Jo("focusin","onFocus"),Jo("focusout","onBlur"),Jo(zb,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gu="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(" "),GM=new Set("cancel close invalid load scroll toggle".split(" ").concat(gu));function $b(l,d,p){var y=l.type||"unknown-event";l.currentTarget=p,kt(y,d,void 0,l),l.currentTarget=null}function Bb(l,d){d=(d&4)!==0;for(var p=0;p<l.length;p++){var y=l[p],w=y.event;y=y.listeners;e:{var S=void 0;if(d)for(var A=y.length-1;0<=A;A--){var z=y[A],V=z.instance,Y=z.currentTarget;if(z=z.listener,V!==S&&w.isPropagationStopped())break e;$b(w,z,Y),S=V}else for(A=0;A<y.length;A++){if(z=y[A],V=z.instance,Y=z.currentTarget,z=z.listener,V!==S&&w.isPropagationStopped())break e;$b(w,z,Y),S=V}}}if(vt)throw l=Ct,vt=!1,Ct=null,l}function an(l,d){var p=d[Sm];p===void 0&&(p=d[Sm]=new Set);var y=l+"__bubble";p.has(y)||(Ub(d,l,2,!1),p.add(y))}function ym(l,d,p){var y=0;d&&(y|=4),Ub(p,l,y,d)}var Nd="_reactListening"+Math.random().toString(36).slice(2);function yu(l){if(!l[Nd]){l[Nd]=!0,r.forEach(function(p){p!=="selectionchange"&&(GM.has(p)||ym(p,!1,l),ym(p,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Nd]||(d[Nd]=!0,ym("selectionchange",!1,d))}}function Ub(l,d,p,y){switch(db(d)){case 1:var w=cM;break;case 4:w=dM;break;default:w=em}p=w.bind(null,d,p,l),w=void 0,!we||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(w=!0),y?w!==void 0?l.addEventListener(d,p,{capture:!0,passive:w}):l.addEventListener(d,p,!0):w!==void 0?l.addEventListener(d,p,{passive:w}):l.addEventListener(d,p,!1)}function xm(l,d,p,y,w){var S=y;if((d&1)===0&&(d&2)===0&&y!==null)e:for(;;){if(y===null)return;var A=y.tag;if(A===3||A===4){var z=y.stateNode.containerInfo;if(z===w||z.nodeType===8&&z.parentNode===w)break;if(A===4)for(A=y.return;A!==null;){var V=A.tag;if((V===3||V===4)&&(V=A.stateNode.containerInfo,V===w||V.nodeType===8&&V.parentNode===w))return;A=A.return}for(;z!==null;){if(A=Xs(z),A===null)return;if(V=A.tag,V===5||V===6){y=S=A;continue e}z=z.parentNode}}y=y.return}Z(function(){var Y=S,ge=ru(p),xe=[];e:{var pe=Lb.get(l);if(pe!==void 0){var We=rm,Qe=l;switch(l){case"keypress":if(Sd(p)===0)break e;case"keydown":case"keyup":We=_M;break;case"focusin":Qe="focus",We=sm;break;case"focusout":Qe="blur",We=sm;break;case"beforeblur":case"afterblur":We=sm;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":We=pb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":We=pM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":We=MM;break;case Rb:case Pb:case jb:We=yM;break;case zb:We=IM;break;case"scroll":We=fM;break;case"wheel":We=OM;break;case"copy":case"cut":case"paste":We=bM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":We=gb}var rt=(d&4)!==0,An=!rt&&l==="scroll",J=rt?pe!==null?pe+"Capture":null:pe;rt=[];for(var q=Y,K;q!==null;){K=q;var Te=K.stateNode;if(K.tag===5&&Te!==null&&(K=Te,J!==null&&(Te=se(q,J),Te!=null&&rt.push(xu(q,Te,K)))),An)break;q=q.return}0<rt.length&&(pe=new We(pe,Qe,null,p,ge),xe.push({event:pe,listeners:rt}))}}if((d&7)===0){e:{if(pe=l==="mouseover"||l==="pointerover",We=l==="mouseout"||l==="pointerout",pe&&p!==pr&&(Qe=p.relatedTarget||p.fromElement)&&(Xs(Qe)||Qe[xo]))break e;if((We||pe)&&(pe=ge.window===ge?ge:(pe=ge.ownerDocument)?pe.defaultView||pe.parentWindow:window,We?(Qe=p.relatedTarget||p.toElement,We=Y,Qe=Qe?Xs(Qe):null,Qe!==null&&(An=wt(Qe),Qe!==An||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(We=null,Qe=Y),We!==Qe)){if(rt=pb,Te="onMouseLeave",J="onMouseEnter",q="mouse",(l==="pointerout"||l==="pointerover")&&(rt=gb,Te="onPointerLeave",J="onPointerEnter",q="pointer"),An=We==null?pe:Ya(We),K=Qe==null?pe:Ya(Qe),pe=new rt(Te,q+"leave",We,p,ge),pe.target=An,pe.relatedTarget=K,Te=null,Xs(ge)===Y&&(rt=new rt(J,q+"enter",Qe,p,ge),rt.target=K,rt.relatedTarget=An,Te=rt),An=Te,We&&Qe)t:{for(rt=We,J=Qe,q=0,K=rt;K;K=Ka(K))q++;for(K=0,Te=J;Te;Te=Ka(Te))K++;for(;0<q-K;)rt=Ka(rt),q--;for(;0<K-q;)J=Ka(J),K--;for(;q--;){if(rt===J||J!==null&&rt===J.alternate)break t;rt=Ka(rt),J=Ka(J)}rt=null}else rt=null;We!==null&&Vb(xe,pe,We,rt,!1),Qe!==null&&An!==null&&Vb(xe,An,Qe,rt,!0)}}e:{if(pe=Y?Ya(Y):window,We=pe.nodeName&&pe.nodeName.toLowerCase(),We==="select"||We==="input"&&pe.type==="file")var it=$M;else if(wb(pe))if(Sb)it=HM;else{it=UM;var ft=BM}else(We=pe.nodeName)&&We.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(it=VM);if(it&&(it=it(l,Y))){Cb(xe,it,p,ge);break e}ft&&ft(l,pe,Y),l==="focusout"&&(ft=pe._wrapperState)&&ft.controlled&&pe.type==="number"&&Ar(pe,"number",pe.value)}switch(ft=Y?Ya(Y):window,l){case"focusin":(wb(ft)||ft.contentEditable==="true")&&(Za=ft,fm=Y,mu=null);break;case"focusout":mu=fm=Za=null;break;case"mousedown":hm=!0;break;case"contextmenu":case"mouseup":case"dragend":hm=!1,Db(xe,p,ge);break;case"selectionchange":if(ZM)break;case"keydown":case"keyup":Db(xe,p,ge)}var ht;if(lm)e:{switch(l){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else qa?vb(l,p)&&(gt="onCompositionEnd"):l==="keydown"&&p.keyCode===229&&(gt="onCompositionStart");gt&&(yb&&p.locale!=="ko"&&(qa||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&qa&&(ht=fb()):(Zo=ge,nm="value"in Zo?Zo.value:Zo.textContent,qa=!0)),ft=Id(Y,gt),0<ft.length&&(gt=new mb(gt,l,null,p,ge),xe.push({event:gt,listeners:ft}),ht?gt.data=ht:(ht=kb(p),ht!==null&&(gt.data=ht)))),(ht=PM?jM(l,p):zM(l,p))&&(Y=Id(Y,"onBeforeInput"),0<Y.length&&(ge=new mb("onBeforeInput","beforeinput",null,p,ge),xe.push({event:ge,listeners:Y}),ge.data=ht))}Bb(xe,d)})}function xu(l,d,p){return{instance:l,listener:d,currentTarget:p}}function Id(l,d){for(var p=d+"Capture",y=[];l!==null;){var w=l,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=se(l,p),S!=null&&y.unshift(xu(l,S,w)),S=se(l,d),S!=null&&y.push(xu(l,S,w))),l=l.return}return y}function Ka(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Vb(l,d,p,y,w){for(var S=d._reactName,A=[];p!==null&&p!==y;){var z=p,V=z.alternate,Y=z.stateNode;if(V!==null&&V===y)break;z.tag===5&&Y!==null&&(z=Y,w?(V=se(p,S),V!=null&&A.unshift(xu(p,V,z))):w||(V=se(p,S),V!=null&&A.push(xu(p,V,z)))),p=p.return}A.length!==0&&l.push({event:d,listeners:A})}var YM=/\r\n?/g,QM=/\u0000|\uFFFD/g;function Hb(l){return(typeof l=="string"?l:""+l).replace(YM,`
38
- `).replace(QM,"")}function Dd(l,d,p){if(d=Hb(d),Hb(l)!==d&&p)throw Error(n(425))}function Od(){}var bm=null,vm=null;function km(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var wm=typeof setTimeout=="function"?setTimeout:void 0,XM=typeof clearTimeout=="function"?clearTimeout:void 0,Wb=typeof Promise=="function"?Promise:void 0,eN=typeof queueMicrotask=="function"?queueMicrotask:typeof Wb<"u"?function(l){return Wb.resolve(null).then(l).catch(tN)}:wm;function tN(l){setTimeout(function(){throw l})}function Cm(l,d){var p=d,y=0;do{var w=p.nextSibling;if(l.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"){if(y===0){l.removeChild(w),lu(d);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=w}while(p);lu(d)}function Ko(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function qb(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var p=l.data;if(p==="$"||p==="$!"||p==="$?"){if(d===0)return l;d--}else p==="/$"&&d++}l=l.previousSibling}return null}var Ga=Math.random().toString(36).slice(2),Hi="__reactFiber$"+Ga,bu="__reactProps$"+Ga,xo="__reactContainer$"+Ga,Sm="__reactEvents$"+Ga,nN="__reactListeners$"+Ga,rN="__reactHandles$"+Ga;function Xs(l){var d=l[Hi];if(d)return d;for(var p=l.parentNode;p;){if(d=p[xo]||p[Hi]){if(p=d.alternate,d.child!==null||p!==null&&p.child!==null)for(l=qb(l);l!==null;){if(p=l[Hi])return p;l=qb(l)}return d}l=p,p=l.parentNode}return null}function vu(l){return l=l[Hi]||l[xo],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ya(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Rd(l){return l[bu]||null}var Em=[],Qa=-1;function Go(l){return{current:l}}function ln(l){0>Qa||(l.current=Em[Qa],Em[Qa]=null,Qa--)}function en(l,d){Qa++,Em[Qa]=l.current,l.current=d}var Yo={},or=Go(Yo),Rr=Go(!1),ea=Yo;function Xa(l,d){var p=l.type.contextTypes;if(!p)return Yo;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===d)return y.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in p)w[S]=d[S];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=w),w}function Pr(l){return l=l.childContextTypes,l!=null}function Pd(){ln(Rr),ln(or)}function Zb(l,d,p){if(or.current!==Yo)throw Error(n(168));en(or,d),en(Rr,p)}function Jb(l,d,p){var y=l.stateNode;if(d=d.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var w in y)if(!(w in d))throw Error(n(108,_e(l)||"Unknown",w));return D({},p,y)}function jd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Yo,ea=or.current,en(or,l),en(Rr,Rr.current),!0}function Kb(l,d,p){var y=l.stateNode;if(!y)throw Error(n(169));p?(l=Jb(l,d,ea),y.__reactInternalMemoizedMergedChildContext=l,ln(Rr),ln(or),en(or,l)):ln(Rr),en(Rr,p)}var bo=null,zd=!1,_m=!1;function Gb(l){bo===null?bo=[l]:bo.push(l)}function iN(l){zd=!0,Gb(l)}function Qo(){if(!_m&&bo!==null){_m=!0;var l=0,d=jt;try{var p=bo;for(jt=1;l<p.length;l++){var y=p[l];do y=y(!0);while(y!==null)}bo=null,zd=!1}catch(w){throw bo!==null&&(bo=bo.slice(l+1)),Oe(Be,Qo),w}finally{jt=d,_m=!1}}return null}var el=[],tl=0,Ld=null,Fd=0,ui=[],ci=0,ta=null,vo=1,ko="";function na(l,d){el[tl++]=Fd,el[tl++]=Ld,Ld=l,Fd=d}function Yb(l,d,p){ui[ci++]=vo,ui[ci++]=ko,ui[ci++]=ta,ta=l;var y=vo;l=ko;var w=32-Ye(y)-1;y&=~(1<<w),p+=1;var S=32-Ye(d)+w;if(30<S){var A=w-w%5;S=(y&(1<<A)-1).toString(32),y>>=A,w-=A,vo=1<<32-Ye(d)+w|p<<w|y,ko=S+l}else vo=1<<S|p<<w|y,ko=l}function Tm(l){l.return!==null&&(na(l,1),Yb(l,1,0))}function Am(l){for(;l===Ld;)Ld=el[--tl],el[tl]=null,Fd=el[--tl],el[tl]=null;for(;l===ta;)ta=ui[--ci],ui[ci]=null,ko=ui[--ci],ui[ci]=null,vo=ui[--ci],ui[ci]=null}var Kr=null,Gr=null,hn=!1,Di=null;function Qb(l,d){var p=pi(5,null,null,0);p.elementType="DELETED",p.stateNode=d,p.return=l,d=l.deletions,d===null?(l.deletions=[p],l.flags|=16):d.push(p)}function Xb(l,d){switch(l.tag){case 5:var p=l.type;return d=d.nodeType!==1||p.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,Kr=l,Gr=Ko(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,Kr=l,Gr=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(p=ta!==null?{id:vo,overflow:ko}:null,l.memoizedState={dehydrated:d,treeContext:p,retryLane:1073741824},p=pi(18,null,null,0),p.stateNode=d,p.return=l,l.child=p,Kr=l,Gr=null,!0):!1;default:return!1}}function Mm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Nm(l){if(hn){var d=Gr;if(d){var p=d;if(!Xb(l,d)){if(Mm(l))throw Error(n(418));d=Ko(p.nextSibling);var y=Kr;d&&Xb(l,d)?Qb(y,p):(l.flags=l.flags&-4097|2,hn=!1,Kr=l)}}else{if(Mm(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,Kr=l}}}function ev(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Kr=l}function $d(l){if(l!==Kr)return!1;if(!hn)return ev(l),hn=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!km(l.type,l.memoizedProps)),d&&(d=Gr)){if(Mm(l))throw tv(),Error(n(418));for(;d;)Qb(l,d),d=Ko(d.nextSibling)}if(ev(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var p=l.data;if(p==="/$"){if(d===0){Gr=Ko(l.nextSibling);break e}d--}else p!=="$"&&p!=="$!"&&p!=="$?"||d++}l=l.nextSibling}Gr=null}}else Gr=Kr?Ko(l.stateNode.nextSibling):null;return!0}function tv(){for(var l=Gr;l;)l=Ko(l.nextSibling)}function nl(){Gr=Kr=null,hn=!1}function Im(l){Di===null?Di=[l]:Di.push(l)}var oN=I.ReactCurrentBatchConfig;function ku(l,d,p){if(l=p.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,l));var w=y,S=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===S?d.ref:(d=function(A){var z=w.refs;A===null?delete z[S]:z[S]=A},d._stringRef=S,d)}if(typeof l!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,l))}return l}function Bd(l,d){throw l=Object.prototype.toString.call(d),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function nv(l){var d=l._init;return d(l._payload)}function rv(l){function d(J,q){if(l){var K=J.deletions;K===null?(J.deletions=[q],J.flags|=16):K.push(q)}}function p(J,q){if(!l)return null;for(;q!==null;)d(J,q),q=q.sibling;return null}function y(J,q){for(J=new Map;q!==null;)q.key!==null?J.set(q.key,q):J.set(q.index,q),q=q.sibling;return J}function w(J,q){return J=as(J,q),J.index=0,J.sibling=null,J}function S(J,q,K){return J.index=K,l?(K=J.alternate,K!==null?(K=K.index,K<q?(J.flags|=2,q):K):(J.flags|=2,q)):(J.flags|=1048576,q)}function A(J){return l&&J.alternate===null&&(J.flags|=2),J}function z(J,q,K,Te){return q===null||q.tag!==6?(q=w0(K,J.mode,Te),q.return=J,q):(q=w(q,K),q.return=J,q)}function V(J,q,K,Te){var it=K.type;return it===j?ge(J,q,K.props.children,Te,K.key):q!==null&&(q.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Q&&nv(it)===q.type)?(Te=w(q,K.props),Te.ref=ku(J,q,K),Te.return=J,Te):(Te=ff(K.type,K.key,K.props,null,J.mode,Te),Te.ref=ku(J,q,K),Te.return=J,Te)}function Y(J,q,K,Te){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=C0(K,J.mode,Te),q.return=J,q):(q=w(q,K.children||[]),q.return=J,q)}function ge(J,q,K,Te,it){return q===null||q.tag!==7?(q=ca(K,J.mode,Te,it),q.return=J,q):(q=w(q,K),q.return=J,q)}function xe(J,q,K){if(typeof q=="string"&&q!==""||typeof q=="number")return q=w0(""+q,J.mode,K),q.return=J,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case N:return K=ff(q.type,q.key,q.props,null,J.mode,K),K.ref=ku(J,null,q),K.return=J,K;case M:return q=C0(q,J.mode,K),q.return=J,q;case Q:var Te=q._init;return xe(J,Te(q._payload),K)}if(Ei(q)||Me(q))return q=ca(q,J.mode,K,null),q.return=J,q;Bd(J,q)}return null}function pe(J,q,K,Te){var it=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return it!==null?null:z(J,q,""+K,Te);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case N:return K.key===it?V(J,q,K,Te):null;case M:return K.key===it?Y(J,q,K,Te):null;case Q:return it=K._init,pe(J,q,it(K._payload),Te)}if(Ei(K)||Me(K))return it!==null?null:ge(J,q,K,Te,null);Bd(J,K)}return null}function We(J,q,K,Te,it){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return J=J.get(K)||null,z(q,J,""+Te,it);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case N:return J=J.get(Te.key===null?K:Te.key)||null,V(q,J,Te,it);case M:return J=J.get(Te.key===null?K:Te.key)||null,Y(q,J,Te,it);case Q:var ft=Te._init;return We(J,q,K,ft(Te._payload),it)}if(Ei(Te)||Me(Te))return J=J.get(K)||null,ge(q,J,Te,it,null);Bd(q,Te)}return null}function Qe(J,q,K,Te){for(var it=null,ft=null,ht=q,gt=q=0,Wn=null;ht!==null&&gt<K.length;gt++){ht.index>gt?(Wn=ht,ht=null):Wn=ht.sibling;var Vt=pe(J,ht,K[gt],Te);if(Vt===null){ht===null&&(ht=Wn);break}l&&ht&&Vt.alternate===null&&d(J,ht),q=S(Vt,q,gt),ft===null?it=Vt:ft.sibling=Vt,ft=Vt,ht=Wn}if(gt===K.length)return p(J,ht),hn&&na(J,gt),it;if(ht===null){for(;gt<K.length;gt++)ht=xe(J,K[gt],Te),ht!==null&&(q=S(ht,q,gt),ft===null?it=ht:ft.sibling=ht,ft=ht);return hn&&na(J,gt),it}for(ht=y(J,ht);gt<K.length;gt++)Wn=We(ht,J,gt,K[gt],Te),Wn!==null&&(l&&Wn.alternate!==null&&ht.delete(Wn.key===null?gt:Wn.key),q=S(Wn,q,gt),ft===null?it=Wn:ft.sibling=Wn,ft=Wn);return l&&ht.forEach(function(ls){return d(J,ls)}),hn&&na(J,gt),it}function rt(J,q,K,Te){var it=Me(K);if(typeof it!="function")throw Error(n(150));if(K=it.call(K),K==null)throw Error(n(151));for(var ft=it=null,ht=q,gt=q=0,Wn=null,Vt=K.next();ht!==null&&!Vt.done;gt++,Vt=K.next()){ht.index>gt?(Wn=ht,ht=null):Wn=ht.sibling;var ls=pe(J,ht,Vt.value,Te);if(ls===null){ht===null&&(ht=Wn);break}l&&ht&&ls.alternate===null&&d(J,ht),q=S(ls,q,gt),ft===null?it=ls:ft.sibling=ls,ft=ls,ht=Wn}if(Vt.done)return p(J,ht),hn&&na(J,gt),it;if(ht===null){for(;!Vt.done;gt++,Vt=K.next())Vt=xe(J,Vt.value,Te),Vt!==null&&(q=S(Vt,q,gt),ft===null?it=Vt:ft.sibling=Vt,ft=Vt);return hn&&na(J,gt),it}for(ht=y(J,ht);!Vt.done;gt++,Vt=K.next())Vt=We(ht,J,gt,Vt.value,Te),Vt!==null&&(l&&Vt.alternate!==null&&ht.delete(Vt.key===null?gt:Vt.key),q=S(Vt,q,gt),ft===null?it=Vt:ft.sibling=Vt,ft=Vt);return l&&ht.forEach(function(LN){return d(J,LN)}),hn&&na(J,gt),it}function An(J,q,K,Te){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case N:e:{for(var it=K.key,ft=q;ft!==null;){if(ft.key===it){if(it=K.type,it===j){if(ft.tag===7){p(J,ft.sibling),q=w(ft,K.props.children),q.return=J,J=q;break e}}else if(ft.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Q&&nv(it)===ft.type){p(J,ft.sibling),q=w(ft,K.props),q.ref=ku(J,ft,K),q.return=J,J=q;break e}p(J,ft);break}else d(J,ft);ft=ft.sibling}K.type===j?(q=ca(K.props.children,J.mode,Te,K.key),q.return=J,J=q):(Te=ff(K.type,K.key,K.props,null,J.mode,Te),Te.ref=ku(J,q,K),Te.return=J,J=Te)}return A(J);case M:e:{for(ft=K.key;q!==null;){if(q.key===ft)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){p(J,q.sibling),q=w(q,K.children||[]),q.return=J,J=q;break e}else{p(J,q);break}else d(J,q);q=q.sibling}q=C0(K,J.mode,Te),q.return=J,J=q}return A(J);case Q:return ft=K._init,An(J,q,ft(K._payload),Te)}if(Ei(K))return Qe(J,q,K,Te);if(Me(K))return rt(J,q,K,Te);Bd(J,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,q!==null&&q.tag===6?(p(J,q.sibling),q=w(q,K),q.return=J,J=q):(p(J,q),q=w0(K,J.mode,Te),q.return=J,J=q),A(J)):p(J,q)}return An}var rl=rv(!0),iv=rv(!1),Ud=Go(null),Vd=null,il=null,Dm=null;function Om(){Dm=il=Vd=null}function Rm(l){var d=Ud.current;ln(Ud),l._currentValue=d}function Pm(l,d,p){for(;l!==null;){var y=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,y!==null&&(y.childLanes|=d)):y!==null&&(y.childLanes&d)!==d&&(y.childLanes|=d),l===p)break;l=l.return}}function ol(l,d){Vd=l,Dm=il=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(jr=!0),l.firstContext=null)}function di(l){var d=l._currentValue;if(Dm!==l)if(l={context:l,memoizedValue:d,next:null},il===null){if(Vd===null)throw Error(n(308));il=l,Vd.dependencies={lanes:0,firstContext:l}}else il=il.next=l;return d}var ra=null;function jm(l){ra===null?ra=[l]:ra.push(l)}function ov(l,d,p,y){var w=d.interleaved;return w===null?(p.next=p,jm(d)):(p.next=w.next,w.next=p),d.interleaved=p,wo(l,y)}function wo(l,d){l.lanes|=d;var p=l.alternate;for(p!==null&&(p.lanes|=d),p=l,l=l.return;l!==null;)l.childLanes|=d,p=l.alternate,p!==null&&(p.childLanes|=d),p=l,l=l.return;return p.tag===3?p.stateNode:null}var Xo=!1;function zm(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sv(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Co(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function es(l,d,p){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,(Ut&2)!==0){var w=y.pending;return w===null?d.next=d:(d.next=w.next,w.next=d),y.pending=d,wo(l,p)}return w=y.interleaved,w===null?(d.next=d,jm(y)):(d.next=w.next,w.next=d),y.interleaved=d,wo(l,p)}function Hd(l,d,p){if(d=d.updateQueue,d!==null&&(d=d.shared,(p&4194240)!==0)){var y=d.lanes;y&=l.pendingLanes,p|=y,d.lanes=p,yo(l,p)}}function av(l,d){var p=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var w=null,S=null;if(p=p.firstBaseUpdate,p!==null){do{var A={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};S===null?w=S=A:S=S.next=A,p=p.next}while(p!==null);S===null?w=S=d:S=S.next=d}else w=S=d;p={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:y.shared,effects:y.effects},l.updateQueue=p;return}l=p.lastBaseUpdate,l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=d}function Wd(l,d,p,y){var w=l.updateQueue;Xo=!1;var S=w.firstBaseUpdate,A=w.lastBaseUpdate,z=w.shared.pending;if(z!==null){w.shared.pending=null;var V=z,Y=V.next;V.next=null,A===null?S=Y:A.next=Y,A=V;var ge=l.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==A&&(z===null?ge.firstBaseUpdate=Y:z.next=Y,ge.lastBaseUpdate=V))}if(S!==null){var xe=w.baseState;A=0,ge=Y=V=null,z=S;do{var pe=z.lane,We=z.eventTime;if((y&pe)===pe){ge!==null&&(ge=ge.next={eventTime:We,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Qe=l,rt=z;switch(pe=d,We=p,rt.tag){case 1:if(Qe=rt.payload,typeof Qe=="function"){xe=Qe.call(We,xe,pe);break e}xe=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=rt.payload,pe=typeof Qe=="function"?Qe.call(We,xe,pe):Qe,pe==null)break e;xe=D({},xe,pe);break e;case 2:Xo=!0}}z.callback!==null&&z.lane!==0&&(l.flags|=64,pe=w.effects,pe===null?w.effects=[z]:pe.push(z))}else We={eventTime:We,lane:pe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ge===null?(Y=ge=We,V=xe):ge=ge.next=We,A|=pe;if(z=z.next,z===null){if(z=w.shared.pending,z===null)break;pe=z,z=pe.next,pe.next=null,w.lastBaseUpdate=pe,w.shared.pending=null}}while(!0);if(ge===null&&(V=xe),w.baseState=V,w.firstBaseUpdate=Y,w.lastBaseUpdate=ge,d=w.shared.interleaved,d!==null){w=d;do A|=w.lane,w=w.next;while(w!==d)}else S===null&&(w.shared.lanes=0);sa|=A,l.lanes=A,l.memoizedState=xe}}function lv(l,d,p){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var y=l[d],w=y.callback;if(w!==null){if(y.callback=null,y=p,typeof w!="function")throw Error(n(191,w));w.call(y)}}}var wu={},Wi=Go(wu),Cu=Go(wu),Su=Go(wu);function ia(l){if(l===wu)throw Error(n(174));return l}function Lm(l,d){switch(en(Su,d),en(Cu,l),en(Wi,wu),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:Ie(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=Ie(d,l)}ln(Wi),en(Wi,d)}function sl(){ln(Wi),ln(Cu),ln(Su)}function uv(l){ia(Su.current);var d=ia(Wi.current),p=Ie(d,l.type);d!==p&&(en(Cu,l),en(Wi,p))}function Fm(l){Cu.current===l&&(ln(Wi),ln(Cu))}var xn=Go(0);function qd(l){for(var d=l;d!==null;){if(d.tag===13){var p=d.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var $m=[];function Bm(){for(var l=0;l<$m.length;l++)$m[l]._workInProgressVersionPrimary=null;$m.length=0}var Zd=I.ReactCurrentDispatcher,Um=I.ReactCurrentBatchConfig,oa=0,bn=null,Fn=null,Vn=null,Jd=!1,Eu=!1,_u=0,sN=0;function sr(){throw Error(n(321))}function Vm(l,d){if(d===null)return!1;for(var p=0;p<d.length&&p<l.length;p++)if(!Ii(l[p],d[p]))return!1;return!0}function Hm(l,d,p,y,w,S){if(oa=S,bn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Zd.current=l===null||l.memoizedState===null?cN:dN,l=p(y,w),Eu){S=0;do{if(Eu=!1,_u=0,25<=S)throw Error(n(301));S+=1,Vn=Fn=null,d.updateQueue=null,Zd.current=fN,l=p(y,w)}while(Eu)}if(Zd.current=Yd,d=Fn!==null&&Fn.next!==null,oa=0,Vn=Fn=bn=null,Jd=!1,d)throw Error(n(300));return l}function Wm(){var l=_u!==0;return _u=0,l}function qi(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?bn.memoizedState=Vn=l:Vn=Vn.next=l,Vn}function fi(){if(Fn===null){var l=bn.alternate;l=l!==null?l.memoizedState:null}else l=Fn.next;var d=Vn===null?bn.memoizedState:Vn.next;if(d!==null)Vn=d,Fn=l;else{if(l===null)throw Error(n(310));Fn=l,l={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Vn===null?bn.memoizedState=Vn=l:Vn=Vn.next=l}return Vn}function Tu(l,d){return typeof d=="function"?d(l):d}function qm(l){var d=fi(),p=d.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=Fn,w=y.baseQueue,S=p.pending;if(S!==null){if(w!==null){var A=w.next;w.next=S.next,S.next=A}y.baseQueue=w=S,p.pending=null}if(w!==null){S=w.next,y=y.baseState;var z=A=null,V=null,Y=S;do{var ge=Y.lane;if((oa&ge)===ge)V!==null&&(V=V.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),y=Y.hasEagerState?Y.eagerState:l(y,Y.action);else{var xe={lane:ge,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};V===null?(z=V=xe,A=y):V=V.next=xe,bn.lanes|=ge,sa|=ge}Y=Y.next}while(Y!==null&&Y!==S);V===null?A=y:V.next=z,Ii(y,d.memoizedState)||(jr=!0),d.memoizedState=y,d.baseState=A,d.baseQueue=V,p.lastRenderedState=y}if(l=p.interleaved,l!==null){w=l;do S=w.lane,bn.lanes|=S,sa|=S,w=w.next;while(w!==l)}else w===null&&(p.lanes=0);return[d.memoizedState,p.dispatch]}function Zm(l){var d=fi(),p=d.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=p.dispatch,w=p.pending,S=d.memoizedState;if(w!==null){p.pending=null;var A=w=w.next;do S=l(S,A.action),A=A.next;while(A!==w);Ii(S,d.memoizedState)||(jr=!0),d.memoizedState=S,d.baseQueue===null&&(d.baseState=S),p.lastRenderedState=S}return[S,y]}function cv(){}function dv(l,d){var p=bn,y=fi(),w=d(),S=!Ii(y.memoizedState,w);if(S&&(y.memoizedState=w,jr=!0),y=y.queue,Jm(pv.bind(null,p,y,l),[l]),y.getSnapshot!==d||S||Vn!==null&&Vn.memoizedState.tag&1){if(p.flags|=2048,Au(9,hv.bind(null,p,y,w,d),void 0,null),Hn===null)throw Error(n(349));(oa&30)!==0||fv(p,d,w)}return w}function fv(l,d,p){l.flags|=16384,l={getSnapshot:d,value:p},d=bn.updateQueue,d===null?(d={lastEffect:null,stores:null},bn.updateQueue=d,d.stores=[l]):(p=d.stores,p===null?d.stores=[l]:p.push(l))}function hv(l,d,p,y){d.value=p,d.getSnapshot=y,mv(d)&&gv(l)}function pv(l,d,p){return p(function(){mv(d)&&gv(l)})}function mv(l){var d=l.getSnapshot;l=l.value;try{var p=d();return!Ii(l,p)}catch{return!0}}function gv(l){var d=wo(l,1);d!==null&&ji(d,l,1,-1)}function yv(l){var d=qi();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tu,lastRenderedState:l},d.queue=l,l=l.dispatch=uN.bind(null,bn,l),[d.memoizedState,l]}function Au(l,d,p,y){return l={tag:l,create:d,destroy:p,deps:y,next:null},d=bn.updateQueue,d===null?(d={lastEffect:null,stores:null},bn.updateQueue=d,d.lastEffect=l.next=l):(p=d.lastEffect,p===null?d.lastEffect=l.next=l:(y=p.next,p.next=l,l.next=y,d.lastEffect=l)),l}function xv(){return fi().memoizedState}function Kd(l,d,p,y){var w=qi();bn.flags|=l,w.memoizedState=Au(1|d,p,void 0,y===void 0?null:y)}function Gd(l,d,p,y){var w=fi();y=y===void 0?null:y;var S=void 0;if(Fn!==null){var A=Fn.memoizedState;if(S=A.destroy,y!==null&&Vm(y,A.deps)){w.memoizedState=Au(d,p,S,y);return}}bn.flags|=l,w.memoizedState=Au(1|d,p,S,y)}function bv(l,d){return Kd(8390656,8,l,d)}function Jm(l,d){return Gd(2048,8,l,d)}function vv(l,d){return Gd(4,2,l,d)}function kv(l,d){return Gd(4,4,l,d)}function wv(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Cv(l,d,p){return p=p!=null?p.concat([l]):null,Gd(4,4,wv.bind(null,d,l),p)}function Km(){}function Sv(l,d){var p=fi();d=d===void 0?null:d;var y=p.memoizedState;return y!==null&&d!==null&&Vm(d,y[1])?y[0]:(p.memoizedState=[l,d],l)}function Ev(l,d){var p=fi();d=d===void 0?null:d;var y=p.memoizedState;return y!==null&&d!==null&&Vm(d,y[1])?y[0]:(l=l(),p.memoizedState=[l,d],l)}function _v(l,d,p){return(oa&21)===0?(l.baseState&&(l.baseState=!1,jr=!0),l.memoizedState=p):(Ii(p,d)||(p=mr(),bn.lanes|=p,sa|=p,l.baseState=!0),d)}function aN(l,d){var p=jt;jt=p!==0&&4>p?p:4,l(!0);var y=Um.transition;Um.transition={};try{l(!1),d()}finally{jt=p,Um.transition=y}}function Tv(){return fi().memoizedState}function lN(l,d,p){var y=is(l);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},Av(l))Mv(d,p);else if(p=ov(l,d,p,y),p!==null){var w=xr();ji(p,l,y,w),Nv(p,d,y)}}function uN(l,d,p){var y=is(l),w={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(Av(l))Mv(d,w);else{var S=l.alternate;if(l.lanes===0&&(S===null||S.lanes===0)&&(S=d.lastRenderedReducer,S!==null))try{var A=d.lastRenderedState,z=S(A,p);if(w.hasEagerState=!0,w.eagerState=z,Ii(z,A)){var V=d.interleaved;V===null?(w.next=w,jm(d)):(w.next=V.next,V.next=w),d.interleaved=w;return}}catch{}finally{}p=ov(l,d,w,y),p!==null&&(w=xr(),ji(p,l,y,w),Nv(p,d,y))}}function Av(l){var d=l.alternate;return l===bn||d!==null&&d===bn}function Mv(l,d){Eu=Jd=!0;var p=l.pending;p===null?d.next=d:(d.next=p.next,p.next=d),l.pending=d}function Nv(l,d,p){if((p&4194240)!==0){var y=d.lanes;y&=l.pendingLanes,p|=y,d.lanes=p,yo(l,p)}}var Yd={readContext:di,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},cN={readContext:di,useCallback:function(l,d){return qi().memoizedState=[l,d===void 0?null:d],l},useContext:di,useEffect:bv,useImperativeHandle:function(l,d,p){return p=p!=null?p.concat([l]):null,Kd(4194308,4,wv.bind(null,d,l),p)},useLayoutEffect:function(l,d){return Kd(4194308,4,l,d)},useInsertionEffect:function(l,d){return Kd(4,2,l,d)},useMemo:function(l,d){var p=qi();return d=d===void 0?null:d,l=l(),p.memoizedState=[l,d],l},useReducer:function(l,d,p){var y=qi();return d=p!==void 0?p(d):d,y.memoizedState=y.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},y.queue=l,l=l.dispatch=lN.bind(null,bn,l),[y.memoizedState,l]},useRef:function(l){var d=qi();return l={current:l},d.memoizedState=l},useState:yv,useDebugValue:Km,useDeferredValue:function(l){return qi().memoizedState=l},useTransition:function(){var l=yv(!1),d=l[0];return l=aN.bind(null,l[1]),qi().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,p){var y=bn,w=qi();if(hn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=d(),Hn===null)throw Error(n(349));(oa&30)!==0||fv(y,d,p)}w.memoizedState=p;var S={value:p,getSnapshot:d};return w.queue=S,bv(pv.bind(null,y,S,l),[l]),y.flags|=2048,Au(9,hv.bind(null,y,S,p,d),void 0,null),p},useId:function(){var l=qi(),d=Hn.identifierPrefix;if(hn){var p=ko,y=vo;p=(y&~(1<<32-Ye(y)-1)).toString(32)+p,d=":"+d+"R"+p,p=_u++,0<p&&(d+="H"+p.toString(32)),d+=":"}else p=sN++,d=":"+d+"r"+p.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},dN={readContext:di,useCallback:Sv,useContext:di,useEffect:Jm,useImperativeHandle:Cv,useInsertionEffect:vv,useLayoutEffect:kv,useMemo:Ev,useReducer:qm,useRef:xv,useState:function(){return qm(Tu)},useDebugValue:Km,useDeferredValue:function(l){var d=fi();return _v(d,Fn.memoizedState,l)},useTransition:function(){var l=qm(Tu)[0],d=fi().memoizedState;return[l,d]},useMutableSource:cv,useSyncExternalStore:dv,useId:Tv,unstable_isNewReconciler:!1},fN={readContext:di,useCallback:Sv,useContext:di,useEffect:Jm,useImperativeHandle:Cv,useInsertionEffect:vv,useLayoutEffect:kv,useMemo:Ev,useReducer:Zm,useRef:xv,useState:function(){return Zm(Tu)},useDebugValue:Km,useDeferredValue:function(l){var d=fi();return Fn===null?d.memoizedState=l:_v(d,Fn.memoizedState,l)},useTransition:function(){var l=Zm(Tu)[0],d=fi().memoizedState;return[l,d]},useMutableSource:cv,useSyncExternalStore:dv,useId:Tv,unstable_isNewReconciler:!1};function Oi(l,d){if(l&&l.defaultProps){d=D({},d),l=l.defaultProps;for(var p in l)d[p]===void 0&&(d[p]=l[p]);return d}return d}function Gm(l,d,p,y){d=l.memoizedState,p=p(y,d),p=p==null?d:D({},d,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}var Qd={isMounted:function(l){return(l=l._reactInternals)?wt(l)===l:!1},enqueueSetState:function(l,d,p){l=l._reactInternals;var y=xr(),w=is(l),S=Co(y,w);S.payload=d,p!=null&&(S.callback=p),d=es(l,S,w),d!==null&&(ji(d,l,w,y),Hd(d,l,w))},enqueueReplaceState:function(l,d,p){l=l._reactInternals;var y=xr(),w=is(l),S=Co(y,w);S.tag=1,S.payload=d,p!=null&&(S.callback=p),d=es(l,S,w),d!==null&&(ji(d,l,w,y),Hd(d,l,w))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var p=xr(),y=is(l),w=Co(p,y);w.tag=2,d!=null&&(w.callback=d),d=es(l,w,y),d!==null&&(ji(d,l,y,p),Hd(d,l,y))}};function Iv(l,d,p,y,w,S,A){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,S,A):d.prototype&&d.prototype.isPureReactComponent?!pu(p,y)||!pu(w,S):!0}function Dv(l,d,p){var y=!1,w=Yo,S=d.contextType;return typeof S=="object"&&S!==null?S=di(S):(w=Pr(d)?ea:or.current,y=d.contextTypes,S=(y=y!=null)?Xa(l,w):Yo),d=new d(p,S),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Qd,l.stateNode=d,d._reactInternals=l,y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=w,l.__reactInternalMemoizedMaskedChildContext=S),d}function Ov(l,d,p,y){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(p,y),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(p,y),d.state!==l&&Qd.enqueueReplaceState(d,d.state,null)}function Ym(l,d,p,y){var w=l.stateNode;w.props=p,w.state=l.memoizedState,w.refs={},zm(l);var S=d.contextType;typeof S=="object"&&S!==null?w.context=di(S):(S=Pr(d)?ea:or.current,w.context=Xa(l,S)),w.state=l.memoizedState,S=d.getDerivedStateFromProps,typeof S=="function"&&(Gm(l,d,S,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(d=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),d!==w.state&&Qd.enqueueReplaceState(w,w.state,null),Wd(l,p,w,y),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308)}function al(l,d){try{var p="",y=d;do p+=U(y),y=y.return;while(y);var w=p}catch(S){w=`
39
- Error generating stack: `+S.message+`
40
- `+S.stack}return{value:l,source:d,stack:w,digest:null}}function Qm(l,d,p){return{value:l,source:null,stack:p??null,digest:d??null}}function Xm(l,d){try{console.error(d.value)}catch(p){setTimeout(function(){throw p})}}var hN=typeof WeakMap=="function"?WeakMap:Map;function Rv(l,d,p){p=Co(-1,p),p.tag=3,p.payload={element:null};var y=d.value;return p.callback=function(){sf||(sf=!0,p0=y),Xm(l,d)},p}function Pv(l,d,p){p=Co(-1,p),p.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var w=d.value;p.payload=function(){return y(w)},p.callback=function(){Xm(l,d)}}var S=l.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(p.callback=function(){Xm(l,d),typeof y!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})}),p}function jv(l,d,p){var y=l.pingCache;if(y===null){y=l.pingCache=new hN;var w=new Set;y.set(d,w)}else w=y.get(d),w===void 0&&(w=new Set,y.set(d,w));w.has(p)||(w.add(p),l=TN.bind(null,l,d,p),d.then(l,l))}function zv(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function Lv(l,d,p,y,w){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(d=Co(-1,1),d.tag=2,es(p,d,1))),p.lanes|=1),l):(l.flags|=65536,l.lanes=w,l)}var pN=I.ReactCurrentOwner,jr=!1;function yr(l,d,p,y){d.child=l===null?iv(d,null,p,y):rl(d,l.child,p,y)}function Fv(l,d,p,y,w){p=p.render;var S=d.ref;return ol(d,w),y=Hm(l,d,p,y,S,w),p=Wm(),l!==null&&!jr?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~w,So(l,d,w)):(hn&&p&&Tm(d),d.flags|=1,yr(l,d,y,w),d.child)}function $v(l,d,p,y,w){if(l===null){var S=p.type;return typeof S=="function"&&!k0(S)&&S.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(d.tag=15,d.type=S,Bv(l,d,S,y,w)):(l=ff(p.type,null,y,d,d.mode,w),l.ref=d.ref,l.return=d,d.child=l)}if(S=l.child,(l.lanes&w)===0){var A=S.memoizedProps;if(p=p.compare,p=p!==null?p:pu,p(A,y)&&l.ref===d.ref)return So(l,d,w)}return d.flags|=1,l=as(S,y),l.ref=d.ref,l.return=d,d.child=l}function Bv(l,d,p,y,w){if(l!==null){var S=l.memoizedProps;if(pu(S,y)&&l.ref===d.ref)if(jr=!1,d.pendingProps=y=S,(l.lanes&w)!==0)(l.flags&131072)!==0&&(jr=!0);else return d.lanes=l.lanes,So(l,d,w)}return e0(l,d,p,y,w)}function Uv(l,d,p){var y=d.pendingProps,w=y.children,S=l!==null?l.memoizedState:null;if(y.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},en(ul,Yr),Yr|=p;else{if((p&1073741824)===0)return l=S!==null?S.baseLanes|p:p,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,en(ul,Yr),Yr|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=S!==null?S.baseLanes:p,en(ul,Yr),Yr|=y}else S!==null?(y=S.baseLanes|p,d.memoizedState=null):y=p,en(ul,Yr),Yr|=y;return yr(l,d,w,p),d.child}function Vv(l,d){var p=d.ref;(l===null&&p!==null||l!==null&&l.ref!==p)&&(d.flags|=512,d.flags|=2097152)}function e0(l,d,p,y,w){var S=Pr(p)?ea:or.current;return S=Xa(d,S),ol(d,w),p=Hm(l,d,p,y,S,w),y=Wm(),l!==null&&!jr?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~w,So(l,d,w)):(hn&&y&&Tm(d),d.flags|=1,yr(l,d,p,w),d.child)}function Hv(l,d,p,y,w){if(Pr(p)){var S=!0;jd(d)}else S=!1;if(ol(d,w),d.stateNode===null)ef(l,d),Dv(d,p,y),Ym(d,p,y,w),y=!0;else if(l===null){var A=d.stateNode,z=d.memoizedProps;A.props=z;var V=A.context,Y=p.contextType;typeof Y=="object"&&Y!==null?Y=di(Y):(Y=Pr(p)?ea:or.current,Y=Xa(d,Y));var ge=p.getDerivedStateFromProps,xe=typeof ge=="function"||typeof A.getSnapshotBeforeUpdate=="function";xe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(z!==y||V!==Y)&&Ov(d,A,y,Y),Xo=!1;var pe=d.memoizedState;A.state=pe,Wd(d,y,A,w),V=d.memoizedState,z!==y||pe!==V||Rr.current||Xo?(typeof ge=="function"&&(Gm(d,p,ge,y),V=d.memoizedState),(z=Xo||Iv(d,p,z,y,pe,V,Y))?(xe||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"&&(d.flags|=4194308)):(typeof A.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=y,d.memoizedState=V),A.props=y,A.state=V,A.context=Y,y=z):(typeof A.componentDidMount=="function"&&(d.flags|=4194308),y=!1)}else{A=d.stateNode,sv(l,d),z=d.memoizedProps,Y=d.type===d.elementType?z:Oi(d.type,z),A.props=Y,xe=d.pendingProps,pe=A.context,V=p.contextType,typeof V=="object"&&V!==null?V=di(V):(V=Pr(p)?ea:or.current,V=Xa(d,V));var We=p.getDerivedStateFromProps;(ge=typeof We=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(z!==xe||pe!==V)&&Ov(d,A,y,V),Xo=!1,pe=d.memoizedState,A.state=pe,Wd(d,y,A,w);var Qe=d.memoizedState;z!==xe||pe!==Qe||Rr.current||Xo?(typeof We=="function"&&(Gm(d,p,We,y),Qe=d.memoizedState),(Y=Xo||Iv(d,p,Y,y,pe,Qe,V)||!1)?(ge||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(y,Qe,V),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(y,Qe,V)),typeof A.componentDidUpdate=="function"&&(d.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof A.componentDidUpdate!="function"||z===l.memoizedProps&&pe===l.memoizedState||(d.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&pe===l.memoizedState||(d.flags|=1024),d.memoizedProps=y,d.memoizedState=Qe),A.props=y,A.state=Qe,A.context=V,y=Y):(typeof A.componentDidUpdate!="function"||z===l.memoizedProps&&pe===l.memoizedState||(d.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&pe===l.memoizedState||(d.flags|=1024),y=!1)}return t0(l,d,p,y,S,w)}function t0(l,d,p,y,w,S){Vv(l,d);var A=(d.flags&128)!==0;if(!y&&!A)return w&&Kb(d,p,!1),So(l,d,S);y=d.stateNode,pN.current=d;var z=A&&typeof p.getDerivedStateFromError!="function"?null:y.render();return d.flags|=1,l!==null&&A?(d.child=rl(d,l.child,null,S),d.child=rl(d,null,z,S)):yr(l,d,z,S),d.memoizedState=y.state,w&&Kb(d,p,!0),d.child}function Wv(l){var d=l.stateNode;d.pendingContext?Zb(l,d.pendingContext,d.pendingContext!==d.context):d.context&&Zb(l,d.context,!1),Lm(l,d.containerInfo)}function qv(l,d,p,y,w){return nl(),Im(w),d.flags|=256,yr(l,d,p,y),d.child}var n0={dehydrated:null,treeContext:null,retryLane:0};function r0(l){return{baseLanes:l,cachePool:null,transitions:null}}function Zv(l,d,p){var y=d.pendingProps,w=xn.current,S=!1,A=(d.flags&128)!==0,z;if((z=A)||(z=l!==null&&l.memoizedState===null?!1:(w&2)!==0),z?(S=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(w|=1),en(xn,w&1),l===null)return Nm(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(A=y.children,l=y.fallback,S?(y=d.mode,S=d.child,A={mode:"hidden",children:A},(y&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=A):S=hf(A,y,0,null),l=ca(l,y,p,null),S.return=d,l.return=d,S.sibling=l,d.child=S,d.child.memoizedState=r0(p),d.memoizedState=n0,l):i0(d,A));if(w=l.memoizedState,w!==null&&(z=w.dehydrated,z!==null))return mN(l,d,A,y,z,w,p);if(S){S=y.fallback,A=d.mode,w=l.child,z=w.sibling;var V={mode:"hidden",children:y.children};return(A&1)===0&&d.child!==w?(y=d.child,y.childLanes=0,y.pendingProps=V,d.deletions=null):(y=as(w,V),y.subtreeFlags=w.subtreeFlags&14680064),z!==null?S=as(z,S):(S=ca(S,A,p,null),S.flags|=2),S.return=d,y.return=d,y.sibling=S,d.child=y,y=S,S=d.child,A=l.child.memoizedState,A=A===null?r0(p):{baseLanes:A.baseLanes|p,cachePool:null,transitions:A.transitions},S.memoizedState=A,S.childLanes=l.childLanes&~p,d.memoizedState=n0,y}return S=l.child,l=S.sibling,y=as(S,{mode:"visible",children:y.children}),(d.mode&1)===0&&(y.lanes=p),y.return=d,y.sibling=null,l!==null&&(p=d.deletions,p===null?(d.deletions=[l],d.flags|=16):p.push(l)),d.child=y,d.memoizedState=null,y}function i0(l,d){return d=hf({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function Xd(l,d,p,y){return y!==null&&Im(y),rl(d,l.child,null,p),l=i0(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function mN(l,d,p,y,w,S,A){if(p)return d.flags&256?(d.flags&=-257,y=Qm(Error(n(422))),Xd(l,d,A,y)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(S=y.fallback,w=d.mode,y=hf({mode:"visible",children:y.children},w,0,null),S=ca(S,w,A,null),S.flags|=2,y.return=d,S.return=d,y.sibling=S,d.child=y,(d.mode&1)!==0&&rl(d,l.child,null,A),d.child.memoizedState=r0(A),d.memoizedState=n0,S);if((d.mode&1)===0)return Xd(l,d,A,null);if(w.data==="$!"){if(y=w.nextSibling&&w.nextSibling.dataset,y)var z=y.dgst;return y=z,S=Error(n(419)),y=Qm(S,y,void 0),Xd(l,d,A,y)}if(z=(A&l.childLanes)!==0,jr||z){if(y=Hn,y!==null){switch(A&-A){case 4:w=2;break;case 16:w=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(y.suspendedLanes|A))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,wo(l,w),ji(y,l,w,-1))}return v0(),y=Qm(Error(n(421))),Xd(l,d,A,y)}return w.data==="$?"?(d.flags|=128,d.child=l.child,d=AN.bind(null,l),w._reactRetry=d,null):(l=S.treeContext,Gr=Ko(w.nextSibling),Kr=d,hn=!0,Di=null,l!==null&&(ui[ci++]=vo,ui[ci++]=ko,ui[ci++]=ta,vo=l.id,ko=l.overflow,ta=d),d=i0(d,y.children),d.flags|=4096,d)}function Jv(l,d,p){l.lanes|=d;var y=l.alternate;y!==null&&(y.lanes|=d),Pm(l.return,d,p)}function o0(l,d,p,y,w){var S=l.memoizedState;S===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:w}:(S.isBackwards=d,S.rendering=null,S.renderingStartTime=0,S.last=y,S.tail=p,S.tailMode=w)}function Kv(l,d,p){var y=d.pendingProps,w=y.revealOrder,S=y.tail;if(yr(l,d,y.children,p),y=xn.current,(y&2)!==0)y=y&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Jv(l,p,d);else if(l.tag===19)Jv(l,p,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}y&=1}if(en(xn,y),(d.mode&1)===0)d.memoizedState=null;else switch(w){case"forwards":for(p=d.child,w=null;p!==null;)l=p.alternate,l!==null&&qd(l)===null&&(w=p),p=p.sibling;p=w,p===null?(w=d.child,d.child=null):(w=p.sibling,p.sibling=null),o0(d,!1,w,p,S);break;case"backwards":for(p=null,w=d.child,d.child=null;w!==null;){if(l=w.alternate,l!==null&&qd(l)===null){d.child=w;break}l=w.sibling,w.sibling=p,p=w,w=l}o0(d,!0,p,null,S);break;case"together":o0(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function ef(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function So(l,d,p){if(l!==null&&(d.dependencies=l.dependencies),sa|=d.lanes,(p&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(n(153));if(d.child!==null){for(l=d.child,p=as(l,l.pendingProps),d.child=p,p.return=d;l.sibling!==null;)l=l.sibling,p=p.sibling=as(l,l.pendingProps),p.return=d;p.sibling=null}return d.child}function gN(l,d,p){switch(d.tag){case 3:Wv(d),nl();break;case 5:uv(d);break;case 1:Pr(d.type)&&jd(d);break;case 4:Lm(d,d.stateNode.containerInfo);break;case 10:var y=d.type._context,w=d.memoizedProps.value;en(Ud,y._currentValue),y._currentValue=w;break;case 13:if(y=d.memoizedState,y!==null)return y.dehydrated!==null?(en(xn,xn.current&1),d.flags|=128,null):(p&d.child.childLanes)!==0?Zv(l,d,p):(en(xn,xn.current&1),l=So(l,d,p),l!==null?l.sibling:null);en(xn,xn.current&1);break;case 19:if(y=(p&d.childLanes)!==0,(l.flags&128)!==0){if(y)return Kv(l,d,p);d.flags|=128}if(w=d.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),en(xn,xn.current),y)break;return null;case 22:case 23:return d.lanes=0,Uv(l,d,p)}return So(l,d,p)}var Gv,s0,Yv,Qv;Gv=function(l,d){for(var p=d.child;p!==null;){if(p.tag===5||p.tag===6)l.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},s0=function(){},Yv=function(l,d,p,y){var w=l.memoizedProps;if(w!==y){l=d.stateNode,ia(Wi.current);var S=null;switch(p){case"input":w=Qn(l,w),y=Qn(l,y),S=[];break;case"select":w=D({},w,{value:void 0}),y=D({},y,{value:void 0}),S=[];break;case"textarea":w=ai(l,w),y=ai(l,y),S=[];break;default:typeof w.onClick!="function"&&typeof y.onClick=="function"&&(l.onclick=Od)}Ln(p,y);var A;p=null;for(Y in w)if(!y.hasOwnProperty(Y)&&w.hasOwnProperty(Y)&&w[Y]!=null)if(Y==="style"){var z=w[Y];for(A in z)z.hasOwnProperty(A)&&(p||(p={}),p[A]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?S||(S=[]):(S=S||[]).push(Y,null));for(Y in y){var V=y[Y];if(z=w!=null?w[Y]:void 0,y.hasOwnProperty(Y)&&V!==z&&(V!=null||z!=null))if(Y==="style")if(z){for(A in z)!z.hasOwnProperty(A)||V&&V.hasOwnProperty(A)||(p||(p={}),p[A]="");for(A in V)V.hasOwnProperty(A)&&z[A]!==V[A]&&(p||(p={}),p[A]=V[A])}else p||(S||(S=[]),S.push(Y,p)),p=V;else Y==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,z=z?z.__html:void 0,V!=null&&z!==V&&(S=S||[]).push(Y,V)):Y==="children"?typeof V!="string"&&typeof V!="number"||(S=S||[]).push(Y,""+V):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(V!=null&&Y==="onScroll"&&an("scroll",l),S||z===V||(S=[])):(S=S||[]).push(Y,V))}p&&(S=S||[]).push("style",p);var Y=S;(d.updateQueue=Y)&&(d.flags|=4)}},Qv=function(l,d,p,y){p!==y&&(d.flags|=4)};function Mu(l,d){if(!hn)switch(l.tailMode){case"hidden":d=l.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l.tail=null:p.sibling=null;break;case"collapsed":p=l.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function ar(l){var d=l.alternate!==null&&l.alternate.child===l.child,p=0,y=0;if(d)for(var w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags&14680064,y|=w.flags&14680064,w.return=l,w=w.sibling;else for(w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=l,w=w.sibling;return l.subtreeFlags|=y,l.childLanes=p,d}function yN(l,d,p){var y=d.pendingProps;switch(Am(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ar(d),null;case 1:return Pr(d.type)&&Pd(),ar(d),null;case 3:return y=d.stateNode,sl(),ln(Rr),ln(or),Bm(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(l===null||l.child===null)&&($d(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Di!==null&&(y0(Di),Di=null))),s0(l,d),ar(d),null;case 5:Fm(d);var w=ia(Su.current);if(p=d.type,l!==null&&d.stateNode!=null)Yv(l,d,p,y,w),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!y){if(d.stateNode===null)throw Error(n(166));return ar(d),null}if(l=ia(Wi.current),$d(d)){y=d.stateNode,p=d.type;var S=d.memoizedProps;switch(y[Hi]=d,y[bu]=S,l=(d.mode&1)!==0,p){case"dialog":an("cancel",y),an("close",y);break;case"iframe":case"object":case"embed":an("load",y);break;case"video":case"audio":for(w=0;w<gu.length;w++)an(gu[w],y);break;case"source":an("error",y);break;case"img":case"image":case"link":an("error",y),an("load",y);break;case"details":an("toggle",y);break;case"input":Gs(y,S),an("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!S.multiple},an("invalid",y);break;case"textarea":Qs(y,S),an("invalid",y)}Ln(p,S),w=null;for(var A in S)if(S.hasOwnProperty(A)){var z=S[A];A==="children"?typeof z=="string"?y.textContent!==z&&(S.suppressHydrationWarning!==!0&&Dd(y.textContent,z,l),w=["children",z]):typeof z=="number"&&y.textContent!==""+z&&(S.suppressHydrationWarning!==!0&&Dd(y.textContent,z,l),w=["children",""+z]):i.hasOwnProperty(A)&&z!=null&&A==="onScroll"&&an("scroll",y)}switch(p){case"input":xt(y),po(y,S,!0);break;case"textarea":xt(y),mo(y);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(y.onclick=Od)}y=w,d.updateQueue=y,y!==null&&(d.flags|=4)}else{A=w.nodeType===9?w:w.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=re(p)),l==="http://www.w3.org/1999/xhtml"?p==="script"?(l=A.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof y.is=="string"?l=A.createElement(p,{is:y.is}):(l=A.createElement(p),p==="select"&&(A=l,y.multiple?A.multiple=!0:y.size&&(A.size=y.size))):l=A.createElementNS(l,p),l[Hi]=d,l[bu]=y,Gv(l,d,!1,!1),d.stateNode=l;e:{switch(A=li(p,y),p){case"dialog":an("cancel",l),an("close",l),w=y;break;case"iframe":case"object":case"embed":an("load",l),w=y;break;case"video":case"audio":for(w=0;w<gu.length;w++)an(gu[w],l);w=y;break;case"source":an("error",l),w=y;break;case"img":case"image":case"link":an("error",l),an("load",l),w=y;break;case"details":an("toggle",l),w=y;break;case"input":Gs(l,y),w=Qn(l,y),an("invalid",l);break;case"option":w=y;break;case"select":l._wrapperState={wasMultiple:!!y.multiple},w=D({},y,{value:void 0}),an("invalid",l);break;case"textarea":Qs(l,y),w=ai(l,y),an("invalid",l);break;default:w=y}Ln(p,w),z=w;for(S in z)if(z.hasOwnProperty(S)){var V=z[S];S==="style"?Vi(l,V):S==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Tt(l,V)):S==="children"?typeof V=="string"?(p!=="textarea"||V!=="")&&zt(l,V):typeof V=="number"&&zt(l,""+V):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?V!=null&&S==="onScroll"&&an("scroll",l):V!=null&&E(l,S,V,A))}switch(p){case"input":xt(l),po(l,y,!1);break;case"textarea":xt(l),mo(l);break;case"option":y.value!=null&&l.setAttribute("value",""+Pe(y.value));break;case"select":l.multiple=!!y.multiple,S=y.value,S!=null?Mr(l,!!y.multiple,S,!1):y.defaultValue!=null&&Mr(l,!!y.multiple,y.defaultValue,!0);break;default:typeof w.onClick=="function"&&(l.onclick=Od)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return ar(d),null;case 6:if(l&&d.stateNode!=null)Qv(l,d,l.memoizedProps,y);else{if(typeof y!="string"&&d.stateNode===null)throw Error(n(166));if(p=ia(Su.current),ia(Wi.current),$d(d)){if(y=d.stateNode,p=d.memoizedProps,y[Hi]=d,(S=y.nodeValue!==p)&&(l=Kr,l!==null))switch(l.tag){case 3:Dd(y.nodeValue,p,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Dd(y.nodeValue,p,(l.mode&1)!==0)}S&&(d.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[Hi]=d,d.stateNode=y}return ar(d),null;case 13:if(ln(xn),y=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Gr!==null&&(d.mode&1)!==0&&(d.flags&128)===0)tv(),nl(),d.flags|=98560,S=!1;else if(S=$d(d),y!==null&&y.dehydrated!==null){if(l===null){if(!S)throw Error(n(318));if(S=d.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[Hi]=d}else nl(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;ar(d),S=!1}else Di!==null&&(y0(Di),Di=null),S=!0;if(!S)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=p,d):(y=y!==null,y!==(l!==null&&l.memoizedState!==null)&&y&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(xn.current&1)!==0?$n===0&&($n=3):v0())),d.updateQueue!==null&&(d.flags|=4),ar(d),null);case 4:return sl(),s0(l,d),l===null&&yu(d.stateNode.containerInfo),ar(d),null;case 10:return Rm(d.type._context),ar(d),null;case 17:return Pr(d.type)&&Pd(),ar(d),null;case 19:if(ln(xn),S=d.memoizedState,S===null)return ar(d),null;if(y=(d.flags&128)!==0,A=S.rendering,A===null)if(y)Mu(S,!1);else{if($n!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(A=qd(l),A!==null){for(d.flags|=128,Mu(S,!1),y=A.updateQueue,y!==null&&(d.updateQueue=y,d.flags|=4),d.subtreeFlags=0,y=p,p=d.child;p!==null;)S=p,l=y,S.flags&=14680066,A=S.alternate,A===null?(S.childLanes=0,S.lanes=l,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=A.childLanes,S.lanes=A.lanes,S.child=A.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=A.memoizedProps,S.memoizedState=A.memoizedState,S.updateQueue=A.updateQueue,S.type=A.type,l=A.dependencies,S.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),p=p.sibling;return en(xn,xn.current&1|2),d.child}l=l.sibling}S.tail!==null&&ae()>cl&&(d.flags|=128,y=!0,Mu(S,!1),d.lanes=4194304)}else{if(!y)if(l=qd(A),l!==null){if(d.flags|=128,y=!0,p=l.updateQueue,p!==null&&(d.updateQueue=p,d.flags|=4),Mu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!A.alternate&&!hn)return ar(d),null}else 2*ae()-S.renderingStartTime>cl&&p!==1073741824&&(d.flags|=128,y=!0,Mu(S,!1),d.lanes=4194304);S.isBackwards?(A.sibling=d.child,d.child=A):(p=S.last,p!==null?p.sibling=A:d.child=A,S.last=A)}return S.tail!==null?(d=S.tail,S.rendering=d,S.tail=d.sibling,S.renderingStartTime=ae(),d.sibling=null,p=xn.current,en(xn,y?p&1|2:p&1),d):(ar(d),null);case 22:case 23:return b0(),y=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==y&&(d.flags|=8192),y&&(d.mode&1)!==0?(Yr&1073741824)!==0&&(ar(d),d.subtreeFlags&6&&(d.flags|=8192)):ar(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function xN(l,d){switch(Am(d),d.tag){case 1:return Pr(d.type)&&Pd(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return sl(),ln(Rr),ln(or),Bm(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return Fm(d),null;case 13:if(ln(xn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));nl()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return ln(xn),null;case 4:return sl(),null;case 10:return Rm(d.type._context),null;case 22:case 23:return b0(),null;case 24:return null;default:return null}}var tf=!1,lr=!1,bN=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function ll(l,d){var p=l.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Sn(l,d,y)}else p.current=null}function a0(l,d,p){try{p()}catch(y){Sn(l,d,y)}}var Xv=!1;function vN(l,d){if(bm=kd,l=Ib(),dm(l)){if("selectionStart"in l)var p={start:l.selectionStart,end:l.selectionEnd};else e:{p=(p=l.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var w=y.anchorOffset,S=y.focusNode;y=y.focusOffset;try{p.nodeType,S.nodeType}catch{p=null;break e}var A=0,z=-1,V=-1,Y=0,ge=0,xe=l,pe=null;t:for(;;){for(var We;xe!==p||w!==0&&xe.nodeType!==3||(z=A+w),xe!==S||y!==0&&xe.nodeType!==3||(V=A+y),xe.nodeType===3&&(A+=xe.nodeValue.length),(We=xe.firstChild)!==null;)pe=xe,xe=We;for(;;){if(xe===l)break t;if(pe===p&&++Y===w&&(z=A),pe===S&&++ge===y&&(V=A),(We=xe.nextSibling)!==null)break;xe=pe,pe=xe.parentNode}xe=We}p=z===-1||V===-1?null:{start:z,end:V}}else p=null}p=p||{start:0,end:0}}else p=null;for(vm={focusedElem:l,selectionRange:p},kd=!1,Ke=d;Ke!==null;)if(d=Ke,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,Ke=l;else for(;Ke!==null;){d=Ke;try{var Qe=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var rt=Qe.memoizedProps,An=Qe.memoizedState,J=d.stateNode,q=J.getSnapshotBeforeUpdate(d.elementType===d.type?rt:Oi(d.type,rt),An);J.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var K=d.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Te){Sn(d,d.return,Te)}if(l=d.sibling,l!==null){l.return=d.return,Ke=l;break}Ke=d.return}return Qe=Xv,Xv=!1,Qe}function Nu(l,d,p){var y=d.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var w=y=y.next;do{if((w.tag&l)===l){var S=w.destroy;w.destroy=void 0,S!==void 0&&a0(d,p,S)}w=w.next}while(w!==y)}}function nf(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&l)===l){var y=p.create;p.destroy=y()}p=p.next}while(p!==d)}}function l0(l){var d=l.ref;if(d!==null){var p=l.stateNode;switch(l.tag){case 5:l=p;break;default:l=p}typeof d=="function"?d(l):d.current=l}}function ek(l){var d=l.alternate;d!==null&&(l.alternate=null,ek(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Hi],delete d[bu],delete d[Sm],delete d[nN],delete d[rN])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function tk(l){return l.tag===5||l.tag===3||l.tag===4}function nk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||tk(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function u0(l,d,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,d?p.nodeType===8?p.parentNode.insertBefore(l,d):p.insertBefore(l,d):(p.nodeType===8?(d=p.parentNode,d.insertBefore(l,p)):(d=p,d.appendChild(l)),p=p._reactRootContainer,p!=null||d.onclick!==null||(d.onclick=Od));else if(y!==4&&(l=l.child,l!==null))for(u0(l,d,p),l=l.sibling;l!==null;)u0(l,d,p),l=l.sibling}function c0(l,d,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,d?p.insertBefore(l,d):p.appendChild(l);else if(y!==4&&(l=l.child,l!==null))for(c0(l,d,p),l=l.sibling;l!==null;)c0(l,d,p),l=l.sibling}var Xn=null,Ri=!1;function ts(l,d,p){for(p=p.child;p!==null;)rk(l,d,p),p=p.sibling}function rk(l,d,p){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(ne,p)}catch{}switch(p.tag){case 5:lr||ll(p,d);case 6:var y=Xn,w=Ri;Xn=null,ts(l,d,p),Xn=y,Ri=w,Xn!==null&&(Ri?(l=Xn,p=p.stateNode,l.nodeType===8?l.parentNode.removeChild(p):l.removeChild(p)):Xn.removeChild(p.stateNode));break;case 18:Xn!==null&&(Ri?(l=Xn,p=p.stateNode,l.nodeType===8?Cm(l.parentNode,p):l.nodeType===1&&Cm(l,p),lu(l)):Cm(Xn,p.stateNode));break;case 4:y=Xn,w=Ri,Xn=p.stateNode.containerInfo,Ri=!0,ts(l,d,p),Xn=y,Ri=w;break;case 0:case 11:case 14:case 15:if(!lr&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){w=y=y.next;do{var S=w,A=S.destroy;S=S.tag,A!==void 0&&((S&2)!==0||(S&4)!==0)&&a0(p,d,A),w=w.next}while(w!==y)}ts(l,d,p);break;case 1:if(!lr&&(ll(p,d),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(z){Sn(p,d,z)}ts(l,d,p);break;case 21:ts(l,d,p);break;case 22:p.mode&1?(lr=(y=lr)||p.memoizedState!==null,ts(l,d,p),lr=y):ts(l,d,p);break;default:ts(l,d,p)}}function ik(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var p=l.stateNode;p===null&&(p=l.stateNode=new bN),d.forEach(function(y){var w=MN.bind(null,l,y);p.has(y)||(p.add(y),y.then(w,w))})}}function Pi(l,d){var p=d.deletions;if(p!==null)for(var y=0;y<p.length;y++){var w=p[y];try{var S=l,A=d,z=A;e:for(;z!==null;){switch(z.tag){case 5:Xn=z.stateNode,Ri=!1;break e;case 3:Xn=z.stateNode.containerInfo,Ri=!0;break e;case 4:Xn=z.stateNode.containerInfo,Ri=!0;break e}z=z.return}if(Xn===null)throw Error(n(160));rk(S,A,w),Xn=null,Ri=!1;var V=w.alternate;V!==null&&(V.return=null),w.return=null}catch(Y){Sn(w,d,Y)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)ok(d,l),d=d.sibling}function ok(l,d){var p=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Pi(d,l),Zi(l),y&4){try{Nu(3,l,l.return),nf(3,l)}catch(rt){Sn(l,l.return,rt)}try{Nu(5,l,l.return)}catch(rt){Sn(l,l.return,rt)}}break;case 1:Pi(d,l),Zi(l),y&512&&p!==null&&ll(p,p.return);break;case 5:if(Pi(d,l),Zi(l),y&512&&p!==null&&ll(p,p.return),l.flags&32){var w=l.stateNode;try{zt(w,"")}catch(rt){Sn(l,l.return,rt)}}if(y&4&&(w=l.stateNode,w!=null)){var S=l.memoizedProps,A=p!==null?p.memoizedProps:S,z=l.type,V=l.updateQueue;if(l.updateQueue=null,V!==null)try{z==="input"&&S.type==="radio"&&S.name!=null&&Ys(w,S),li(z,A);var Y=li(z,S);for(A=0;A<V.length;A+=2){var ge=V[A],xe=V[A+1];ge==="style"?Vi(w,xe):ge==="dangerouslySetInnerHTML"?Tt(w,xe):ge==="children"?zt(w,xe):E(w,ge,xe,Y)}switch(z){case"input":ho(w,S);break;case"textarea":Nr(w,S);break;case"select":var pe=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var We=S.value;We!=null?Mr(w,!!S.multiple,We,!1):pe!==!!S.multiple&&(S.defaultValue!=null?Mr(w,!!S.multiple,S.defaultValue,!0):Mr(w,!!S.multiple,S.multiple?[]:"",!1))}w[bu]=S}catch(rt){Sn(l,l.return,rt)}}break;case 6:if(Pi(d,l),Zi(l),y&4){if(l.stateNode===null)throw Error(n(162));w=l.stateNode,S=l.memoizedProps;try{w.nodeValue=S}catch(rt){Sn(l,l.return,rt)}}break;case 3:if(Pi(d,l),Zi(l),y&4&&p!==null&&p.memoizedState.isDehydrated)try{lu(d.containerInfo)}catch(rt){Sn(l,l.return,rt)}break;case 4:Pi(d,l),Zi(l);break;case 13:Pi(d,l),Zi(l),w=l.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(h0=ae())),y&4&&ik(l);break;case 22:if(ge=p!==null&&p.memoizedState!==null,l.mode&1?(lr=(Y=lr)||ge,Pi(d,l),lr=Y):Pi(d,l),Zi(l),y&8192){if(Y=l.memoizedState!==null,(l.stateNode.isHidden=Y)&&!ge&&(l.mode&1)!==0)for(Ke=l,ge=l.child;ge!==null;){for(xe=Ke=ge;Ke!==null;){switch(pe=Ke,We=pe.child,pe.tag){case 0:case 11:case 14:case 15:Nu(4,pe,pe.return);break;case 1:ll(pe,pe.return);var Qe=pe.stateNode;if(typeof Qe.componentWillUnmount=="function"){y=pe,p=pe.return;try{d=y,Qe.props=d.memoizedProps,Qe.state=d.memoizedState,Qe.componentWillUnmount()}catch(rt){Sn(y,p,rt)}}break;case 5:ll(pe,pe.return);break;case 22:if(pe.memoizedState!==null){lk(xe);continue}}We!==null?(We.return=pe,Ke=We):lk(xe)}ge=ge.sibling}e:for(ge=null,xe=l;;){if(xe.tag===5){if(ge===null){ge=xe;try{w=xe.stateNode,Y?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(z=xe.stateNode,V=xe.memoizedProps.style,A=V!=null&&V.hasOwnProperty("display")?V.display:null,z.style.display=Ir("display",A))}catch(rt){Sn(l,l.return,rt)}}}else if(xe.tag===6){if(ge===null)try{xe.stateNode.nodeValue=Y?"":xe.memoizedProps}catch(rt){Sn(l,l.return,rt)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===l)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===l)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===l)break e;ge===xe&&(ge=null),xe=xe.return}ge===xe&&(ge=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:Pi(d,l),Zi(l),y&4&&ik(l);break;case 21:break;default:Pi(d,l),Zi(l)}}function Zi(l){var d=l.flags;if(d&2){try{e:{for(var p=l.return;p!==null;){if(tk(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var w=y.stateNode;y.flags&32&&(zt(w,""),y.flags&=-33);var S=nk(l);c0(l,S,w);break;case 3:case 4:var A=y.stateNode.containerInfo,z=nk(l);u0(l,z,A);break;default:throw Error(n(161))}}catch(V){Sn(l,l.return,V)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function kN(l,d,p){Ke=l,sk(l)}function sk(l,d,p){for(var y=(l.mode&1)!==0;Ke!==null;){var w=Ke,S=w.child;if(w.tag===22&&y){var A=w.memoizedState!==null||tf;if(!A){var z=w.alternate,V=z!==null&&z.memoizedState!==null||lr;z=tf;var Y=lr;if(tf=A,(lr=V)&&!Y)for(Ke=w;Ke!==null;)A=Ke,V=A.child,A.tag===22&&A.memoizedState!==null?uk(w):V!==null?(V.return=A,Ke=V):uk(w);for(;S!==null;)Ke=S,sk(S),S=S.sibling;Ke=w,tf=z,lr=Y}ak(l)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,Ke=S):ak(l)}}function ak(l){for(;Ke!==null;){var d=Ke;if((d.flags&8772)!==0){var p=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:lr||nf(5,d);break;case 1:var y=d.stateNode;if(d.flags&4&&!lr)if(p===null)y.componentDidMount();else{var w=d.elementType===d.type?p.memoizedProps:Oi(d.type,p.memoizedProps);y.componentDidUpdate(w,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var S=d.updateQueue;S!==null&&lv(d,S,y);break;case 3:var A=d.updateQueue;if(A!==null){if(p=null,d.child!==null)switch(d.child.tag){case 5:p=d.child.stateNode;break;case 1:p=d.child.stateNode}lv(d,A,p)}break;case 5:var z=d.stateNode;if(p===null&&d.flags&4){p=z;var V=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&p.focus();break;case"img":V.src&&(p.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Y=d.alternate;if(Y!==null){var ge=Y.memoizedState;if(ge!==null){var xe=ge.dehydrated;xe!==null&&lu(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}lr||d.flags&512&&l0(d)}catch(pe){Sn(d,d.return,pe)}}if(d===l){Ke=null;break}if(p=d.sibling,p!==null){p.return=d.return,Ke=p;break}Ke=d.return}}function lk(l){for(;Ke!==null;){var d=Ke;if(d===l){Ke=null;break}var p=d.sibling;if(p!==null){p.return=d.return,Ke=p;break}Ke=d.return}}function uk(l){for(;Ke!==null;){var d=Ke;try{switch(d.tag){case 0:case 11:case 15:var p=d.return;try{nf(4,d)}catch(V){Sn(d,p,V)}break;case 1:var y=d.stateNode;if(typeof y.componentDidMount=="function"){var w=d.return;try{y.componentDidMount()}catch(V){Sn(d,w,V)}}var S=d.return;try{l0(d)}catch(V){Sn(d,S,V)}break;case 5:var A=d.return;try{l0(d)}catch(V){Sn(d,A,V)}}}catch(V){Sn(d,d.return,V)}if(d===l){Ke=null;break}var z=d.sibling;if(z!==null){z.return=d.return,Ke=z;break}Ke=d.return}}var wN=Math.ceil,rf=I.ReactCurrentDispatcher,d0=I.ReactCurrentOwner,hi=I.ReactCurrentBatchConfig,Ut=0,Hn=null,Nn=null,er=0,Yr=0,ul=Go(0),$n=0,Iu=null,sa=0,of=0,f0=0,Du=null,zr=null,h0=0,cl=1/0,Eo=null,sf=!1,p0=null,ns=null,af=!1,rs=null,lf=0,Ou=0,m0=null,uf=-1,cf=0;function xr(){return(Ut&6)!==0?ae():uf!==-1?uf:uf=ae()}function is(l){return(l.mode&1)===0?1:(Ut&2)!==0&&er!==0?er&-er:oN.transition!==null?(cf===0&&(cf=mr()),cf):(l=jt,l!==0||(l=window.event,l=l===void 0?16:db(l.type)),l)}function ji(l,d,p,y){if(50<Ou)throw Ou=0,m0=null,Error(n(185));gr(l,p,y),((Ut&2)===0||l!==Hn)&&(l===Hn&&((Ut&2)===0&&(of|=p),$n===4&&ss(l,er)),Lr(l,y),p===1&&Ut===0&&(d.mode&1)===0&&(cl=ae()+500,zd&&Qo()))}function Lr(l,d){var p=l.callbackNode;at(l,d);var y=Xt(l,l===Hn?er:0);if(y===0)p!==null&&fe(p),l.callbackNode=null,l.callbackPriority=0;else if(d=y&-y,l.callbackPriority!==d){if(p!=null&&fe(p),d===1)l.tag===0?iN(dk.bind(null,l)):Gb(dk.bind(null,l)),eN(function(){(Ut&6)===0&&Qo()}),p=null;else{switch(yd(y)){case 1:p=Be;break;case 4:p=ce;break;case 16:p=ye;break;case 536870912:p=H;break;default:p=ye}p=bk(p,ck.bind(null,l))}l.callbackPriority=d,l.callbackNode=p}}function ck(l,d){if(uf=-1,cf=0,(Ut&6)!==0)throw Error(n(327));var p=l.callbackNode;if(dl()&&l.callbackNode!==p)return null;var y=Xt(l,l===Hn?er:0);if(y===0)return null;if((y&30)!==0||(y&l.expiredLanes)!==0||d)d=df(l,y);else{d=y;var w=Ut;Ut|=2;var S=hk();(Hn!==l||er!==d)&&(Eo=null,cl=ae()+500,la(l,d));do try{EN();break}catch(z){fk(l,z)}while(!0);Om(),rf.current=S,Ut=w,Nn!==null?d=0:(Hn=null,er=0,d=$n)}if(d!==0){if(d===2&&(w=Zr(l),w!==0&&(y=w,d=g0(l,w))),d===1)throw p=Iu,la(l,0),ss(l,y),Lr(l,ae()),p;if(d===6)ss(l,y);else{if(w=l.current.alternate,(y&30)===0&&!CN(w)&&(d=df(l,y),d===2&&(S=Zr(l),S!==0&&(y=S,d=g0(l,S))),d===1))throw p=Iu,la(l,0),ss(l,y),Lr(l,ae()),p;switch(l.finishedWork=w,l.finishedLanes=y,d){case 0:case 1:throw Error(n(345));case 2:ua(l,zr,Eo);break;case 3:if(ss(l,y),(y&130023424)===y&&(d=h0+500-ae(),10<d)){if(Xt(l,0)!==0)break;if(w=l.suspendedLanes,(w&y)!==y){xr(),l.pingedLanes|=l.suspendedLanes&w;break}l.timeoutHandle=wm(ua.bind(null,l,zr,Eo),d);break}ua(l,zr,Eo);break;case 4:if(ss(l,y),(y&4194240)===y)break;for(d=l.eventTimes,w=-1;0<y;){var A=31-Ye(y);S=1<<A,A=d[A],A>w&&(w=A),y&=~S}if(y=w,y=ae()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*wN(y/1960))-y,10<y){l.timeoutHandle=wm(ua.bind(null,l,zr,Eo),y);break}ua(l,zr,Eo);break;case 5:ua(l,zr,Eo);break;default:throw Error(n(329))}}}return Lr(l,ae()),l.callbackNode===p?ck.bind(null,l):null}function g0(l,d){var p=Du;return l.current.memoizedState.isDehydrated&&(la(l,d).flags|=256),l=df(l,d),l!==2&&(d=zr,zr=p,d!==null&&y0(d)),l}function y0(l){zr===null?zr=l:zr.push.apply(zr,l)}function CN(l){for(var d=l;;){if(d.flags&16384){var p=d.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var w=p[y],S=w.getSnapshot;w=w.value;try{if(!Ii(S(),w))return!1}catch{return!1}}}if(p=d.child,d.subtreeFlags&16384&&p!==null)p.return=d,d=p;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function ss(l,d){for(d&=~f0,d&=~of,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var p=31-Ye(d),y=1<<p;l[p]=-1,d&=~y}}function dk(l){if((Ut&6)!==0)throw Error(n(327));dl();var d=Xt(l,0);if((d&1)===0)return Lr(l,ae()),null;var p=df(l,d);if(l.tag!==0&&p===2){var y=Zr(l);y!==0&&(d=y,p=g0(l,y))}if(p===1)throw p=Iu,la(l,0),ss(l,d),Lr(l,ae()),p;if(p===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,ua(l,zr,Eo),Lr(l,ae()),null}function x0(l,d){var p=Ut;Ut|=1;try{return l(d)}finally{Ut=p,Ut===0&&(cl=ae()+500,zd&&Qo())}}function aa(l){rs!==null&&rs.tag===0&&(Ut&6)===0&&dl();var d=Ut;Ut|=1;var p=hi.transition,y=jt;try{if(hi.transition=null,jt=1,l)return l()}finally{jt=y,hi.transition=p,Ut=d,(Ut&6)===0&&Qo()}}function b0(){Yr=ul.current,ln(ul)}function la(l,d){l.finishedWork=null,l.finishedLanes=0;var p=l.timeoutHandle;if(p!==-1&&(l.timeoutHandle=-1,XM(p)),Nn!==null)for(p=Nn.return;p!==null;){var y=p;switch(Am(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Pd();break;case 3:sl(),ln(Rr),ln(or),Bm();break;case 5:Fm(y);break;case 4:sl();break;case 13:ln(xn);break;case 19:ln(xn);break;case 10:Rm(y.type._context);break;case 22:case 23:b0()}p=p.return}if(Hn=l,Nn=l=as(l.current,null),er=Yr=d,$n=0,Iu=null,f0=of=sa=0,zr=Du=null,ra!==null){for(d=0;d<ra.length;d++)if(p=ra[d],y=p.interleaved,y!==null){p.interleaved=null;var w=y.next,S=p.pending;if(S!==null){var A=S.next;S.next=w,y.next=A}p.pending=y}ra=null}return l}function fk(l,d){do{var p=Nn;try{if(Om(),Zd.current=Yd,Jd){for(var y=bn.memoizedState;y!==null;){var w=y.queue;w!==null&&(w.pending=null),y=y.next}Jd=!1}if(oa=0,Vn=Fn=bn=null,Eu=!1,_u=0,d0.current=null,p===null||p.return===null){$n=1,Iu=d,Nn=null;break}e:{var S=l,A=p.return,z=p,V=d;if(d=er,z.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var Y=V,ge=z,xe=ge.tag;if((ge.mode&1)===0&&(xe===0||xe===11||xe===15)){var pe=ge.alternate;pe?(ge.updateQueue=pe.updateQueue,ge.memoizedState=pe.memoizedState,ge.lanes=pe.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var We=zv(A);if(We!==null){We.flags&=-257,Lv(We,A,z,S,d),We.mode&1&&jv(S,Y,d),d=We,V=Y;var Qe=d.updateQueue;if(Qe===null){var rt=new Set;rt.add(V),d.updateQueue=rt}else Qe.add(V);break e}else{if((d&1)===0){jv(S,Y,d),v0();break e}V=Error(n(426))}}else if(hn&&z.mode&1){var An=zv(A);if(An!==null){(An.flags&65536)===0&&(An.flags|=256),Lv(An,A,z,S,d),Im(al(V,z));break e}}S=V=al(V,z),$n!==4&&($n=2),Du===null?Du=[S]:Du.push(S),S=A;do{switch(S.tag){case 3:S.flags|=65536,d&=-d,S.lanes|=d;var J=Rv(S,V,d);av(S,J);break e;case 1:z=V;var q=S.type,K=S.stateNode;if((S.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(ns===null||!ns.has(K)))){S.flags|=65536,d&=-d,S.lanes|=d;var Te=Pv(S,z,d);av(S,Te);break e}}S=S.return}while(S!==null)}mk(p)}catch(it){d=it,Nn===p&&p!==null&&(Nn=p=p.return);continue}break}while(!0)}function hk(){var l=rf.current;return rf.current=Yd,l===null?Yd:l}function v0(){($n===0||$n===3||$n===2)&&($n=4),Hn===null||(sa&268435455)===0&&(of&268435455)===0||ss(Hn,er)}function df(l,d){var p=Ut;Ut|=2;var y=hk();(Hn!==l||er!==d)&&(Eo=null,la(l,d));do try{SN();break}catch(w){fk(l,w)}while(!0);if(Om(),Ut=p,rf.current=y,Nn!==null)throw Error(n(261));return Hn=null,er=0,$n}function SN(){for(;Nn!==null;)pk(Nn)}function EN(){for(;Nn!==null&&!G();)pk(Nn)}function pk(l){var d=xk(l.alternate,l,Yr);l.memoizedProps=l.pendingProps,d===null?mk(l):Nn=d,d0.current=null}function mk(l){var d=l;do{var p=d.alternate;if(l=d.return,(d.flags&32768)===0){if(p=yN(p,d,Yr),p!==null){Nn=p;return}}else{if(p=xN(p,d),p!==null){p.flags&=32767,Nn=p;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{$n=6,Nn=null;return}}if(d=d.sibling,d!==null){Nn=d;return}Nn=d=l}while(d!==null);$n===0&&($n=5)}function ua(l,d,p){var y=jt,w=hi.transition;try{hi.transition=null,jt=1,_N(l,d,p,y)}finally{hi.transition=w,jt=y}return null}function _N(l,d,p,y){do dl();while(rs!==null);if((Ut&6)!==0)throw Error(n(327));p=l.finishedWork;var w=l.finishedLanes;if(p===null)return null;if(l.finishedWork=null,l.finishedLanes=0,p===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var S=p.lanes|p.childLanes;if(Or(l,S),l===Hn&&(Nn=Hn=null,er=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||af||(af=!0,bk(ye,function(){return dl(),null})),S=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||S){S=hi.transition,hi.transition=null;var A=jt;jt=1;var z=Ut;Ut|=4,d0.current=null,vN(l,p),ok(p,l),qM(vm),kd=!!bm,vm=bm=null,l.current=p,kN(p),le(),Ut=z,jt=A,hi.transition=S}else l.current=p;if(af&&(af=!1,rs=l,lf=w),S=l.pendingLanes,S===0&&(ns=null),ze(p.stateNode),Lr(l,ae()),d!==null)for(y=l.onRecoverableError,p=0;p<d.length;p++)w=d[p],y(w.value,{componentStack:w.stack,digest:w.digest});if(sf)throw sf=!1,l=p0,p0=null,l;return(lf&1)!==0&&l.tag!==0&&dl(),S=l.pendingLanes,(S&1)!==0?l===m0?Ou++:(Ou=0,m0=l):Ou=0,Qo(),null}function dl(){if(rs!==null){var l=yd(lf),d=hi.transition,p=jt;try{if(hi.transition=null,jt=16>l?16:l,rs===null)var y=!1;else{if(l=rs,rs=null,lf=0,(Ut&6)!==0)throw Error(n(331));var w=Ut;for(Ut|=4,Ke=l.current;Ke!==null;){var S=Ke,A=S.child;if((Ke.flags&16)!==0){var z=S.deletions;if(z!==null){for(var V=0;V<z.length;V++){var Y=z[V];for(Ke=Y;Ke!==null;){var ge=Ke;switch(ge.tag){case 0:case 11:case 15:Nu(8,ge,S)}var xe=ge.child;if(xe!==null)xe.return=ge,Ke=xe;else for(;Ke!==null;){ge=Ke;var pe=ge.sibling,We=ge.return;if(ek(ge),ge===Y){Ke=null;break}if(pe!==null){pe.return=We,Ke=pe;break}Ke=We}}}var Qe=S.alternate;if(Qe!==null){var rt=Qe.child;if(rt!==null){Qe.child=null;do{var An=rt.sibling;rt.sibling=null,rt=An}while(rt!==null)}}Ke=S}}if((S.subtreeFlags&2064)!==0&&A!==null)A.return=S,Ke=A;else e:for(;Ke!==null;){if(S=Ke,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:Nu(9,S,S.return)}var J=S.sibling;if(J!==null){J.return=S.return,Ke=J;break e}Ke=S.return}}var q=l.current;for(Ke=q;Ke!==null;){A=Ke;var K=A.child;if((A.subtreeFlags&2064)!==0&&K!==null)K.return=A,Ke=K;else e:for(A=q;Ke!==null;){if(z=Ke,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:nf(9,z)}}catch(it){Sn(z,z.return,it)}if(z===A){Ke=null;break e}var Te=z.sibling;if(Te!==null){Te.return=z.return,Ke=Te;break e}Ke=z.return}}if(Ut=w,Qo(),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(ne,l)}catch{}y=!0}return y}finally{jt=p,hi.transition=d}}return!1}function gk(l,d,p){d=al(p,d),d=Rv(l,d,1),l=es(l,d,1),d=xr(),l!==null&&(gr(l,1,d),Lr(l,d))}function Sn(l,d,p){if(l.tag===3)gk(l,l,p);else for(;d!==null;){if(d.tag===3){gk(d,l,p);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ns===null||!ns.has(y))){l=al(p,l),l=Pv(d,l,1),d=es(d,l,1),l=xr(),d!==null&&(gr(d,1,l),Lr(d,l));break}}d=d.return}}function TN(l,d,p){var y=l.pingCache;y!==null&&y.delete(d),d=xr(),l.pingedLanes|=l.suspendedLanes&p,Hn===l&&(er&p)===p&&($n===4||$n===3&&(er&130023424)===er&&500>ae()-h0?la(l,0):f0|=p),Lr(l,d)}function yk(l,d){d===0&&((l.mode&1)===0?d=1:(d=St,St<<=1,(St&130023424)===0&&(St=4194304)));var p=xr();l=wo(l,d),l!==null&&(gr(l,d,p),Lr(l,p))}function AN(l){var d=l.memoizedState,p=0;d!==null&&(p=d.retryLane),yk(l,p)}function MN(l,d){var p=0;switch(l.tag){case 13:var y=l.stateNode,w=l.memoizedState;w!==null&&(p=w.retryLane);break;case 19:y=l.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(d),yk(l,p)}var xk;xk=function(l,d,p){if(l!==null)if(l.memoizedProps!==d.pendingProps||Rr.current)jr=!0;else{if((l.lanes&p)===0&&(d.flags&128)===0)return jr=!1,gN(l,d,p);jr=(l.flags&131072)!==0}else jr=!1,hn&&(d.flags&1048576)!==0&&Yb(d,Fd,d.index);switch(d.lanes=0,d.tag){case 2:var y=d.type;ef(l,d),l=d.pendingProps;var w=Xa(d,or.current);ol(d,p),w=Hm(null,d,y,l,w,p);var S=Wm();return d.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Pr(y)?(S=!0,jd(d)):S=!1,d.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,zm(d),w.updater=Qd,d.stateNode=w,w._reactInternals=d,Ym(d,y,l,p),d=t0(null,d,y,!0,S,p)):(d.tag=0,hn&&S&&Tm(d),yr(null,d,w,p),d=d.child),d;case 16:y=d.elementType;e:{switch(ef(l,d),l=d.pendingProps,w=y._init,y=w(y._payload),d.type=y,w=d.tag=IN(y),l=Oi(y,l),w){case 0:d=e0(null,d,y,l,p);break e;case 1:d=Hv(null,d,y,l,p);break e;case 11:d=Fv(null,d,y,l,p);break e;case 14:d=$v(null,d,y,Oi(y.type,l),p);break e}throw Error(n(306,y,""))}return d;case 0:return y=d.type,w=d.pendingProps,w=d.elementType===y?w:Oi(y,w),e0(l,d,y,w,p);case 1:return y=d.type,w=d.pendingProps,w=d.elementType===y?w:Oi(y,w),Hv(l,d,y,w,p);case 3:e:{if(Wv(d),l===null)throw Error(n(387));y=d.pendingProps,S=d.memoizedState,w=S.element,sv(l,d),Wd(d,y,null,p);var A=d.memoizedState;if(y=A.element,S.isDehydrated)if(S={element:y,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},d.updateQueue.baseState=S,d.memoizedState=S,d.flags&256){w=al(Error(n(423)),d),d=qv(l,d,y,p,w);break e}else if(y!==w){w=al(Error(n(424)),d),d=qv(l,d,y,p,w);break e}else for(Gr=Ko(d.stateNode.containerInfo.firstChild),Kr=d,hn=!0,Di=null,p=iv(d,null,y,p),d.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(nl(),y===w){d=So(l,d,p);break e}yr(l,d,y,p)}d=d.child}return d;case 5:return uv(d),l===null&&Nm(d),y=d.type,w=d.pendingProps,S=l!==null?l.memoizedProps:null,A=w.children,km(y,w)?A=null:S!==null&&km(y,S)&&(d.flags|=32),Vv(l,d),yr(l,d,A,p),d.child;case 6:return l===null&&Nm(d),null;case 13:return Zv(l,d,p);case 4:return Lm(d,d.stateNode.containerInfo),y=d.pendingProps,l===null?d.child=rl(d,null,y,p):yr(l,d,y,p),d.child;case 11:return y=d.type,w=d.pendingProps,w=d.elementType===y?w:Oi(y,w),Fv(l,d,y,w,p);case 7:return yr(l,d,d.pendingProps,p),d.child;case 8:return yr(l,d,d.pendingProps.children,p),d.child;case 12:return yr(l,d,d.pendingProps.children,p),d.child;case 10:e:{if(y=d.type._context,w=d.pendingProps,S=d.memoizedProps,A=w.value,en(Ud,y._currentValue),y._currentValue=A,S!==null)if(Ii(S.value,A)){if(S.children===w.children&&!Rr.current){d=So(l,d,p);break e}}else for(S=d.child,S!==null&&(S.return=d);S!==null;){var z=S.dependencies;if(z!==null){A=S.child;for(var V=z.firstContext;V!==null;){if(V.context===y){if(S.tag===1){V=Co(-1,p&-p),V.tag=2;var Y=S.updateQueue;if(Y!==null){Y=Y.shared;var ge=Y.pending;ge===null?V.next=V:(V.next=ge.next,ge.next=V),Y.pending=V}}S.lanes|=p,V=S.alternate,V!==null&&(V.lanes|=p),Pm(S.return,p,d),z.lanes|=p;break}V=V.next}}else if(S.tag===10)A=S.type===d.type?null:S.child;else if(S.tag===18){if(A=S.return,A===null)throw Error(n(341));A.lanes|=p,z=A.alternate,z!==null&&(z.lanes|=p),Pm(A,p,d),A=S.sibling}else A=S.child;if(A!==null)A.return=S;else for(A=S;A!==null;){if(A===d){A=null;break}if(S=A.sibling,S!==null){S.return=A.return,A=S;break}A=A.return}S=A}yr(l,d,w.children,p),d=d.child}return d;case 9:return w=d.type,y=d.pendingProps.children,ol(d,p),w=di(w),y=y(w),d.flags|=1,yr(l,d,y,p),d.child;case 14:return y=d.type,w=Oi(y,d.pendingProps),w=Oi(y.type,w),$v(l,d,y,w,p);case 15:return Bv(l,d,d.type,d.pendingProps,p);case 17:return y=d.type,w=d.pendingProps,w=d.elementType===y?w:Oi(y,w),ef(l,d),d.tag=1,Pr(y)?(l=!0,jd(d)):l=!1,ol(d,p),Dv(d,y,w),Ym(d,y,w,p),t0(null,d,y,!0,l,p);case 19:return Kv(l,d,p);case 22:return Uv(l,d,p)}throw Error(n(156,d.tag))};function bk(l,d){return Oe(l,d)}function NN(l,d,p,y){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pi(l,d,p,y){return new NN(l,d,p,y)}function k0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function IN(l){if(typeof l=="function")return k0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===X)return 11;if(l===$)return 14}return 2}function as(l,d){var p=l.alternate;return p===null?(p=pi(l.tag,d,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=d,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&14680064,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,d=l.dependencies,p.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p}function ff(l,d,p,y,w,S){var A=2;if(y=l,typeof l=="function")k0(l)&&(A=1);else if(typeof l=="string")A=5;else e:switch(l){case j:return ca(p.children,w,S,d);case O:A=8,w|=8;break;case R:return l=pi(12,p,d,w|2),l.elementType=R,l.lanes=S,l;case Se:return l=pi(13,p,d,w),l.elementType=Se,l.lanes=S,l;case ue:return l=pi(19,p,d,w),l.elementType=ue,l.lanes=S,l;case he:return hf(p,w,S,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case F:A=10;break e;case ee:A=9;break e;case X:A=11;break e;case $:A=14;break e;case Q:A=16,y=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=pi(A,p,d,w),d.elementType=l,d.type=y,d.lanes=S,d}function ca(l,d,p,y){return l=pi(7,l,y,d),l.lanes=p,l}function hf(l,d,p,y){return l=pi(22,l,y,d),l.elementType=he,l.lanes=p,l.stateNode={isHidden:!1},l}function w0(l,d,p){return l=pi(6,l,null,d),l.lanes=p,l}function C0(l,d,p){return d=pi(4,l.children!==null?l.children:[],l.key,d),d.lanes=p,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function DN(l,d,p,y,w){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dr(0),this.expirationTimes=Dr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dr(0),this.identifierPrefix=y,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function S0(l,d,p,y,w,S,A,z,V){return l=new DN(l,d,p,z,V),d===1?(d=1,S===!0&&(d|=8)):d=0,S=pi(3,null,null,d),l.current=S,S.stateNode=l,S.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},zm(S),l}function ON(l,d,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:l,containerInfo:d,implementation:p}}function vk(l){if(!l)return Yo;l=l._reactInternals;e:{if(wt(l)!==l||l.tag!==1)throw Error(n(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(Pr(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(l.tag===1){var p=l.type;if(Pr(p))return Jb(l,p,d)}return d}function kk(l,d,p,y,w,S,A,z,V){return l=S0(p,y,!0,l,w,S,A,z,V),l.context=vk(null),p=l.current,y=xr(),w=is(p),S=Co(y,w),S.callback=d??null,es(p,S,w),l.current.lanes=w,gr(l,w,y),Lr(l,y),l}function pf(l,d,p,y){var w=d.current,S=xr(),A=is(w);return p=vk(p),d.context===null?d.context=p:d.pendingContext=p,d=Co(S,A),d.payload={element:l},y=y===void 0?null:y,y!==null&&(d.callback=y),l=es(w,d,A),l!==null&&(ji(l,w,A,S),Hd(l,w,A)),A}function mf(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function wk(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p<d?p:d}}function E0(l,d){wk(l,d),(l=l.alternate)&&wk(l,d)}function RN(){return null}var Ck=typeof reportError=="function"?reportError:function(l){console.error(l)};function _0(l){this._internalRoot=l}gf.prototype.render=_0.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(n(409));pf(l,d,null,null)},gf.prototype.unmount=_0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;aa(function(){pf(null,l,null,null)}),d[xo]=null}};function gf(l){this._internalRoot=l}gf.prototype.unstable_scheduleHydration=function(l){if(l){var d=sb();l={blockedOn:null,target:l,priority:d};for(var p=0;p<qo.length&&d!==0&&d<qo[p].priority;p++);qo.splice(p,0,l),p===0&&ub(l)}};function T0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function yf(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function Sk(){}function PN(l,d,p,y,w){if(w){if(typeof y=="function"){var S=y;y=function(){var Y=mf(A);S.call(Y)}}var A=kk(d,y,l,0,null,!1,!1,"",Sk);return l._reactRootContainer=A,l[xo]=A.current,yu(l.nodeType===8?l.parentNode:l),aa(),A}for(;w=l.lastChild;)l.removeChild(w);if(typeof y=="function"){var z=y;y=function(){var Y=mf(V);z.call(Y)}}var V=S0(l,0,!1,null,null,!1,!1,"",Sk);return l._reactRootContainer=V,l[xo]=V.current,yu(l.nodeType===8?l.parentNode:l),aa(function(){pf(d,V,p,y)}),V}function xf(l,d,p,y,w){var S=p._reactRootContainer;if(S){var A=S;if(typeof w=="function"){var z=w;w=function(){var V=mf(A);z.call(V)}}pf(d,A,l,w)}else A=PN(p,d,l,w,y);return mf(A)}xd=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var p=Mn(d.pendingLanes);p!==0&&(yo(d,p|1),Lr(d,ae()),(Ut&6)===0&&(cl=ae()+500,Qo()))}break;case 13:aa(function(){var y=wo(l,1);if(y!==null){var w=xr();ji(y,l,1,w)}}),E0(l,1)}},Qp=function(l){if(l.tag===13){var d=wo(l,134217728);if(d!==null){var p=xr();ji(d,l,134217728,p)}E0(l,134217728)}},ob=function(l){if(l.tag===13){var d=is(l),p=wo(l,d);if(p!==null){var y=xr();ji(p,l,d,y)}E0(l,d)}},sb=function(){return jt},ab=function(l,d){var p=jt;try{return jt=l,d()}finally{jt=p}},Ti=function(l,d,p){switch(d){case"input":if(ho(l,p),d=p.name,p.type==="radio"&&d!=null){for(p=l;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<p.length;d++){var y=p[d];if(y!==l&&y.form===l.form){var w=Rd(y);if(!w)throw Error(n(90));on(y),ho(y,w)}}}break;case"textarea":Nr(l,p);break;case"select":d=p.value,d!=null&&Mr(l,!!p.multiple,d,!1)}},gd=x0,L=aa;var jN={usingClientEntryPoint:!1,Events:[vu,Ya,Rd,pd,md,x0]},Ru={findFiberByHostInstance:Xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zN={bundleType:Ru.bundleType,version:Ru.version,rendererPackageName:Ru.rendererPackageName,rendererConfig:Ru.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Je(l),l===null?null:l.stateNode},findFiberByHostInstance:Ru.findFiberByHostInstance||RN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bf.isDisabled&&bf.supportsFiber)try{ne=bf.inject(zN),Re=bf}catch{}}return Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jN,Fr.createPortal=function(l,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T0(d))throw Error(n(200));return ON(l,d,null,p)},Fr.createRoot=function(l,d){if(!T0(l))throw Error(n(299));var p=!1,y="",w=Ck;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(y=d.identifierPrefix),d.onRecoverableError!==void 0&&(w=d.onRecoverableError)),d=S0(l,1,!1,null,null,p,!1,y,w),l[xo]=d.current,yu(l.nodeType===8?l.parentNode:l),new _0(d)},Fr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Je(d),l=l===null?null:l.stateNode,l},Fr.flushSync=function(l){return aa(l)},Fr.hydrate=function(l,d,p){if(!yf(d))throw Error(n(200));return xf(null,l,d,!0,p)},Fr.hydrateRoot=function(l,d,p){if(!T0(l))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,w=!1,S="",A=Ck;if(p!=null&&(p.unstable_strictMode===!0&&(w=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onRecoverableError!==void 0&&(A=p.onRecoverableError)),d=kk(d,null,l,1,p??null,w,!1,S,A),l[xo]=d.current,yu(l),y)for(l=0;l<y.length;l++)p=y[l],w=p._getVersion,w=w(p._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[p,w]:d.mutableSourceEagerHydrationData.push(p,w);return new gf(d)},Fr.render=function(l,d,p){if(!yf(d))throw Error(n(200));return xf(null,l,d,!1,p)},Fr.unmountComponentAtNode=function(l){if(!yf(l))throw Error(n(40));return l._reactRootContainer?(aa(function(){xf(null,null,l,!1,function(){l._reactRootContainer=null,l[xo]=null})}),!0):!1},Fr.unstable_batchedUpdates=x0,Fr.unstable_renderSubtreeIntoContainer=function(l,d,p,y){if(!yf(p))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return xf(l,d,p,!1,y)},Fr.version="18.3.1-next-f1338f8080-20240426",Fr}var Dk;function sE(){if(Dk)return N0.exports;Dk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),N0.exports=ZN(),N0.exports}var Ok;function JN(){if(Ok)return vf;Ok=1;var e=sE();return vf.createRoot=e.createRoot,vf.hydrateRoot=e.hydrateRoot,vf}var KN=JN();const GN=ja(KN);var aE="vercel.ai.error",YN=Symbol.for(aE),Rk,Pk,ro=class lE extends(Pk=Error,Rk=YN,Pk){constructor({name:t,message:n,cause:r}){super(n),this[Rk]=!0,this.name=t,this.cause=r}static isInstance(t){return lE.hasMarker(t,aE)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};function uE(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var cE="AI_InvalidArgumentError",dE=`vercel.ai.error.${cE}`,QN=Symbol.for(dE),jk,zk,XN=class extends(zk=ro,jk=QN,zk){constructor({message:e,cause:t,argument:n}){super({name:cE,message:e,cause:t}),this[jk]=!0,this.argument=n}static isInstance(e){return ro.hasMarker(e,dE)}},fE="AI_JSONParseError",hE=`vercel.ai.error.${fE}`,eI=Symbol.for(hE),Lk,Fk,$k=class extends(Fk=ro,Lk=eI,Fk){constructor({text:e,cause:t}){super({name:fE,message:`JSON parsing failed: Text: ${e}.
41
- Error message: ${uE(t)}`,cause:t}),this[Lk]=!0,this.text=e}static isInstance(e){return ro.hasMarker(e,hE)}},pE="AI_TypeValidationError",mE=`vercel.ai.error.${pE}`,tI=Symbol.for(mE),Bk,Uk,Ol=class n1 extends(Uk=ro,Bk=tI,Uk){constructor({value:t,cause:n,context:r}){let i="Type validation failed";if(r!=null&&r.field&&(i+=` for ${r.field}`),r!=null&&r.entityName||r!=null&&r.entityId){i+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),i+=o.join(", "),i+=")"}super({name:pE,message:`${i}: Value: ${JSON.stringify(t)}.
42
- Error message: ${uE(n)}`,cause:n}),this[Bk]=!0,this.value=t,this.context=r}static isInstance(t){return ro.hasMarker(t,mE)}static wrap({value:t,cause:n,context:r}){var i,o,s;return n1.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===(r==null?void 0:r.field)&&((o=n.context)==null?void 0:o.entityName)===(r==null?void 0:r.entityName)&&((s=n.context)==null?void 0:s.entityId)===(r==null?void 0:r.entityId)?n:new n1({value:t,cause:n,context:r})}};function ie(e,t,n){function r(a,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=u}const i=(n==null?void 0:n.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var u;const c=n!=null&&n.Parent?new o:this;r(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const f of c._zod.deferred)f();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var u,c;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(c=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Cc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const gE={};function js(e){return gE}function yE(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function nI(e,t){return typeof t=="bigint"?t.toString():t}function xy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function by(e){return e==null}function vy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function rI(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}function Wt(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function kp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ju(e){return JSON.stringify(e)}const xE=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function oh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const iI=xy(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function sh(e){if(oh(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(oh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const oI=new Set(["string","number","symbol"]);function Qc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function za(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function st(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function sI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const aI={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function lI(e,t){const n={},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return za(e,{...e._zod.def,shape:n,checks:[]})}function uI(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return za(e,{...e._zod.def,shape:n,checks:[]})}function cI(e,t){if(!sh(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return kp(this,"shape",r),r},checks:[]};return za(e,n)}function dI(e,t){return za(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return kp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function fI(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=e?new e({type:"optional",innerType:r[o]}):r[o])}else for(const o in r)i[o]=e?new e({type:"optional",innerType:r[o]}):r[o];return za(t,{...t._zod.def,shape:i,checks:[]})}function hI(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:r[o]}))}else for(const o in r)i[o]=new e({type:"nonoptional",innerType:r[o]});return za(t,{...t._zod.def,shape:i,checks:[]})}function sc(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function ya(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function kf(e){return typeof e=="string"?e:e==null?void 0:e.message}function zs(e,t,n){var i,o,s,a,u,c;const r={...e,path:e.path??[]};if(!e.message){const f=kf((s=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??kf((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??kf((u=n.customError)==null?void 0:u.call(n,e))??kf((c=n.localeError)==null?void 0:c.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function ky(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sc(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const bE=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,nI,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vE=ie("$ZodError",bE),kE=ie("$ZodError",bE,{Parent:Error});function pI(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function mI(e,t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(e),r}const gI=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Cc;if(s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(u=>zs(u,o,js())));throw xE(a,i==null?void 0:i.callee),a}return s.value},yI=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(u=>zs(u,o,js())));throw xE(a,i==null?void 0:i.callee),a}return s.value},wE=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Cc;return o.issues.length?{success:!1,error:new(e??vE)(o.issues.map(s=>zs(s,i,js())))}:{success:!0,data:o.value}},xI=wE(kE),CE=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>zs(s,i,js())))}:{success:!0,data:o.value}},bI=CE(kE),vI=/^[cC][^\s-]{8,}$/,kI=/^[0-9a-z]+$/,wI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,CI=/^[0-9a-vA-V]{20}$/,SI=/^[A-Za-z0-9]{27}$/,EI=/^[a-zA-Z0-9_-]{21}$/,_I=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,TI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,AI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,MI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function NI(){return new RegExp(MI,"u")}const II=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,DI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,OI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,RI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,PI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,SE=/^[A-Za-z0-9_-]*$/,jI=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,zI=/^\+(?:[0-9]){6,14}[0-9]$/,EE="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",LI=new RegExp(`^${EE}$`);function _E(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function FI(e){return new RegExp(`^${_E(e)}$`)}function $I(e){const t=_E({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${EE}T(?:${r})$`)}const BI=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},UI=/^\d+$/,VI=/^-?\d+(?:\.\d+)?/i,HI=/true|false/i,WI=/null/i,qI=/^[^A-Z]*$/,ZI=/^[^a-z]*$/,Wr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),TE={number:"number",bigint:"bigint",object:"date"},AE=ie("$ZodCheckLessThan",(e,t)=>{Wr.init(e,t);const n=TE[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ME=ie("$ZodCheckGreaterThan",(e,t)=>{Wr.init(e,t);const n=TE[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),JI=ie("$ZodCheckMultipleOf",(e,t)=>{Wr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):rI(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),KI=ie("$ZodCheckNumberFormat",(e,t)=>{var s;Wr.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[i,o]=aI[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=i,u.maximum=o,n&&(u.pattern=UI)}),e._zod.check=a=>{const u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>o&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inst:e})}}),GI=ie("$ZodCheckMaxLength",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!by(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const s=ky(i);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),YI=ie("$ZodCheckMinLength",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!by(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const s=ky(i);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),QI=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!by(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,o=i.length;if(o===t.length)return;const s=ky(i),a=o>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),wp=ie("$ZodCheckStringFormat",(e,t)=>{var n,r;Wr.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),XI=ie("$ZodCheckRegex",(e,t)=>{wp.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),eD=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qI),wp.init(e,t)}),tD=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ZI),wp.init(e,t)}),nD=ie("$ZodCheckIncludes",(e,t)=>{Wr.init(e,t);const n=Qc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),rD=ie("$ZodCheckStartsWith",(e,t)=>{Wr.init(e,t);const n=new RegExp(`^${Qc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),iD=ie("$ZodCheckEndsWith",(e,t)=>{Wr.init(e,t);const n=new RegExp(`.*${Qc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),oD=ie("$ZodCheckOverwrite",(e,t)=>{Wr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class sD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
43
- `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,i.join(`
44
- `))}}const aD={major:4,minor:0,patch:0},rn=ie("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=aD;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,u)=>{let c=sc(s),f;for(const h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(c)continue;const m=s.issues.length,g=h._zod.check(s);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Cc;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,s.issues.length!==m&&(c||(c=sc(s,m)))});else{if(s.issues.length===m)continue;c||(c=sc(s,m))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new Cc;return u.then(c=>o(c,r,a))}return o(u,r,a)}}e["~standard"]={validate:o=>{var s;try{const a=xI(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return bI(e,o).then(u=>{var c;return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}}),wy=ie("$ZodString",(e,t)=>{var n;rn.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??BI(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pn=ie("$ZodStringFormat",(e,t)=>{wp.init(e,t),wy.init(e,t)}),lD=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=TI),pn.init(e,t)}),uD=ie("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Vk(r))}else t.pattern??(t.pattern=Vk());pn.init(e,t)}),cD=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=AI),pn.init(e,t)}),dD=ie("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const r=n.value,i=new URL(r),o=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:jI.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),fD=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=NI()),pn.init(e,t)}),hD=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=EI),pn.init(e,t)}),pD=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vI),pn.init(e,t)}),mD=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kI),pn.init(e,t)}),gD=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wI),pn.init(e,t)}),yD=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=CI),pn.init(e,t)}),xD=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=SI),pn.init(e,t)}),bD=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$I(t)),pn.init(e,t)}),vD=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=LI),pn.init(e,t)}),kD=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=FI(t)),pn.init(e,t)}),wD=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_I),pn.init(e,t)}),CD=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=II),pn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),SD=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=DI),pn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ED=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=OI),pn.init(e,t)}),_D=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=RI),pn.init(e,t),e._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function NE(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const TD=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=PI),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{NE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function AD(e){if(!SE.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return NE(n)}const MD=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=SE),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{AD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ND=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=zI),pn.init(e,t)});function ID(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const DD=ie("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{ID(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),IE=ie("$ZodNumber",(e,t)=>{rn.init(e,t),e._zod.pattern=e._zod.bag.pattern??VI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),OD=ie("$ZodNumber",(e,t)=>{KI.init(e,t),IE.init(e,t)}),RD=ie("$ZodBoolean",(e,t)=>{rn.init(e,t),e._zod.pattern=HI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),PD=ie("$ZodNull",(e,t)=>{rn.init(e,t),e._zod.pattern=WI,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),jD=ie("$ZodUnknown",(e,t)=>{rn.init(e,t),e._zod.parse=n=>n}),zD=ie("$ZodNever",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Hk(e,t,n){e.issues.length&&t.issues.push(...ya(n,e.issues)),t.value[n]=e.value}const LD=ie("$ZodArray",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let s=0;s<i.length;s++){const a=i[s],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?o.push(u.then(c=>Hk(c,n,s))):Hk(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function wf(e,t,n){e.issues.length&&t.issues.push(...ya(n,e.issues)),t.value[n]=e.value}function Wk(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...ya(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const FD=ie("$ZodObject",(e,t)=>{rn.init(e,t);const n=xy(()=>{const h=Object.keys(t.shape);for(const g of h)if(!(t.shape[g]instanceof rn))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);const m=sI(t.shape);return{shape:t.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});Wt(e._zod,"propValues",()=>{const h=t.shape,m={};for(const g in h){const x=h[g]._zod;if(x.values){m[g]??(m[g]=new Set);for(const b of x.values)m[g].add(b)}}return m});const r=h=>{const m=new sD(["shape","payload","ctx"]),g=n.value,x=_=>{const E=ju(_);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};m.write("const input = payload.value;");const b=Object.create(null);let k=0;for(const _ of g.keys)b[_]=`key_${k++}`;m.write("const newResult = {}");for(const _ of g.keys)if(g.optionalKeys.has(_)){const E=b[_];m.write(`const ${E} = ${x(_)};`);const I=ju(_);m.write(`
45
- if (${E}.issues.length) {
46
- if (input[${I}] === undefined) {
47
- if (${I} in input) {
48
- newResult[${I}] = undefined;
49
- }
50
- } else {
51
- payload.issues = payload.issues.concat(
52
- ${E}.issues.map((iss) => ({
53
- ...iss,
54
- path: iss.path ? [${I}, ...iss.path] : [${I}],
55
- }))
56
- );
57
- }
58
- } else if (${E}.value === undefined) {
59
- if (${I} in input) newResult[${I}] = undefined;
60
- } else {
61
- newResult[${I}] = ${E}.value;
62
- }
63
- `)}else{const E=b[_];m.write(`const ${E} = ${x(_)};`),m.write(`
64
- if (${E}.issues.length) payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
65
- ...iss,
66
- path: iss.path ? [${ju(_)}, ...iss.path] : [${ju(_)}]
67
- })));`),m.write(`newResult[${ju(_)}] = ${E}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const C=m.compile();return(_,E)=>C(h,_,E)};let i;const o=oh,s=!gE.jitless,u=s&&iI.value,c=t.catchall;let f;e._zod.parse=(h,m)=>{f??(f=n.value);const g=h.value;if(!o(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h;const x=[];if(s&&u&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)i||(i=r(t.shape)),h=i(h,m);else{h.value={};const E=f.shape;for(const I of f.keys){const N=E[I],M=N._zod.run({value:g[I],issues:[]},m),j=N._zod.optin==="optional"&&N._zod.optout==="optional";M instanceof Promise?x.push(M.then(O=>j?Wk(O,h,I,g):wf(O,h,I))):j?Wk(M,h,I,g):wf(M,h,I)}}if(!c)return x.length?Promise.all(x).then(()=>h):h;const b=[],k=f.keySet,C=c._zod,_=C.def.type;for(const E of Object.keys(g)){if(k.has(E))continue;if(_==="never"){b.push(E);continue}const I=C.run({value:g[E],issues:[]},m);I instanceof Promise?x.push(I.then(N=>wf(N,h,E))):wf(I,h,E)}return b.length&&h.issues.push({code:"unrecognized_keys",keys:b,input:g,inst:e}),x.length?Promise.all(x).then(()=>h):h}});function qk(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>zs(o,r,js())))}),t}const DE=ie("$ZodUnion",(e,t)=>{rn.init(e,t),Wt(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Wt(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Wt(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Wt(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>vy(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let i=!1;const o=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)o.push(a),i=!0;else{if(a.issues.length===0)return a;o.push(a)}}return i?Promise.all(o).then(s=>qk(s,n,e,r)):qk(o,n,e,r)}}),$D=ie("$ZodDiscriminatedUnion",(e,t)=>{DE.init(e,t);const n=e._zod.parse;Wt(e._zod,"propValues",()=>{const i={};for(const o of t.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(const c of u)i[a].add(c)}}return i});const r=xy(()=>{const i=t.options,o=new Map;for(const s of i){const a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(i,o)=>{const s=i.value;if(!oh(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;const a=r.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),i)}}),BD=ie("$ZodIntersection",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},r),s=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,c])=>Zk(n,u,c)):Zk(n,o,s)}});function r1(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sh(e)&&sh(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of r){const s=r1(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t[r],s=r1(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zk(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),sc(e))return e;const r=r1(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const UD=ie("$ZodRecord",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!sh(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:i[u],issues:[]},r);c instanceof Promise?o.push(c.then(f=>{f.issues.length&&n.issues.push(...ya(u,f.issues)),n.value[u]=f.value})):(c.issues.length&&n.issues.push(...ya(u,c.issues)),n.value[u]=c.value)}let a;for(const u in i)s.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(i)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(c=>zs(c,r,js())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:i[s],issues:[]},r);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&n.issues.push(...ya(s,c.issues)),n.value[a.value]=c.value})):(u.issues.length&&n.issues.push(...ya(s,u.issues)),n.value[a.value]=u.value)}}return o.length?Promise.all(o).then(()=>n):n}}),VD=ie("$ZodEnum",(e,t)=>{rn.init(e,t);const n=yE(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>oI.has(typeof r)).map(r=>typeof r=="string"?Qc(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:e}),r}}),HD=ie("$ZodLiteral",(e,t)=>{rn.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Qc(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),WD=ie("$ZodTransform",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new Cc;return n.value=i,n}}),qD=ie("$ZodOptional",(e,t)=>{rn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vy(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),ZD=ie("$ZodNullable",(e,t)=>{rn.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vy(n.source)}|null)$`):void 0}),Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),JD=ie("$ZodDefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Jk(o,t)):Jk(i,t)}});function Jk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const KD=ie("$ZodPrefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),GD=ie("$ZodNonOptional",(e,t)=>{rn.init(e,t),Wt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Kk(o,e)):Kk(i,e)}});function Kk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const YD=ie("$ZodCatch",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>zs(s,r,js()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>zs(o,r,js()))},input:n.value}),n.issues=[]),n)}}),QD=ie("$ZodPipe",(e,t)=>{rn.init(e,t),Wt(e._zod,"values",()=>t.in._zod.values),Wt(e._zod,"optin",()=>t.in._zod.optin),Wt(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Gk(o,t,r)):Gk(i,t,r)}});function Gk(e,t,n){return sc(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const XD=ie("$ZodReadonly",(e,t)=>{rn.init(e,t),Wt(e._zod,"propValues",()=>t.innerType._zod.propValues),Wt(e._zod,"values",()=>t.innerType._zod.values),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(Yk):Yk(i)}});function Yk(e){return e.value=Object.freeze(e.value),e}const e8=ie("$ZodLazy",(e,t)=>{rn.init(e,t),Wt(e._zod,"innerType",()=>t.getter()),Wt(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Wt(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Wt(e._zod,"optin",()=>e._zod.innerType._zod.optin),Wt(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),t8=ie("$ZodCustom",(e,t)=>{Wr.init(e,t),rn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>Qk(o,n,r,e));Qk(i,n,r,e)}});function Qk(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Sc(i))}}class OE{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function n8(){return new OE}const Zu=n8();function r8(e,t){return new e({type:"string",...st(t)})}function i8(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...st(t)})}function Xk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...st(t)})}function o8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...st(t)})}function s8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...st(t)})}function a8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...st(t)})}function l8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...st(t)})}function u8(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...st(t)})}function c8(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...st(t)})}function d8(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...st(t)})}function f8(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...st(t)})}function h8(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...st(t)})}function p8(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...st(t)})}function m8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...st(t)})}function g8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...st(t)})}function y8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...st(t)})}function x8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...st(t)})}function b8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...st(t)})}function v8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...st(t)})}function k8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...st(t)})}function w8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...st(t)})}function C8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...st(t)})}function S8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...st(t)})}function E8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...st(t)})}function _8(e,t){return new e({type:"string",format:"date",check:"string_format",...st(t)})}function T8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...st(t)})}function A8(e,t){return new e({type:"string",format:"duration",check:"string_format",...st(t)})}function M8(e,t){return new e({type:"number",checks:[],...st(t)})}function N8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...st(t)})}function I8(e,t){return new e({type:"boolean",...st(t)})}function D8(e,t){return new e({type:"null",...st(t)})}function O8(e){return new e({type:"unknown"})}function R8(e,t){return new e({type:"never",...st(t)})}function ew(e,t){return new AE({check:"less_than",...st(t),value:e,inclusive:!1})}function O0(e,t){return new AE({check:"less_than",...st(t),value:e,inclusive:!0})}function tw(e,t){return new ME({check:"greater_than",...st(t),value:e,inclusive:!1})}function R0(e,t){return new ME({check:"greater_than",...st(t),value:e,inclusive:!0})}function nw(e,t){return new JI({check:"multiple_of",...st(t),value:e})}function RE(e,t){return new GI({check:"max_length",...st(t),maximum:e})}function ah(e,t){return new YI({check:"min_length",...st(t),minimum:e})}function PE(e,t){return new QI({check:"length_equals",...st(t),length:e})}function P8(e,t){return new XI({check:"string_format",format:"regex",...st(t),pattern:e})}function j8(e){return new eD({check:"string_format",format:"lowercase",...st(e)})}function z8(e){return new tD({check:"string_format",format:"uppercase",...st(e)})}function L8(e,t){return new nD({check:"string_format",format:"includes",...st(t),includes:e})}function F8(e,t){return new rD({check:"string_format",format:"starts_with",...st(t),prefix:e})}function $8(e,t){return new iD({check:"string_format",format:"ends_with",...st(t),suffix:e})}function Xc(e){return new oD({check:"overwrite",tx:e})}function B8(e){return Xc(t=>t.normalize(e))}function U8(){return Xc(e=>e.trim())}function V8(){return Xc(e=>e.toLowerCase())}function H8(){return Xc(e=>e.toUpperCase())}function W8(e,t,n){return new e({type:"array",element:t,...st(n)})}function q8(e,t,n){const r=st(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Z8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...st(n)})}class rw{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??Zu,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var h,m,g;var r;const i=t._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,a);const u=(m=(h=t._zod).toJSONSchema)==null?void 0:m.call(h);if(u)a.schema=u;else{const x={...n,schemaPath:[...n.schemaPath,t],path:n.path},b=t._zod.parent;if(b)a.ref=b,this.process(b,x),this.seen.get(b).isParent=!0;else{const k=a.schema;switch(i.type){case"string":{const C=k;C.type="string";const{minimum:_,maximum:E,format:I,patterns:N,contentEncoding:M}=t._zod.bag;if(typeof _=="number"&&(C.minLength=_),typeof E=="number"&&(C.maxLength=E),I&&(C.format=o[I]??I,C.format===""&&delete C.format),M&&(C.contentEncoding=M),N&&N.size>0){const j=[...N];j.length===1?C.pattern=j[0].source:j.length>1&&(a.schema.allOf=[...j.map(O=>({...this.target==="draft-7"?{type:"string"}:{},pattern:O.source}))])}break}case"number":{const C=k,{minimum:_,maximum:E,format:I,multipleOf:N,exclusiveMaximum:M,exclusiveMinimum:j}=t._zod.bag;typeof I=="string"&&I.includes("int")?C.type="integer":C.type="number",typeof j=="number"&&(C.exclusiveMinimum=j),typeof _=="number"&&(C.minimum=_,typeof j=="number"&&(j>=_?delete C.minimum:delete C.exclusiveMinimum)),typeof M=="number"&&(C.exclusiveMaximum=M),typeof E=="number"&&(C.maximum=E,typeof M=="number"&&(M<=E?delete C.maximum:delete C.exclusiveMaximum)),typeof N=="number"&&(C.multipleOf=N);break}case"boolean":{const C=k;C.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{k.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{k.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const C=k,{minimum:_,maximum:E}=t._zod.bag;typeof _=="number"&&(C.minItems=_),typeof E=="number"&&(C.maxItems=E),C.type="array",C.items=this.process(i.element,{...x,path:[...x.path,"items"]});break}case"object":{const C=k;C.type="object",C.properties={};const _=i.shape;for(const N in _)C.properties[N]=this.process(_[N],{...x,path:[...x.path,"properties",N]});const E=new Set(Object.keys(_)),I=new Set([...E].filter(N=>{const M=i.shape[N]._zod;return this.io==="input"?M.optin===void 0:M.optout===void 0}));I.size>0&&(C.required=Array.from(I)),((g=i.catchall)==null?void 0:g._zod.def.type)==="never"?C.additionalProperties=!1:i.catchall?i.catchall&&(C.additionalProperties=this.process(i.catchall,{...x,path:[...x.path,"additionalProperties"]})):this.io==="output"&&(C.additionalProperties=!1);break}case"union":{const C=k;C.anyOf=i.options.map((_,E)=>this.process(_,{...x,path:[...x.path,"anyOf",E]}));break}case"intersection":{const C=k,_=this.process(i.left,{...x,path:[...x.path,"allOf",0]}),E=this.process(i.right,{...x,path:[...x.path,"allOf",1]}),I=M=>"allOf"in M&&Object.keys(M).length===1,N=[...I(_)?_.allOf:[_],...I(E)?E.allOf:[E]];C.allOf=N;break}case"tuple":{const C=k;C.type="array";const _=i.items.map((N,M)=>this.process(N,{...x,path:[...x.path,"prefixItems",M]}));if(this.target==="draft-2020-12"?C.prefixItems=_:C.items=_,i.rest){const N=this.process(i.rest,{...x,path:[...x.path,"items"]});this.target==="draft-2020-12"?C.items=N:C.additionalItems=N}i.rest&&(C.items=this.process(i.rest,{...x,path:[...x.path,"items"]}));const{minimum:E,maximum:I}=t._zod.bag;typeof E=="number"&&(C.minItems=E),typeof I=="number"&&(C.maxItems=I);break}case"record":{const C=k;C.type="object",C.propertyNames=this.process(i.keyType,{...x,path:[...x.path,"propertyNames"]}),C.additionalProperties=this.process(i.valueType,{...x,path:[...x.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const C=k,_=yE(i.entries);_.every(E=>typeof E=="number")&&(C.type="number"),_.every(E=>typeof E=="string")&&(C.type="string"),C.enum=_;break}case"literal":{const C=k,_=[];for(const E of i.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");_.push(Number(E))}else _.push(E);if(_.length!==0)if(_.length===1){const E=_[0];C.type=E===null?"null":typeof E,C.const=E}else _.every(E=>typeof E=="number")&&(C.type="number"),_.every(E=>typeof E=="string")&&(C.type="string"),_.every(E=>typeof E=="boolean")&&(C.type="string"),_.every(E=>E===null)&&(C.type="null"),C.enum=_;break}case"file":{const C=k,_={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:I,mime:N}=t._zod.bag;E!==void 0&&(_.minLength=E),I!==void 0&&(_.maxLength=I),N?N.length===1?(_.contentMediaType=N[0],Object.assign(C,_)):C.anyOf=N.map(M=>({..._,contentMediaType:M})):Object.assign(C,_);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const C=this.process(i.innerType,x);k.anyOf=[C,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,x),a.ref=i.innerType;break}case"success":{const C=k;C.type="boolean";break}case"default":{this.process(i.innerType,x),a.ref=i.innerType,k.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,x),a.ref=i.innerType,this.io==="input"&&(k._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,x),a.ref=i.innerType;let C;try{C=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}k.default=C;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const C=k,_=t._zod.pattern;if(!_)throw new Error("Pattern not found in template literal");C.type="string",C.pattern=_.source;break}case"pipe":{const C=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(C,x),a.ref=C;break}case"readonly":{this.process(i.innerType,x),a.ref=i.innerType,k.readOnly=!0;break}case"promise":{this.process(i.innerType,x),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,x),a.ref=i.innerType;break}case"lazy":{const C=t._zod.innerType;this.process(C,x),a.ref=C;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const c=this.metadataRegistry.get(t);return c&&Object.assign(a.schema,c),this.io==="input"&&Un(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,n){var f,h,m,g,x,b;const r={cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=k=>{var N;const C=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const M=(N=r.external.registry.get(k[0]))==null?void 0:N.id,j=r.external.uri??(R=>R);if(M)return{ref:j(M)};const O=k[1].defId??k[1].schema.id??`schema${this.counter++}`;return k[1].defId=O,{defId:O,ref:`${j("__shared")}#/${C}/${O}`}}if(k[1]===i)return{ref:"#"};const E=`#/${C}/`,I=k[1].schema.id??`__schema${this.counter++}`;return{defId:I,ref:E+I}},s=k=>{if(k[1].schema.$ref)return;const C=k[1],{ref:_,defId:E}=o(k);C.def={...C.schema},E&&(C.defId=E);const I=C.schema;for(const N in I)delete I[N];I.$ref=_};if(r.cycles==="throw")for(const k of this.seen.entries()){const C=k[1];if(C.cycle)throw new Error(`Cycle detected: #/${(f=C.cycle)==null?void 0:f.join("/")}/<root>
68
-
69
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const k of this.seen.entries()){const C=k[1];if(t===k[0]){s(k);continue}if(r.external){const E=(h=r.external.registry.get(k[0]))==null?void 0:h.id;if(t!==k[0]&&E){s(k);continue}}if((m=this.metadataRegistry.get(k[0]))==null?void 0:m.id){s(k);continue}if(C.cycle){s(k);continue}if(C.count>1&&r.reused==="ref"){s(k);continue}}const a=(k,C)=>{const _=this.seen.get(k),E=_.def??_.schema,I={...E};if(_.ref===null)return;const N=_.ref;if(_.ref=null,N){a(N,C);const M=this.seen.get(N).schema;M.$ref&&C.target==="draft-7"?(E.allOf=E.allOf??[],E.allOf.push(M)):(Object.assign(E,M),Object.assign(E,I))}_.isParent||this.override({zodSchema:k,jsonSchema:E,path:_.path??[]})};for(const k of[...this.seen.entries()].reverse())a(k[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),(g=r.external)!=null&&g.uri){const k=(x=r.external.registry.get(t))==null?void 0:x.id;if(!k)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(k)}Object.assign(u,i.def);const c=((b=r.external)==null?void 0:b.defs)??{};for(const k of this.seen.entries()){const C=k[1];C.def&&C.defId&&(c[C.defId]=C.def)}r.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function J8(e,t){if(e instanceof OE){const r=new rw(t),i={};for(const a of e._idmap.entries()){const[u,c]=a;r.process(c)}const o={},s={registry:e,uri:t==null?void 0:t.uri,defs:i};for(const a of e._idmap.entries()){const[u,c]=a;o[u]=r.emit(c,{...t,external:s})}if(Object.keys(i).length>0){const a=r.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[a]:i}}return{schemas:o}}const n=new rw(t);return n.process(e),n.emit(e,t)}function Un(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Un(i.element,n);case"object":{for(const o in i.shape)if(Un(i.shape[o],n))return!0;return!1}case"union":{for(const o of i.options)if(Un(o,n))return!0;return!1}case"intersection":return Un(i.left,n)||Un(i.right,n);case"tuple":{for(const o of i.items)if(Un(o,n))return!0;return!!(i.rest&&Un(i.rest,n))}case"record":return Un(i.keyType,n)||Un(i.valueType,n);case"map":return Un(i.keyType,n)||Un(i.valueType,n);case"set":return Un(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Un(i.innerType,n);case"lazy":return Un(i.getter(),n);case"default":return Un(i.innerType,n);case"prefault":return Un(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Un(i.in,n)||Un(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const K8=ie("ZodISODateTime",(e,t)=>{bD.init(e,t),Cn.init(e,t)});function G8(e){return E8(K8,e)}const Y8=ie("ZodISODate",(e,t)=>{vD.init(e,t),Cn.init(e,t)});function Q8(e){return _8(Y8,e)}const X8=ie("ZodISOTime",(e,t)=>{kD.init(e,t),Cn.init(e,t)});function eO(e){return T8(X8,e)}const tO=ie("ZodISODuration",(e,t)=>{wD.init(e,t),Cn.init(e,t)});function nO(e){return A8(tO,e)}const rO=(e,t)=>{vE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>mI(e,n)},flatten:{value:n=>pI(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Cp=ie("ZodError",rO,{Parent:Error}),iO=gI(Cp),oO=yI(Cp),sO=wE(Cp),jE=CE(Cp),mn=ie("ZodType",(e,t)=>(rn.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>za(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>iO(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>sO(e,n,r),e.parseAsync=async(n,r)=>oO(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>jE(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(tR(n,r)),e.superRefine=n=>e.check(nR(n)),e.overwrite=n=>e.check(Xc(n)),e.optional=()=>sw(e),e.nullable=()=>aw(e),e.nullish=()=>sw(aw(e)),e.nonoptional=n=>qO(e,n),e.array=()=>Gl(e),e.or=n=>Sr([e,n]),e.and=n=>jO(e,n),e.transform=n=>lw(e,$O(n)),e.default=n=>VO(e,n),e.prefault=n=>WO(e,n),e.catch=n=>JO(e,n),e.pipe=n=>lw(e,n),e.readonly=()=>YO(e),e.describe=n=>{const r=e.clone();return Zu.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Zu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Zu.get(e);const r=e.clone();return Zu.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zE=ie("_ZodString",(e,t)=>{wy.init(e,t),mn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(P8(...r)),e.includes=(...r)=>e.check(L8(...r)),e.startsWith=(...r)=>e.check(F8(...r)),e.endsWith=(...r)=>e.check($8(...r)),e.min=(...r)=>e.check(ah(...r)),e.max=(...r)=>e.check(RE(...r)),e.length=(...r)=>e.check(PE(...r)),e.nonempty=(...r)=>e.check(ah(1,...r)),e.lowercase=r=>e.check(j8(r)),e.uppercase=r=>e.check(z8(r)),e.trim=()=>e.check(U8()),e.normalize=(...r)=>e.check(B8(...r)),e.toLowerCase=()=>e.check(V8()),e.toUpperCase=()=>e.check(H8())}),aO=ie("ZodString",(e,t)=>{wy.init(e,t),zE.init(e,t),e.email=n=>e.check(i8(lO,n)),e.url=n=>e.check(u8(uO,n)),e.jwt=n=>e.check(S8(SO,n)),e.emoji=n=>e.check(c8(cO,n)),e.guid=n=>e.check(Xk(iw,n)),e.uuid=n=>e.check(o8(Cf,n)),e.uuidv4=n=>e.check(s8(Cf,n)),e.uuidv6=n=>e.check(a8(Cf,n)),e.uuidv7=n=>e.check(l8(Cf,n)),e.nanoid=n=>e.check(d8(dO,n)),e.guid=n=>e.check(Xk(iw,n)),e.cuid=n=>e.check(f8(fO,n)),e.cuid2=n=>e.check(h8(hO,n)),e.ulid=n=>e.check(p8(pO,n)),e.base64=n=>e.check(k8(kO,n)),e.base64url=n=>e.check(w8(wO,n)),e.xid=n=>e.check(m8(mO,n)),e.ksuid=n=>e.check(g8(gO,n)),e.ipv4=n=>e.check(y8(yO,n)),e.ipv6=n=>e.check(x8(xO,n)),e.cidrv4=n=>e.check(b8(bO,n)),e.cidrv6=n=>e.check(v8(vO,n)),e.e164=n=>e.check(C8(CO,n)),e.datetime=n=>e.check(G8(n)),e.date=n=>e.check(Q8(n)),e.time=n=>e.check(eO(n)),e.duration=n=>e.check(nO(n))});function je(e){return r8(aO,e)}const Cn=ie("ZodStringFormat",(e,t)=>{pn.init(e,t),zE.init(e,t)}),lO=ie("ZodEmail",(e,t)=>{cD.init(e,t),Cn.init(e,t)}),iw=ie("ZodGUID",(e,t)=>{lD.init(e,t),Cn.init(e,t)}),Cf=ie("ZodUUID",(e,t)=>{uD.init(e,t),Cn.init(e,t)}),uO=ie("ZodURL",(e,t)=>{dD.init(e,t),Cn.init(e,t)}),cO=ie("ZodEmoji",(e,t)=>{fD.init(e,t),Cn.init(e,t)}),dO=ie("ZodNanoID",(e,t)=>{hD.init(e,t),Cn.init(e,t)}),fO=ie("ZodCUID",(e,t)=>{pD.init(e,t),Cn.init(e,t)}),hO=ie("ZodCUID2",(e,t)=>{mD.init(e,t),Cn.init(e,t)}),pO=ie("ZodULID",(e,t)=>{gD.init(e,t),Cn.init(e,t)}),mO=ie("ZodXID",(e,t)=>{yD.init(e,t),Cn.init(e,t)}),gO=ie("ZodKSUID",(e,t)=>{xD.init(e,t),Cn.init(e,t)}),yO=ie("ZodIPv4",(e,t)=>{CD.init(e,t),Cn.init(e,t)}),xO=ie("ZodIPv6",(e,t)=>{SD.init(e,t),Cn.init(e,t)}),bO=ie("ZodCIDRv4",(e,t)=>{ED.init(e,t),Cn.init(e,t)}),vO=ie("ZodCIDRv6",(e,t)=>{_D.init(e,t),Cn.init(e,t)}),kO=ie("ZodBase64",(e,t)=>{TD.init(e,t),Cn.init(e,t)}),wO=ie("ZodBase64URL",(e,t)=>{MD.init(e,t),Cn.init(e,t)}),CO=ie("ZodE164",(e,t)=>{ND.init(e,t),Cn.init(e,t)}),SO=ie("ZodJWT",(e,t)=>{DD.init(e,t),Cn.init(e,t)}),LE=ie("ZodNumber",(e,t)=>{IE.init(e,t),mn.init(e,t),e.gt=(r,i)=>e.check(tw(r,i)),e.gte=(r,i)=>e.check(R0(r,i)),e.min=(r,i)=>e.check(R0(r,i)),e.lt=(r,i)=>e.check(ew(r,i)),e.lte=(r,i)=>e.check(O0(r,i)),e.max=(r,i)=>e.check(O0(r,i)),e.int=r=>e.check(ow(r)),e.safe=r=>e.check(ow(r)),e.positive=r=>e.check(tw(0,r)),e.nonnegative=r=>e.check(R0(0,r)),e.negative=r=>e.check(ew(0,r)),e.nonpositive=r=>e.check(O0(0,r)),e.multipleOf=(r,i)=>e.check(nw(r,i)),e.step=(r,i)=>e.check(nw(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function EO(e){return M8(LE,e)}const _O=ie("ZodNumberFormat",(e,t)=>{OD.init(e,t),LE.init(e,t)});function ow(e){return N8(_O,e)}const TO=ie("ZodBoolean",(e,t)=>{RD.init(e,t),mn.init(e,t)});function vr(e){return I8(TO,e)}const AO=ie("ZodNull",(e,t)=>{PD.init(e,t),mn.init(e,t)});function MO(e){return D8(AO,e)}const NO=ie("ZodUnknown",(e,t)=>{jD.init(e,t),mn.init(e,t)});function Xi(){return O8(NO)}const IO=ie("ZodNever",(e,t)=>{zD.init(e,t),mn.init(e,t)});function FE(e){return R8(IO,e)}const DO=ie("ZodArray",(e,t)=>{LD.init(e,t),mn.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(ah(n,r)),e.nonempty=n=>e.check(ah(1,n)),e.max=(n,r)=>e.check(RE(n,r)),e.length=(n,r)=>e.check(PE(n,r)),e.unwrap=()=>e.element});function Gl(e,t){return W8(DO,e,t)}const $E=ie("ZodObject",(e,t)=>{FD.init(e,t),mn.init(e,t),Wt(e,"shape",()=>t.shape),e.keyof=()=>UE(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:FE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>cI(e,n),e.merge=n=>dI(e,n),e.pick=n=>lI(e,n),e.omit=n=>uI(e,n),e.partial=(...n)=>fI(VE,e,n[0]),e.required=(...n)=>hI(HE,e,n[0])});function Yt(e,t){const n={type:"object",get shape(){return kp(this,"shape",{...e}),this.shape},...st(t)};return new $E(n)}function un(e,t){return new $E({type:"object",get shape(){return kp(this,"shape",{...e}),this.shape},catchall:FE(),...st(t)})}const BE=ie("ZodUnion",(e,t)=>{DE.init(e,t),mn.init(e,t),e.options=t.options});function Sr(e,t){return new BE({type:"union",options:e,...st(t)})}const OO=ie("ZodDiscriminatedUnion",(e,t)=>{BE.init(e,t),$D.init(e,t)});function RO(e,t,n){return new OO({type:"union",options:t,discriminator:e,...st(n)})}const PO=ie("ZodIntersection",(e,t)=>{BD.init(e,t),mn.init(e,t)});function jO(e,t){return new PO({type:"intersection",left:e,right:t})}const zO=ie("ZodRecord",(e,t)=>{UD.init(e,t),mn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ec(e,t,n){return new zO({type:"record",keyType:e,valueType:t,...st(n)})}const i1=ie("ZodEnum",(e,t)=>{VD.init(e,t),mn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const o={};for(const s of r)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new i1({...t,checks:[],...st(i),entries:o})},e.exclude=(r,i)=>{const o={...t.entries};for(const s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new i1({...t,checks:[],...st(i),entries:o})}});function UE(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new i1({type:"enum",entries:n,...st(t)})}const LO=ie("ZodLiteral",(e,t)=>{HD.init(e,t),mn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function mt(e,t){return new LO({type:"literal",values:Array.isArray(e)?e:[e],...st(t)})}const FO=ie("ZodTransform",(e,t)=>{WD.init(e,t),mn.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=o=>{if(typeof o=="string")n.issues.push(Sc(o,n.value,t));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(Sc(s))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function $O(e){return new FO({type:"transform",transform:e})}const VE=ie("ZodOptional",(e,t)=>{qD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sw(e){return new VE({type:"optional",innerType:e})}const BO=ie("ZodNullable",(e,t)=>{ZD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function aw(e){return new BO({type:"nullable",innerType:e})}const UO=ie("ZodDefault",(e,t)=>{JD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VO(e,t){return new UO({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const HO=ie("ZodPrefault",(e,t)=>{KD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function WO(e,t){return new HO({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const HE=ie("ZodNonOptional",(e,t)=>{GD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qO(e,t){return new HE({type:"nonoptional",innerType:e,...st(t)})}const ZO=ie("ZodCatch",(e,t)=>{YD.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JO(e,t){return new ZO({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const KO=ie("ZodPipe",(e,t)=>{QD.init(e,t),mn.init(e,t),e.in=t.in,e.out=t.out});function lw(e,t){return new KO({type:"pipe",in:e,out:t})}const GO=ie("ZodReadonly",(e,t)=>{XD.init(e,t),mn.init(e,t)});function YO(e){return new GO({type:"readonly",innerType:e})}const QO=ie("ZodLazy",(e,t)=>{e8.init(e,t),mn.init(e,t),e.unwrap=()=>e._zod.def.getter()});function XO(e){return new QO({type:"lazy",getter:e})}const Cy=ie("ZodCustom",(e,t)=>{t8.init(e,t),mn.init(e,t)});function eR(e){const t=new Wr({check:"custom"});return t._zod.check=e,t}function WE(e,t){return q8(Cy,e??(()=>!0),t)}function tR(e,t={}){return Z8(Cy,e,t)}function nR(e){const t=eR(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Sc(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Sc(i))}},e(n.value,n)));return t}function lh(e,t={error:`Input not instance of ${e.name}`}){const n=new Cy({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...st(t)});return n._zod.bag.Class=e,n}var Ht;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ht||(Ht={}));var uw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(uw||(uw={}));const et=Ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ms=e=>{switch(typeof e){case"undefined":return et.undefined;case"string":return et.string;case"number":return Number.isNaN(e)?et.nan:et.number;case"boolean":return et.boolean;case"function":return et.function;case"bigint":return et.bigint;case"symbol":return et.symbol;case"object":return Array.isArray(e)?et.array:e===null?et.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?et.promise:typeof Map<"u"&&e instanceof Map?et.map:typeof Set<"u"&&e instanceof Set?et.set:typeof Date<"u"&&e instanceof Date?et.date:et.object;default:return et.unknown}},Ae=Ht.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Lo extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),r}static assert(t){if(!(t instanceof Lo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ht.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Lo.create=e=>new Lo(e);const o1=(e,t)=>{let n;switch(e.code){case Ae.invalid_type:e.received===et.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ht.jsonStringifyReplacer)}`;break;case Ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ht.joinValues(e.keys,", ")}`;break;case Ae.invalid_union:n="Invalid input";break;case Ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ht.joinValues(e.options)}`;break;case Ae.invalid_enum_value:n=`Invalid enum value. Expected ${Ht.joinValues(e.options)}, received '${e.received}'`;break;case Ae.invalid_arguments:n="Invalid function arguments";break;case Ae.invalid_return_type:n="Invalid function return type";break;case Ae.invalid_date:n="Invalid date";break;case Ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ae.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ae.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ae.custom:n="Invalid input";break;case Ae.invalid_intersection_types:n="Intersection results could not be merged";break;case Ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ht.assertNever(e)}return{message:n}};let rR=o1;function iR(){return rR}const oR=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}};function Ve(e,t){const n=iR(),r=oR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===o1?void 0:o1].filter(i=>!!i)});e.common.issues.push(r)}class Er{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return bt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return Er.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return bt;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const bt=Object.freeze({status:"aborted"}),Ju=e=>({status:"dirty",value:e}),Ci=e=>({status:"valid",value:e}),cw=e=>e.status==="aborted",dw=e=>e.status==="dirty",Rl=e=>e.status==="valid",uh=e=>typeof Promise<"u"&&e instanceof Promise;var ot;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ot||(ot={}));class io{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const fw=(e,t)=>{if(Rl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Lo(e.common.issues);return this._error=n,this._error}}};function Nt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{const{message:u}=e;return s.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:i}}class $t{get description(){return this._def.description}_getType(t){return ms(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Er,ctx:{common:t.parent.common,data:t.data,parsedType:ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(uh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ms(t)},i=this._parseSync({data:t,path:r.path,parent:r});return fw(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ms(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return Rl(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>Rl(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ms(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(uh(i)?i:Promise.resolve(i));return fw(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:Ae.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new jl({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ms.create(this,this._def)}nullable(){return zl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return no.create(this)}promise(){return ph.create(this,this._def)}or(t){return dh.create([this,t],this._def)}and(t){return fh.create(this,t,this._def)}transform(t){return new jl({...Nt(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new u1({...Nt(this._def),innerType:this,defaultValue:n,typeName:Ne.ZodDefault})}brand(){return new AR({typeName:Ne.ZodBranded,type:this,...Nt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new c1({...Nt(this._def),innerType:this,catchValue:n,typeName:Ne.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Sy.create(this,t)}readonly(){return d1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sR=/^c[^\s-]{8,}$/i,aR=/^[0-9a-z]+$/,lR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cR=/^[a-z0-9_-]{21}$/i,dR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let P0;const mR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qE="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",kR=new RegExp(`^${qE}$`);function ZE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function wR(e){return new RegExp(`^${ZE(e)}$`)}function CR(e){let t=`${qE}T${ZE(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function SR(e,t){return!!((t==="v4"||!t)&&mR.test(e)||(t==="v6"||!t)&&yR.test(e))}function ER(e,t){if(!dR.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function _R(e,t){return!!((t==="v4"||!t)&&gR.test(e)||(t==="v6"||!t)&&xR.test(e))}class Do extends $t{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==et.string){const o=this._getOrReturnCtx(t);return Ve(o,{code:Ae.invalid_type,expected:et.string,received:o.parsedType}),bt}const r=new Er;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ve(i,{code:Ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ve(i,{code:Ae.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")hR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"email",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")P0||(P0=new RegExp(pR,"u")),P0.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"emoji",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")uR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"uuid",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")cR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"nanoid",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")sR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"cuid",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")aR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"cuid2",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"ulid",code:Ae.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ve(i,{validation:"url",code:Ae.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"regex",code:Ae.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?CR(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?kR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?wR(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"duration",code:Ae.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?SR(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"ip",code:Ae.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?ER(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"jwt",code:Ae.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?_R(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"cidr",code:Ae.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?bR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"base64",code:Ae.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?vR.test(t.data)||(i=this._getOrReturnCtx(t,i),Ve(i,{validation:"base64url",code:Ae.invalid_string,message:o.message}),r.dirty()):Ht.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Ae.invalid_string,...ot.errToObj(r)})}_addCheck(t){return new Do({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ot.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ot.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ot.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ot.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ot.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ot.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ot.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ot.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ot.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ot.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ot.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ot.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ot.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ot.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ot.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ot.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ot.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ot.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ot.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ot.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ot.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ot.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ot.errToObj(n)})}nonempty(t){return this.min(1,ot.errToObj(t))}trim(){return new Do({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Do({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Do({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Do.create=e=>new Do({checks:[],typeName:Ne.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Nt(e)});function TR(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}class _c extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==et.number){const o=this._getOrReturnCtx(t);return Ve(o,{code:Ae.invalid_type,expected:et.number,received:o.parsedType}),bt}let r;const i=new Er;for(const o of this._def.checks)o.kind==="int"?Ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?TR(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.not_finite,message:o.message}),i.dirty()):Ht.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ot.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ot.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ot.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ot.toString(n))}setLimit(t,n,r,i){return new _c({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ot.toString(i)}]})}_addCheck(t){return new _c({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ot.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ot.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ot.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ot.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ot.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ot.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ot.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ot.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ot.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ht.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}_c.create=e=>new _c({checks:[],typeName:Ne.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Nt(e)});class Tc extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==et.bigint)return this._getInvalidInput(t);let r;const i=new Er;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ve(r,{code:Ae.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ht.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ve(n,{code:Ae.invalid_type,expected:et.bigint,received:n.parsedType}),bt}gte(t,n){return this.setLimit("min",t,!0,ot.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ot.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ot.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ot.toString(n))}setLimit(t,n,r,i){return new Tc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ot.toString(i)}]})}_addCheck(t){return new Tc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ot.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ot.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ot.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ot.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ot.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Tc.create=e=>new Tc({checks:[],typeName:Ne.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Nt(e)});class s1 extends $t{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==et.boolean){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.boolean,received:r.parsedType}),bt}return Ci(t.data)}}s1.create=e=>new s1({typeName:Ne.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Nt(e)});class ch extends $t{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==et.date){const o=this._getOrReturnCtx(t);return Ve(o,{code:Ae.invalid_type,expected:et.date,received:o.parsedType}),bt}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ve(o,{code:Ae.invalid_date}),bt}const r=new Er;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ve(i,{code:Ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ht.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ch({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ot.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ot.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ch.create=e=>new ch({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ne.ZodDate,...Nt(e)});class hw extends $t{_parse(t){if(this._getType(t)!==et.symbol){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.symbol,received:r.parsedType}),bt}return Ci(t.data)}}hw.create=e=>new hw({typeName:Ne.ZodSymbol,...Nt(e)});class pw extends $t{_parse(t){if(this._getType(t)!==et.undefined){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.undefined,received:r.parsedType}),bt}return Ci(t.data)}}pw.create=e=>new pw({typeName:Ne.ZodUndefined,...Nt(e)});class mw extends $t{_parse(t){if(this._getType(t)!==et.null){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.null,received:r.parsedType}),bt}return Ci(t.data)}}mw.create=e=>new mw({typeName:Ne.ZodNull,...Nt(e)});class Ac extends $t{constructor(){super(...arguments),this._any=!0}_parse(t){return Ci(t.data)}}Ac.create=e=>new Ac({typeName:Ne.ZodAny,...Nt(e)});class a1 extends $t{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ci(t.data)}}a1.create=e=>new a1({typeName:Ne.ZodUnknown,...Nt(e)});class Ls extends $t{_parse(t){const n=this._getOrReturnCtx(t);return Ve(n,{code:Ae.invalid_type,expected:et.never,received:n.parsedType}),bt}}Ls.create=e=>new Ls({typeName:Ne.ZodNever,...Nt(e)});class gw extends $t{_parse(t){if(this._getType(t)!==et.undefined){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.void,received:r.parsedType}),bt}return Ci(t.data)}}gw.create=e=>new gw({typeName:Ne.ZodVoid,...Nt(e)});class no extends $t{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==et.array)return Ve(n,{code:Ae.invalid_type,expected:et.array,received:n.parsedType}),bt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ve(n,{code:s?Ae.too_big:Ae.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ve(n,{code:Ae.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ve(n,{code:Ae.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new io(n,s,n.path,a)))).then(s=>Er.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new io(n,s,n.path,a)));return Er.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new no({...this._def,minLength:{value:t,message:ot.toString(n)}})}max(t,n){return new no({...this._def,maxLength:{value:t,message:ot.toString(n)}})}length(t,n){return new no({...this._def,exactLength:{value:t,message:ot.toString(n)}})}nonempty(t){return this.min(1,t)}}no.create=(e,t)=>new no({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...Nt(t)});function vl(e){if(e instanceof Dn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ms.create(vl(r))}return new Dn({...e._def,shape:()=>t})}else return e instanceof no?new no({...e._def,type:vl(e.element)}):e instanceof Ms?Ms.create(vl(e.unwrap())):e instanceof zl?zl.create(vl(e.unwrap())):e instanceof Ta?Ta.create(e.items.map(t=>vl(t))):e}class Dn extends $t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ht.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==et.object){const c=this._getOrReturnCtx(t);return Ve(c,{code:Ae.invalid_type,expected:et.object,received:c.parsedType}),bt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ls&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const u=[];for(const c of s){const f=o[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new io(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ls){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")a.length>0&&(Ve(i,{code:Ae.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const h=i.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new io(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of u){const h=await f.key,m=await f.value;c.push({key:h,value:m,alwaysSet:f.alwaysSet})}return c}).then(c=>Er.mergeObjectSync(r,c)):Er.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return ot.errToObj,new Dn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s;const i=((s=(o=this._def).errorMap)==null?void 0:s.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ot.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Dn({...this._def,unknownKeys:"strip"})}passthrough(){return new Dn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Dn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Dn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ne.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Dn({...this._def,catchall:t})}pick(t){const n={};for(const r of Ht.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Dn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ht.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Dn({...this._def,shape:()=>n})}deepPartial(){return vl(this)}partial(t){const n={};for(const r of Ht.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Dn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ht.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ms;)o=o._def.innerType;n[r]=o}return new Dn({...this._def,shape:()=>n})}keyof(){return JE(Ht.objectKeys(this.shape))}}Dn.create=(e,t)=>new Dn({shape:()=>e,unknownKeys:"strip",catchall:Ls.create(),typeName:Ne.ZodObject,...Nt(t)});Dn.strictCreate=(e,t)=>new Dn({shape:()=>e,unknownKeys:"strict",catchall:Ls.create(),typeName:Ne.ZodObject,...Nt(t)});Dn.lazycreate=(e,t)=>new Dn({shape:e,unknownKeys:"strip",catchall:Ls.create(),typeName:Ne.ZodObject,...Nt(t)});class dh extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Lo(a.ctx.common.issues));return Ve(n,{code:Ae.invalid_union,unionErrors:s}),bt}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const u of r){const c={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(u=>new Lo(u));return Ve(n,{code:Ae.invalid_union,unionErrors:a}),bt}}get options(){return this._def.options}}dh.create=(e,t)=>new dh({options:e,typeName:Ne.ZodUnion,...Nt(t)});function l1(e,t){const n=ms(e),r=ms(t);if(e===t)return{valid:!0,data:e};if(n===et.object&&r===et.object){const i=Ht.objectKeys(t),o=Ht.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const u=l1(e[a],t[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(n===et.array&&r===et.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],u=l1(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===et.date&&r===et.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fh extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(cw(o)||cw(s))return bt;const a=l1(o.value,s.value);return a.valid?((dw(o)||dw(s))&&n.dirty(),{status:n.value,value:a.data}):(Ve(r,{code:Ae.invalid_intersection_types}),bt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}fh.create=(e,t,n)=>new fh({left:e,right:t,typeName:Ne.ZodIntersection,...Nt(n)});class Ta extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.array)return Ve(r,{code:Ae.invalid_type,expected:et.array,received:r.parsedType}),bt;if(r.data.length<this._def.items.length)return Ve(r,{code:Ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),bt;!this._def.rest&&r.data.length>this._def.items.length&&(Ve(r,{code:Ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new io(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Er.mergeArray(n,s)):Er.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ta({...this._def,rest:t})}}Ta.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ta({items:e,typeName:Ne.ZodTuple,rest:null,...Nt(t)})};class hh extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.object)return Ve(r,{code:Ae.invalid_type,expected:et.object,received:r.parsedType}),bt;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new io(r,a,r.path,a)),value:s._parse(new io(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Er.mergeObjectAsync(n,i):Er.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $t?new hh({keyType:t,valueType:n,typeName:Ne.ZodRecord,...Nt(r)}):new hh({keyType:Do.create(),valueType:t,typeName:Ne.ZodRecord,...Nt(n)})}}class yw extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.map)return Ve(r,{code:Ae.invalid_type,expected:et.map,received:r.parsedType}),bt;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,u],c)=>({key:i._parse(new io(r,a,r.path,[c,"key"])),value:o._parse(new io(r,u,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of s){const c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return bt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of s){const c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return bt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}}}}yw.create=(e,t,n)=>new yw({valueType:t,keyType:e,typeName:Ne.ZodMap,...Nt(n)});class Mc extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.set)return Ve(r,{code:Ae.invalid_type,expected:et.set,received:r.parsedType}),bt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ve(r,{code:Ae.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ve(r,{code:Ae.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(u){const c=new Set;for(const f of u){if(f.status==="aborted")return bt;f.status==="dirty"&&n.dirty(),c.add(f.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((u,c)=>o._parse(new io(r,u,r.path,c)));return r.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(t,n){return new Mc({...this._def,minSize:{value:t,message:ot.toString(n)}})}max(t,n){return new Mc({...this._def,maxSize:{value:t,message:ot.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Mc.create=(e,t)=>new Mc({valueType:e,minSize:null,maxSize:null,typeName:Ne.ZodSet,...Nt(t)});class xw extends $t{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}xw.create=(e,t)=>new xw({getter:e,typeName:Ne.ZodLazy,...Nt(t)});class bw extends $t{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ve(n,{received:n.data,code:Ae.invalid_literal,expected:this._def.value}),bt}return{status:"valid",value:t.data}}get value(){return this._def.value}}bw.create=(e,t)=>new bw({value:e,typeName:Ne.ZodLiteral,...Nt(t)});function JE(e,t){return new Pl({values:e,typeName:Ne.ZodEnum,...Nt(t)})}class Pl extends $t{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ve(n,{expected:Ht.joinValues(r),received:n.parsedType,code:Ae.invalid_type}),bt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ve(n,{received:n.data,code:Ae.invalid_enum_value,options:r}),bt}return Ci(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Pl.create(t,{...this._def,...n})}exclude(t,n=this._def){return Pl.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Pl.create=JE;class vw extends $t{_parse(t){const n=Ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==et.string&&r.parsedType!==et.number){const i=Ht.objectValues(n);return Ve(r,{expected:Ht.joinValues(i),received:r.parsedType,code:Ae.invalid_type}),bt}if(this._cache||(this._cache=new Set(Ht.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Ht.objectValues(n);return Ve(r,{received:r.data,code:Ae.invalid_enum_value,options:i}),bt}return Ci(t.data)}get enum(){return this._def.values}}vw.create=(e,t)=>new vw({values:e,typeName:Ne.ZodNativeEnum,...Nt(t)});class ph extends $t{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==et.promise&&n.common.async===!1)return Ve(n,{code:Ae.invalid_type,expected:et.promise,received:n.parsedType}),bt;const r=n.parsedType===et.promise?n.data:Promise.resolve(n.data);return Ci(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ph.create=(e,t)=>new ph({type:e,typeName:Ne.ZodPromise,...Nt(t)});class jl extends $t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Ve(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return bt;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?bt:u.status==="dirty"||n.value==="dirty"?Ju(u.value):u});{if(n.value==="aborted")return bt;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?bt:a.status==="dirty"||n.value==="dirty"?Ju(a.value):a}}if(i.type==="refinement"){const s=a=>{const u=i.refinement(a,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?bt:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?bt:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Rl(s))return bt;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Rl(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):bt);Ht.assertNever(i)}}jl.create=(e,t,n)=>new jl({schema:e,typeName:Ne.ZodEffects,effect:t,...Nt(n)});jl.createWithPreprocess=(e,t,n)=>new jl({schema:t,effect:{type:"preprocess",transform:e},typeName:Ne.ZodEffects,...Nt(n)});class Ms extends $t{_parse(t){return this._getType(t)===et.undefined?Ci(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ms.create=(e,t)=>new Ms({innerType:e,typeName:Ne.ZodOptional,...Nt(t)});class zl extends $t{_parse(t){return this._getType(t)===et.null?Ci(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zl.create=(e,t)=>new zl({innerType:e,typeName:Ne.ZodNullable,...Nt(t)});class u1 extends $t{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===et.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}u1.create=(e,t)=>new u1({innerType:e,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Nt(t)});class c1 extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return uh(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}c1.create=(e,t)=>new c1({innerType:e,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Nt(t)});class kw extends $t{_parse(t){if(this._getType(t)!==et.nan){const r=this._getOrReturnCtx(t);return Ve(r,{code:Ae.invalid_type,expected:et.nan,received:r.parsedType}),bt}return{status:"valid",value:t.data}}}kw.create=e=>new kw({typeName:Ne.ZodNaN,...Nt(e)});class AR extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Sy extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?bt:o.status==="dirty"?(n.dirty(),Ju(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?bt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Sy({in:t,out:n,typeName:Ne.ZodPipeline})}}class d1 extends $t{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Rl(i)&&(i.value=Object.freeze(i.value)),i);return uh(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}d1.create=(e,t)=>new d1({innerType:e,typeName:Ne.ZodReadonly,...Nt(t)});function ww(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function MR(e,t={},n){return e?Ac.create().superRefine((r,i)=>{const o=e(r);if(o instanceof Promise)return o.then(s=>{if(!s){const a=ww(t,r),u=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:u})}});if(!o){const s=ww(t,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Ac.create()}var Ne;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ne||(Ne={}));const kn=Do.create,KE=s1.create;Ac.create;const GE=a1.create;Ls.create;const Ey=no.create,La=Dn.create;dh.create;fh.create;Ta.create;const Aa=hh.create,Nc=Pl.create;ph.create;Ms.create;zl.create;class Cw extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}function j0(e){}function NR(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=j0,onError:n=j0,onRetry:r=j0,onComment:i}=e;let o="",s=!0,a,u="",c="";function f(b){const k=s?b.replace(/^\xEF\xBB\xBF/,""):b,[C,_]=IR(`${o}${k}`);for(const E of C)h(E);o=_,s=!1}function h(b){if(b===""){g();return}if(b.startsWith(":")){i&&i(b.slice(b.startsWith(": ")?2:1));return}const k=b.indexOf(":");if(k!==-1){const C=b.slice(0,k),_=b[k+1]===" "?2:1,E=b.slice(k+_);m(C,E,b);return}m(b,"",b)}function m(b,k,C){switch(b){case"event":c=k;break;case"data":u=`${u}${k}
70
- `;break;case"id":a=k.includes("\0")?void 0:k;break;case"retry":/^\d+$/.test(k)?r(parseInt(k,10)):n(new Cw(`Invalid \`retry\` value: "${k}"`,{type:"invalid-retry",value:k,line:C}));break;default:n(new Cw(`Unknown field "${b.length>20?`${b.slice(0,20)}…`:b}"`,{type:"unknown-field",field:b,value:k,line:C}));break}}function g(){u.length>0&&t({id:a,event:c||void 0,data:u.endsWith(`
71
- `)?u.slice(0,-1):u}),a=void 0,u="",c=""}function x(b={}){o&&b.consume&&h(o),s=!0,a=void 0,u="",c="",o=""}return{feed:f,reset:x}}function IR(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
72
- `,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
73
- `&&r++}}return[t,n]}class DR extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let i;super({start(o){i=NR({onEvent:s=>{o.enqueue(s)},onError(s){t==="terminate"?o.error(s):typeof t=="function"&&t(s)},onRetry:n,onComment:r})},transform(o){i.feed(o)}})}}var ed=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const o=n.length,s=new Array(t);for(let a=0;a<t;a++)s[a]=n[Math.random()*o|0];return s.join("")};if(e==null)return i;if(n.includes(r))throw new XN({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},OR=ed();function Sw(e=globalThis){var t,n,r;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(r=(n=e.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ma(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((n,r)=>{t[r.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function Ew(e,...t){const n=new Headers(ma(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var RR=/"__proto__"\s*:/,PR=/"constructor"\s*:/;function _w(e){const t=JSON.parse(e);return t===null||typeof t!="object"||RR.test(e)===!1&&PR.test(e)===!1?t:jR(t)}function jR(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const o=r[i];o&&typeof o=="object"&&t.push(o)}}}return e}function zR(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return _w(e)}try{return _w(e)}finally{Error.stackTraceLimit=t}}function _y(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:n}=e;if(n!=null)for(const r of Object.keys(n))n[r]=da(n[r])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(da):da(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(da)),e.allOf!=null&&(e.allOf=e.allOf.map(da)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(da));const{definitions:t}=e;if(t!=null)for(const n of Object.keys(t))t[n]=da(t[n]);return e}function da(e){return typeof e=="boolean"?e:_y(e)}var LR=Symbol("Let zodToJsonSchema decide on which parser to use"),Tw={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},FR=e=>typeof e=="string"?{...Tw,name:e}:{...Tw,...e};function ri(){return{}}function $R(e,t){var n,r,i;const o={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==Ne.ZodAny&&(o.items=Jt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function BR(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function UR(){return{type:"boolean"}}function YE(e,t){return Jt(e.type._def,t)}var VR=(e,t)=>Jt(e.innerType._def,t);function QE(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,o)=>QE(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return HR(e)}}var HR=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function WR(e,t){return{...Jt(e.innerType._def,t),default:e.defaultValue()}}function qR(e,t){return t.effectStrategy==="input"?Jt(e.schema._def,t):ri()}function ZR(e){return{type:"string",enum:Array.from(e.values)}}var JR=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function KR(e,t){const n=[Jt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Jt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(JR(i))r.push(...i.allOf);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...a}=i;o=a}r.push(o)}}),r.length?{allOf:r}:void 0}function GR(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var z0=void 0,zi={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(z0===void 0&&(z0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),z0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function XE(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Li(n,"email",r.message,t);break;case"format:idn-email":Li(n,"idn-email",r.message,t);break;case"pattern:zod":br(n,zi.email,r.message,t);break}break;case"url":Li(n,"uri",r.message,t);break;case"uuid":Li(n,"uuid",r.message,t);break;case"regex":br(n,r.regex,r.message,t);break;case"cuid":br(n,zi.cuid,r.message,t);break;case"cuid2":br(n,zi.cuid2,r.message,t);break;case"startsWith":br(n,RegExp(`^${L0(r.value,t)}`),r.message,t);break;case"endsWith":br(n,RegExp(`${L0(r.value,t)}$`),r.message,t);break;case"datetime":Li(n,"date-time",r.message,t);break;case"date":Li(n,"date",r.message,t);break;case"time":Li(n,"time",r.message,t);break;case"duration":Li(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{br(n,RegExp(L0(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Li(n,"ipv4",r.message,t),r.version!=="v4"&&Li(n,"ipv6",r.message,t);break}case"base64url":br(n,zi.base64url,r.message,t);break;case"jwt":br(n,zi.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&br(n,zi.ipv4Cidr,r.message,t),r.version!=="v4"&&br(n,zi.ipv6Cidr,r.message,t);break}case"emoji":br(n,zi.emoji(),r.message,t);break;case"ulid":{br(n,zi.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Li(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{br(n,zi.base64,r.message,t);break}}break}case"nanoid":br(n,zi.nanoid,r.message,t)}return n}function L0(e,t){return t.patternStrategy==="escape"?QR(e):e}var YR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function QR(e){let t="";for(let n=0;n<e.length;n++)YR.has(e[n])||(t+="\\"),t+=e[n];return t}function Li(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function br(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Aw(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Aw(t,r)}function Aw(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let o="",s=!1,a=!1,u=!1;for(let c=0;c<i.length;c++){if(s){o+=i[c],s=!1;continue}if(r.i){if(a){if(i[c].match(/[a-z]/)){u?(o+=i[c],o+=`${i[c-2]}-${i[c]}`.toUpperCase(),u=!1):i[c+1]==="-"&&((n=i[c+2])!=null&&n.match(/[a-z]/))?(o+=i[c],u=!0):o+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){o+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(r.m){if(i[c]==="^"){o+=`(^|(?<=[\r
74
- ]))`;continue}else if(i[c]==="$"){o+=`($|(?=[\r
75
- ]))`;continue}}if(r.s&&i[c]==="."){o+=a?`${i[c]}\r
76
- `:`[${i[c]}\r
77
- ]`;continue}o+=i[c],i[c]==="\\"?s=!0:a&&i[c]==="]"?a=!1:!a&&i[c]==="["&&(a=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function e_(e,t){var n,r,i,o,s,a;const u={type:"object",additionalProperties:(n=Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Ne.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:c,...f}=XE(e.keyType._def,t);return{...u,propertyNames:f}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===Ne.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((s=e.keyType)==null?void 0:s._def.typeName)===Ne.ZodBranded&&e.keyType._def.type._def.typeName===Ne.ZodString&&((a=e.keyType._def.type._def.checks)!=null&&a.length)){const{type:c,...f}=YE(e.keyType._def,t);return{...u,propertyNames:f}}}return u}function XR(e,t){if(t.mapStrategy==="record")return e_(e,t);const n=Jt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||ri(),r=Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||ri();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function e5(e){const t=e.values,r=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),i=Array.from(new Set(r.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function t5(){return{not:ri()}}function n5(){return{type:"null"}}var f1={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function r5(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in f1&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,o)=>{const s=f1[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,o)=>{const s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(o=>!r.includes(o))],[])};return i5(e,t)}var i5=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Jt(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function o5(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[f1[e.innerType._def.typeName],"null"]};const n=Jt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function s5(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function a5(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const s in i){let a=i[s];if(a===void 0||a._def===void 0)continue;const u=u5(a),c=Jt(a._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});c!==void 0&&(n.properties[s]=c,u||r.push(s))}r.length&&(n.required=r);const o=l5(e,t);return o!==void 0&&(n.additionalProperties=o),n}function l5(e,t){if(e.catchall._def.typeName!=="ZodNever")return Jt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function u5(e){try{return e.isOptional()}catch{return!0}}var c5=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Jt(e.innerType._def,t);const r=Jt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ri()},r]}:ri()},d5=(e,t)=>{if(t.pipeStrategy==="input")return Jt(e.in._def,t);if(t.pipeStrategy==="output")return Jt(e.out._def,t);const n=Jt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Jt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function f5(e,t){return Jt(e.type._def,t)}function h5(e,t){const r={type:"array",uniqueItems:!0,items:Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function p5(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Jt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Jt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Jt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function m5(){return{not:ri()}}function g5(){return ri()}var y5=(e,t)=>Jt(e.innerType._def,t),x5=(e,t,n)=>{switch(t){case Ne.ZodString:return XE(e,n);case Ne.ZodNumber:return s5(e);case Ne.ZodObject:return a5(e,n);case Ne.ZodBigInt:return BR(e);case Ne.ZodBoolean:return UR();case Ne.ZodDate:return QE(e,n);case Ne.ZodUndefined:return m5();case Ne.ZodNull:return n5();case Ne.ZodArray:return $R(e,n);case Ne.ZodUnion:case Ne.ZodDiscriminatedUnion:return r5(e,n);case Ne.ZodIntersection:return KR(e,n);case Ne.ZodTuple:return p5(e,n);case Ne.ZodRecord:return e_(e,n);case Ne.ZodLiteral:return GR(e);case Ne.ZodEnum:return ZR(e);case Ne.ZodNativeEnum:return e5(e);case Ne.ZodNullable:return o5(e,n);case Ne.ZodOptional:return c5(e,n);case Ne.ZodMap:return XR(e,n);case Ne.ZodSet:return h5(e,n);case Ne.ZodLazy:return()=>e.getter()._def;case Ne.ZodPromise:return f5(e,n);case Ne.ZodNaN:case Ne.ZodNever:return t5();case Ne.ZodEffects:return qR(e,n);case Ne.ZodAny:return ri();case Ne.ZodUnknown:return g5();case Ne.ZodDefault:return WR(e,n);case Ne.ZodBranded:return YE(e,n);case Ne.ZodReadonly:return y5(e,n);case Ne.ZodCatch:return VR(e,n);case Ne.ZodPipeline:return d5(e,n);case Ne.ZodFunction:case Ne.ZodVoid:case Ne.ZodSymbol:return;default:return(r=>{})()}},b5=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Jt(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const u=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(u!==LR)return u}if(i&&!n){const u=v5(i,t);if(u!==void 0)return u}const o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);const s=x5(e,e.typeName,t),a=typeof s=="function"?Jt(s(),t):s;if(a&&k5(e,t,a),t.postProcess){const u=t.postProcess(a,e,t);return o.jsonSchema=a,u}return o.jsonSchema=a,a}var v5=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:b5(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),ri()):t.$refStrategy==="seen"?ri():void 0}},k5=(e,t,n)=>(e.description&&(n.description=e.description),n),w5=e=>{const t=FR(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},C5=(e,t)=>{var n;const r=w5(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[f,h])=>{var m;return{...c,[f]:(m=Jt(h._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?m:ri()}},{}):void 0;const o=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,s=(n=Jt(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1))!=null?n:ri(),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(s.title=a);const u=o===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...i,[o]:s}};return u.$schema="http://json-schema.org/draft-07/schema#",u},h1=Symbol.for("vercel.ai.schema");function S5(e){let t;return()=>(t==null&&(t=e()),t)}function Sp(e,{validate:t}={}){return{[h1]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function E5(e){return typeof e=="object"&&e!==null&&h1 in e&&e[h1]===!0&&"jsonSchema"in e&&"validate"in e}function Ty(e){return e==null?Sp({properties:{},additionalProperties:!1}):E5(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?t_(e):_5(e):e()}function _5(e){return Sp(()=>_y(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Ol({value:t,cause:n.issues})}}})}function T5(e,t){var n;const r=(n=void 0)!=null?n:!1;return Sp(()=>C5(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const o=await e.safeParseAsync(i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function A5(e,t){var n;const r=(n=void 0)!=null?n:!1;return Sp(()=>_y(J8(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const o=await jE(e,i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function M5(e){return"_zod"in e}function t_(e,t){return M5(e)?A5(e):T5(e)}async function Mw({value:e,schema:t,context:n}){const r=await Ic({value:e,schema:t,context:n});if(!r.success)throw Ol.wrap({value:e,cause:r.error,context:n});return r.value}async function Ic({value:e,schema:t,context:n}){const r=Ty(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const i=await r.validate(e);return i.success?{success:!0,value:i.value,rawValue:e}:{success:!1,error:Ol.wrap({value:e,cause:i.error,context:n}),rawValue:e}}catch(i){return{success:!1,error:Ol.wrap({value:e,cause:i,context:n}),rawValue:e}}}async function Ma({text:e,schema:t}){try{const n=zR(e);return t==null?{success:!0,value:n,rawValue:n}:await Ic({value:n,schema:t})}catch(n){return{success:!1,error:$k.isInstance(n)?n:new $k({text:e,cause:n}),rawValue:void 0}}}function N5({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new DR).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Ma({text:n,schema:t}))}}))}async function gs(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var I5=Object.defineProperty,D5=(e,t)=>{for(var n in t)I5(e,n,{get:t[n],enumerable:!0})},n_="AI_NoObjectGeneratedError",r_=`vercel.ai.error.${n_}`,O5=Symbol.for(r_),i_,Ns=class extends ro{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:o}){super({name:n_,message:e,cause:t}),this[i_]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=o}static isInstance(e){return ro.hasMarker(e,r_)}};i_=O5;var o_="AI_UIMessageStreamError",s_=`vercel.ai.error.${o_}`,R5=Symbol.for(s_),a_,fl=class extends ro{constructor({chunkType:e,chunkId:t,message:n}){super({name:o_,message:n}),this[a_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return ro.hasMarker(e,s_)}};a_=R5;var Nw="6.0.97",l_=Sr([je(),lh(Uint8Array),lh(ArrayBuffer),WE(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),Dc=XO(()=>Sr([MO(),je(),EO(),vr(),Ec(je(),Dc.optional()),Gl(Dc)])),Ft=Ec(je(),Ec(je(),Dc.optional())),u_=Yt({type:mt("text"),text:je(),providerOptions:Ft.optional()}),P5=Yt({type:mt("image"),image:Sr([l_,lh(URL)]),mediaType:je().optional(),providerOptions:Ft.optional()}),c_=Yt({type:mt("file"),data:Sr([l_,lh(URL)]),filename:je().optional(),mediaType:je(),providerOptions:Ft.optional()}),j5=Yt({type:mt("reasoning"),text:je(),providerOptions:Ft.optional()}),z5=Yt({type:mt("tool-call"),toolCallId:je(),toolName:je(),input:Xi(),providerOptions:Ft.optional(),providerExecuted:vr().optional()}),L5=RO("type",[Yt({type:mt("text"),value:je(),providerOptions:Ft.optional()}),Yt({type:mt("json"),value:Dc,providerOptions:Ft.optional()}),Yt({type:mt("execution-denied"),reason:je().optional(),providerOptions:Ft.optional()}),Yt({type:mt("error-text"),value:je(),providerOptions:Ft.optional()}),Yt({type:mt("error-json"),value:Dc,providerOptions:Ft.optional()}),Yt({type:mt("content"),value:Gl(Sr([Yt({type:mt("text"),text:je(),providerOptions:Ft.optional()}),Yt({type:mt("media"),data:je(),mediaType:je()}),Yt({type:mt("file-data"),data:je(),mediaType:je(),filename:je().optional(),providerOptions:Ft.optional()}),Yt({type:mt("file-url"),url:je(),providerOptions:Ft.optional()}),Yt({type:mt("file-id"),fileId:Sr([je(),Ec(je(),je())]),providerOptions:Ft.optional()}),Yt({type:mt("image-data"),data:je(),mediaType:je(),providerOptions:Ft.optional()}),Yt({type:mt("image-url"),url:je(),providerOptions:Ft.optional()}),Yt({type:mt("image-file-id"),fileId:Sr([je(),Ec(je(),je())]),providerOptions:Ft.optional()}),Yt({type:mt("custom"),providerOptions:Ft.optional()})]))})]),d_=Yt({type:mt("tool-result"),toolCallId:je(),toolName:je(),output:L5,providerOptions:Ft.optional()}),F5=Yt({type:mt("tool-approval-request"),approvalId:je(),toolCallId:je()}),$5=Yt({type:mt("tool-approval-response"),approvalId:je(),approved:vr(),reason:je().optional()}),B5=Yt({role:mt("system"),content:je(),providerOptions:Ft.optional()}),U5=Yt({role:mt("user"),content:Sr([je(),Gl(Sr([u_,P5,c_]))]),providerOptions:Ft.optional()}),V5=Yt({role:mt("assistant"),content:Sr([je(),Gl(Sr([u_,c_,j5,z5,d_,F5]))]),providerOptions:Ft.optional()}),H5=Yt({role:mt("tool"),content:Gl(Sr([d_,$5])),providerOptions:Ft.optional()});Sr([B5,U5,V5,H5]);function f_(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];if(i===void 0)continue;const o=r in e?e[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),a=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);s&&a?n[r]=f_(o,i):n[r]=i}return n}var W5={};D5(W5,{array:()=>K5,choice:()=>G5,json:()=>Y5,object:()=>J5,text:()=>Z5});function q5(e){const t=["ROOT"];let n=-1,r=null;function i(u,c,f){switch(u){case'"':{n=c,t.pop(),t.push(f),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(f),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(f),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(f),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(f),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(f),t.push("INSIDE_ARRAY_START");break}}}function o(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let u=0;u<e.length;u++){const c=e[u];switch(t[t.length-1]){case"ROOT":i(c,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(c,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(c,u);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=u;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=u,t.pop();break}default:{n=u,i(c,u,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(c,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=u;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const h=e.substring(r,u+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(c,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,u)):n=u;break}}}let a=e.slice(0,n+1);for(let u=t.length-1;u>=0;u--)switch(t[u]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const f=e.substring(r,e.length);"true".startsWith(f)?a+="true".slice(f.length):"false".startsWith(f)?a+="false".slice(f.length):"null".startsWith(f)&&(a+="null".slice(f.length))}}return a}async function td(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Ma({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Ma({text:q5(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Z5=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),J5=({schema:e,name:t,description:n})=>{const r=Ty(e);return{name:"object",responseFormat:gs(r.jsonSchema).then(i=>({type:"json",schema:i,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},o){const s=await Ma({text:i});if(!s.success)throw new Ns({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=await Ic({value:s.value,schema:r});if(!a.success)throw new Ns({message:"No object generated: response did not match schema.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});return a.value},async parsePartialOutput({text:i}){const o=await td(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},K5=({element:e,name:t,description:n})=>{const r=Ty(e);return{name:"array",responseFormat:gs(r.jsonSchema).then(i=>{const{$schema:o,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},o){const s=await Ma({text:i});if(!s.success)throw new Ns({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))throw new Ns({message:"No object generated: response did not match schema.",cause:new Ol({value:a,cause:"response must be an object with an elements array"}),text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const u of a.elements){const c=await Ic({value:u,schema:r});if(!c.success)throw new Ns({message:"No object generated: response did not match schema.",cause:c.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason})}return a.elements},async parsePartialOutput({text:i}){const o=await td(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=o.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const a=o.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,u=[];for(const c of a){const f=await Ic({value:c,schema:r});f.success&&u.push(f.value)}return{partial:u}}}},createElementStreamTransform(){let i=0;return new TransformStream({transform({partialOutput:o},s){if(o!=null)for(;i<o.length;i++)s.enqueue(o[i])}})}}},G5=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const o=await Ma({text:r});if(!o.success)throw new Ns({message:"No object generated: could not parse the response.",cause:o.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=o.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!e.includes(s.result))throw new Ns({message:"No object generated: response did not match schema.",cause:new Ol({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await td(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=i.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const s=e.filter(a=>a.startsWith(o.result));return i.state==="successful-parse"?s.includes(o.result)?{partial:o.result}:void 0:s.length===1?{partial:s[0]}:void 0}}},createElementStreamTransform(){}}),Y5=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},r){const i=await Ma({text:n});if(!i.success)throw new Ns({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await td(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});ed({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
78
-
79
- `)},flush(e){e.enqueue(`data: [DONE]
80
-
81
- `)}})}});var Q5=S5(()=>t_(Sr([un({type:mt("text-start"),id:je(),providerMetadata:Ft.optional()}),un({type:mt("text-delta"),id:je(),delta:je(),providerMetadata:Ft.optional()}),un({type:mt("text-end"),id:je(),providerMetadata:Ft.optional()}),un({type:mt("error"),errorText:je()}),un({type:mt("tool-input-start"),toolCallId:je(),toolName:je(),providerExecuted:vr().optional(),providerMetadata:Ft.optional(),dynamic:vr().optional(),title:je().optional()}),un({type:mt("tool-input-delta"),toolCallId:je(),inputTextDelta:je()}),un({type:mt("tool-input-available"),toolCallId:je(),toolName:je(),input:Xi(),providerExecuted:vr().optional(),providerMetadata:Ft.optional(),dynamic:vr().optional(),title:je().optional()}),un({type:mt("tool-input-error"),toolCallId:je(),toolName:je(),input:Xi(),providerExecuted:vr().optional(),providerMetadata:Ft.optional(),dynamic:vr().optional(),errorText:je(),title:je().optional()}),un({type:mt("tool-approval-request"),approvalId:je(),toolCallId:je()}),un({type:mt("tool-output-available"),toolCallId:je(),output:Xi(),providerExecuted:vr().optional(),dynamic:vr().optional(),preliminary:vr().optional()}),un({type:mt("tool-output-error"),toolCallId:je(),errorText:je(),providerExecuted:vr().optional(),dynamic:vr().optional()}),un({type:mt("tool-output-denied"),toolCallId:je()}),un({type:mt("reasoning-start"),id:je(),providerMetadata:Ft.optional()}),un({type:mt("reasoning-delta"),id:je(),delta:je(),providerMetadata:Ft.optional()}),un({type:mt("reasoning-end"),id:je(),providerMetadata:Ft.optional()}),un({type:mt("source-url"),sourceId:je(),url:je(),title:je().optional(),providerMetadata:Ft.optional()}),un({type:mt("source-document"),sourceId:je(),mediaType:je(),title:je(),filename:je().optional(),providerMetadata:Ft.optional()}),un({type:mt("file"),url:je(),mediaType:je(),providerMetadata:Ft.optional()}),un({type:WE(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:je().optional(),data:Xi(),transient:vr().optional()}),un({type:mt("start-step")}),un({type:mt("finish-step")}),un({type:mt("start"),messageId:je().optional(),messageMetadata:Xi().optional()}),un({type:mt("finish"),finishReason:UE(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Xi().optional()}),un({type:mt("abort"),reason:je().optional()}),un({type:mt("message-metadata"),messageMetadata:Xi()})])));function X5(e){return e.type.startsWith("data-")}function p1(e){return e.type.startsWith("tool-")}function eP(e){return e.type==="dynamic-tool"}function m1(e){return p1(e)||eP(e)}function Iw(e){return e.type.split("-").slice(1).join("-")}function tP({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function nP({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:o,onData:s}){return e.pipeThrough(new TransformStream({async transform(a,u){await r(async({state:c,write:f})=>{var h,m,g,x;function b(E){const N=c.message.parts.filter(m1).find(M=>M.toolCallId===E);if(N==null)throw new fl({chunkType:"tool-invocation",chunkId:E,message:`No tool invocation found for tool call ID "${E}".`});return N}function k(E){var I;const N=c.message.parts.find(O=>p1(O)&&O.toolCallId===E.toolCallId),M=E,j=N;N!=null?(N.state=E.state,j.input=M.input,j.output=M.output,j.errorText=M.errorText,j.rawInput=M.rawInput,j.preliminary=M.preliminary,E.title!==void 0&&(j.title=E.title),j.providerExecuted=(I=M.providerExecuted)!=null?I:N.providerExecuted,M.providerMetadata!=null&&(N.callProviderMetadata=M.providerMetadata)):c.message.parts.push({type:`tool-${E.toolName}`,toolCallId:E.toolCallId,state:E.state,title:E.title,input:M.input,output:M.output,rawInput:M.rawInput,errorText:M.errorText,providerExecuted:M.providerExecuted,preliminary:M.preliminary,...M.providerMetadata!=null?{callProviderMetadata:M.providerMetadata}:{}})}function C(E){var I,N;const M=c.message.parts.find(R=>R.type==="dynamic-tool"&&R.toolCallId===E.toolCallId),j=E,O=M;M!=null?(M.state=E.state,O.toolName=E.toolName,O.input=j.input,O.output=j.output,O.errorText=j.errorText,O.rawInput=(I=j.rawInput)!=null?I:O.rawInput,O.preliminary=j.preliminary,E.title!==void 0&&(O.title=E.title),O.providerExecuted=(N=j.providerExecuted)!=null?N:M.providerExecuted,j.providerMetadata!=null&&(M.callProviderMetadata=j.providerMetadata)):c.message.parts.push({type:"dynamic-tool",toolName:E.toolName,toolCallId:E.toolCallId,state:E.state,input:j.input,output:j.output,errorText:j.errorText,preliminary:j.preliminary,providerExecuted:j.providerExecuted,title:E.title,...j.providerMetadata!=null?{callProviderMetadata:j.providerMetadata}:{}})}async function _(E){if(E!=null){const I=c.message.metadata!=null?f_(c.message.metadata,E):E;t!=null&&await Mw({value:I,schema:t,context:{field:"message.metadata",entityId:c.message.id}}),c.message.metadata=I}}switch(a.type){case"text-start":{const E={type:"text",text:"",providerMetadata:a.providerMetadata,state:"streaming"};c.activeTextParts[a.id]=E,c.message.parts.push(E),f();break}case"text-delta":{const E=c.activeTextParts[a.id];if(E==null)throw new fl({chunkType:"text-delta",chunkId:a.id,message:`Received text-delta for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});E.text+=a.delta,E.providerMetadata=(h=a.providerMetadata)!=null?h:E.providerMetadata,f();break}case"text-end":{const E=c.activeTextParts[a.id];if(E==null)throw new fl({chunkType:"text-end",chunkId:a.id,message:`Received text-end for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});E.state="done",E.providerMetadata=(m=a.providerMetadata)!=null?m:E.providerMetadata,delete c.activeTextParts[a.id],f();break}case"reasoning-start":{const E={type:"reasoning",text:"",providerMetadata:a.providerMetadata,state:"streaming"};c.activeReasoningParts[a.id]=E,c.message.parts.push(E),f();break}case"reasoning-delta":{const E=c.activeReasoningParts[a.id];if(E==null)throw new fl({chunkType:"reasoning-delta",chunkId:a.id,message:`Received reasoning-delta for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});E.text+=a.delta,E.providerMetadata=(g=a.providerMetadata)!=null?g:E.providerMetadata,f();break}case"reasoning-end":{const E=c.activeReasoningParts[a.id];if(E==null)throw new fl({chunkType:"reasoning-end",chunkId:a.id,message:`Received reasoning-end for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});E.providerMetadata=(x=a.providerMetadata)!=null?x:E.providerMetadata,E.state="done",delete c.activeReasoningParts[a.id],f();break}case"file":{c.message.parts.push({type:"file",mediaType:a.mediaType,url:a.url}),f();break}case"source-url":{c.message.parts.push({type:"source-url",sourceId:a.sourceId,url:a.url,title:a.title,providerMetadata:a.providerMetadata}),f();break}case"source-document":{c.message.parts.push({type:"source-document",sourceId:a.sourceId,mediaType:a.mediaType,title:a.title,filename:a.filename,providerMetadata:a.providerMetadata}),f();break}case"tool-input-start":{const E=c.message.parts.filter(p1);c.partialToolCalls[a.toolCallId]={text:"",toolName:a.toolName,index:E.length,dynamic:a.dynamic,title:a.title},a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,providerMetadata:a.providerMetadata}):k({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,providerMetadata:a.providerMetadata}),f();break}case"tool-input-delta":{const E=c.partialToolCalls[a.toolCallId];if(E==null)throw new fl({chunkType:"tool-input-delta",chunkId:a.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${a.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});E.text+=a.inputTextDelta;const{value:I}=await td(E.text);E.dynamic?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"input-streaming",input:I,title:E.title}):k({toolCallId:a.toolCallId,toolName:E.toolName,state:"input-streaming",input:I,title:E.title}),f();break}case"tool-input-available":{a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title}):k({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title}),f(),o&&!a.providerExecuted&&await o({toolCall:a});break}case"tool-input-error":{a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata}):k({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:void 0,rawInput:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata}),f();break}case"tool-approval-request":{const E=b(a.toolCallId);E.state="approval-requested",E.approval={id:a.approvalId},f();break}case"tool-output-denied":{const E=b(a.toolCallId);E.state="output-denied",f();break}case"tool-output-available":{const E=b(a.toolCallId);E.type==="dynamic-tool"?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"output-available",input:E.input,output:a.output,preliminary:a.preliminary,providerExecuted:a.providerExecuted,title:E.title}):k({toolCallId:a.toolCallId,toolName:Iw(E),state:"output-available",input:E.input,output:a.output,providerExecuted:a.providerExecuted,preliminary:a.preliminary,title:E.title}),f();break}case"tool-output-error":{const E=b(a.toolCallId);E.type==="dynamic-tool"?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"output-error",input:E.input,errorText:a.errorText,providerExecuted:a.providerExecuted,title:E.title}):k({toolCallId:a.toolCallId,toolName:Iw(E),state:"output-error",input:E.input,rawInput:E.rawInput,errorText:a.errorText,providerExecuted:a.providerExecuted,title:E.title}),f();break}case"start-step":{c.message.parts.push({type:"step-start"});break}case"finish-step":{c.activeTextParts={},c.activeReasoningParts={};break}case"start":{a.messageId!=null&&(c.message.id=a.messageId),await _(a.messageMetadata),(a.messageId!=null||a.messageMetadata!=null)&&f();break}case"finish":{a.finishReason!=null&&(c.finishReason=a.finishReason),await _(a.messageMetadata),a.messageMetadata!=null&&f();break}case"message-metadata":{await _(a.messageMetadata),a.messageMetadata!=null&&f();break}case"error":{i==null||i(new Error(a.errorText));break}default:if(X5(a)){if((n==null?void 0:n[a.type])!=null){const N=c.message.parts.findIndex(j=>"id"in j&&"data"in j&&j.id===a.id&&j.type===a.type),M=N>=0?N:c.message.parts.length;await Mw({value:a.data,schema:n[a.type],context:{field:`message.parts[${M}].data`,entityName:a.type,entityId:a.id}})}const E=a;if(E.transient){s==null||s(E);break}const I=E.id!=null?c.message.parts.find(N=>E.type===N.type&&E.id===N.id):void 0;I!=null?I.data=E.data:c.message.parts.push(E),s==null||s(E),f()}}u.enqueue(a)})}}))}async function rP({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){t==null||t(r)}finally{n.releaseLock()}}ed({prefix:"aitxt",size:24});ed({prefix:"aiobj",size:24});var iP=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(r){n(r)}}),this.processQueue()})}};ed({prefix:"aiobj",size:24});async function oP(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((o,s)=>{const a=new FileReader;a.onload=u=>{var c;o((c=u.target)==null?void 0:c.result)},a.onerror=u=>s(u),a.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var sP=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:s}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:e,...t}){var n,r,i,o,s;const a=await gs(this.body),u=await gs(this.headers),c=await gs(this.credentials),f={...ma(u),...ma(t.headers)},h=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...a,...t.body},headers:f,credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),m=(r=h==null?void 0:h.api)!=null?r:this.api,g=(h==null?void 0:h.headers)!==void 0?ma(h.headers):f,x=(h==null?void 0:h.body)!==void 0?h.body:{...a,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},b=(i=h==null?void 0:h.credentials)!=null?i:c,C=await((o=this.fetch)!=null?o:globalThis.fetch)(m,{method:"POST",headers:Ew({"Content-Type":"application/json",...g},`ai-sdk/${Nw}`,Sw()),body:JSON.stringify(x),credentials:b,signal:e});if(!C.ok)throw new Error((s=await C.text())!=null?s:"Failed to fetch the chat response.");if(!C.body)throw new Error("The response body is empty.");return this.processResponseStream(C.body)}async reconnectToStream(e){var t,n,r,i,o;const s=await gs(this.body),a=await gs(this.headers),u=await gs(this.credentials),c={...ma(a),...ma(e.headers)},f=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:c,credentials:u,requestMetadata:e.metadata})),h=(n=f==null?void 0:f.api)!=null?n:`${this.api}/${e.chatId}/stream`,m=(f==null?void 0:f.headers)!==void 0?ma(f.headers):c,g=(r=f==null?void 0:f.credentials)!=null?r:u,b=await((i=this.fetch)!=null?i:globalThis.fetch)(h,{method:"GET",headers:Ew(m,`ai-sdk/${Nw}`,Sw()),credentials:g});if(b.status===204)return null;if(!b.ok)throw new Error((o=await b.text())!=null?o:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}},h_=class extends sP{constructor(e={}){super(e)}processResponseStream(e){return N5({stream:e,schema:Q5}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},aP=class{constructor({generateId:e=OR,id:t=e(),transport:n=new h_,messageMetadataSchema:r,dataPartSchemas:i,state:o,onError:s,onToolCall:a,onFinish:u,onData:c,sendAutomaticallyWhen:f}){this.activeResponse=void 0,this.jobExecutor=new iP,this.sendMessage=async(h,m)=>{var g,x,b,k;if(h==null){await this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m});return}let C;if("text"in h||"files"in h?C={parts:[...Array.isArray(h.files)?h.files:await oP(h.files),..."text"in h&&h.text!=null?[{type:"text",text:h.text}]:[]]}:C=h,h.messageId!=null){const _=this.state.messages.findIndex(E=>E.id===h.messageId);if(_===-1)throw new Error(`message with id ${h.messageId} not found`);if(this.state.messages[_].role!=="user")throw new Error(`message with id ${h.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,_+1),this.state.replaceMessage(_,{...C,id:h.messageId,role:(x=C.role)!=null?x:"user",metadata:h.metadata})}else this.state.pushMessage({...C,id:(b=C.id)!=null?b:this.generateId(),role:(k=C.role)!=null?k:"user",metadata:h.metadata});await this.makeRequest({trigger:"submit-message",messageId:h.messageId,...m})},this.regenerate=async({messageId:h,...m}={})=>{const g=h==null?this.state.messages.length-1:this.state.messages.findIndex(x=>x.id===h);if(g===-1)throw new Error(`message ${h} not found`);this.state.messages=this.state.messages.slice(0,this.messages[g].role==="assistant"?g:g+1),await this.makeRequest({trigger:"regenerate-message",messageId:h,...m})},this.resumeStream=async(h={})=>{await this.makeRequest({trigger:"resume-stream",...h})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:h,approved:m,reason:g})=>this.jobExecutor.run(async()=>{const x=this.state.messages,b=x[x.length-1],k=C=>m1(C)&&C.state==="approval-requested"&&C.approval.id===h?{...C,state:"approval-responded",approval:{id:h,approved:m,reason:g}}:C;this.state.replaceMessage(x.length-1,{...b,parts:b.parts.map(k)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(k)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(C=>{var _;C&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})})}),this.addToolOutput=async({state:h="output-available",tool:m,toolCallId:g,output:x,errorText:b})=>this.jobExecutor.run(async()=>{const k=this.state.messages,C=k[k.length-1],_=E=>m1(E)&&E.toolCallId===g?{...E,state:h,output:x,errorText:b}:E;this.state.replaceMessage(k.length-1,{...C,parts:C.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(E=>{var I;E&&this.makeRequest({trigger:"submit-message",messageId:(I=this.lastMessage)==null?void 0:I.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var h;this.status!=="streaming"&&this.status!=="submitted"||(h=this.activeResponse)!=null&&h.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=o,this.onError=s,this.onToolCall=a,this.onFinish=u,this.onData=c,this.sendAutomaticallyWhen=f}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var o,s,a;let u;if(e==="resume-stream")try{const g=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(g==null)return;u=g}catch(g){this.onError&&g instanceof Error&&this.onError(g),this.setStatus({status:"error",error:g});return}this.setStatus({status:"submitted",error:void 0});const c=this.lastMessage;let f=!1,h=!1,m=!1;try{const g={state:tP({lastMessage:this.state.snapshot(c),messageId:this.generateId()}),abortController:new AbortController};g.abortController.signal.addEventListener("abort",()=>{f=!0}),this.activeResponse=g;let x;e==="resume-stream"?x=u:x=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:g.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const b=k=>this.jobExecutor.run(()=>k({state:g.state,write:()=>{var C;this.setStatus({status:"streaming"}),g.state.message.id===((C=this.lastMessage)==null?void 0:C.id)?this.state.replaceMessage(this.state.messages.length-1,g.state.message):this.state.pushMessage(g.state.message)}}));await rP({stream:nP({stream:x,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:b,onError:k=>{throw k}}),onError:k=>{throw k}}),this.setStatus({status:"ready"})}catch(g){if(f||g.name==="AbortError")return f=!0,this.setStatus({status:"ready"}),null;m=!0,g instanceof TypeError&&(g.message.toLowerCase().includes("fetch")||g.message.toLowerCase().includes("network"))&&(h=!0),this.onError&&g instanceof Error&&this.onError(g),this.setStatus({status:"error",error:g})}finally{try{(s=this.onFinish)==null||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:f,isDisconnect:h,isError:m,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(g){console.error(g)}this.activeResponse=void 0}!m&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(a=this.lastMessage)==null?void 0:a.id,metadata:t,headers:n,body:r})}},F0,Dw;function lP(){if(Dw)return F0;Dw=1;function e(t,n){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let r,i=0;return function(...s){clearTimeout(r);const a=Date.now(),u=a-i,c=n-u;c<=0?(i=a,t.apply(this,s)):r=setTimeout(()=>{i=Date.now(),t.apply(this,s)},c)}}return F0=e,F0}var uP=lP();const cP=ja(uP);var $0={exports:{}},B0={};/**
82
- * @license React
83
- * use-sync-external-store-shim.production.js
84
- *
85
- * Copyright (c) Meta Platforms, Inc. and affiliates.
86
- *
87
- * This source code is licensed under the MIT license found in the
88
- * LICENSE file in the root directory of this source tree.
89
- */var Ow;function dP(){if(Ow)return B0;Ow=1;var e=Yc();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,m){var g=m(),x=r({inst:{value:g,getSnapshot:m}}),b=x[0].inst,k=x[1];return o(function(){b.value=g,b.getSnapshot=m,u(b)&&k({inst:b})},[h,g,m]),i(function(){return u(b)&&k({inst:b}),h(function(){u(b)&&k({inst:b})})},[h]),s(g),g}function u(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!n(h,g)}catch{return!0}}function c(h,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return B0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,B0}var Rw;function p_(){return Rw||(Rw=1,$0.exports=dP()),$0.exports}var Ay=p_(),m_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},cn=(e,t,n)=>(m_(e,t,"read from private field"),n?n.call(e):t.get(e)),Ji=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},hs=(e,t,n,r)=>(m_(e,t,"write to private field"),t.set(e,n),n);function fP(e,t){return t!=null?cP(e,t):e}var gi,Kf,Gf,Ku,Gu,Yu,kl,g1,y1,hP=class{constructor(e=[]){Ji(this,gi,void 0),Ji(this,Kf,"ready"),Ji(this,Gf,void 0),Ji(this,Ku,new Set),Ji(this,Gu,new Set),Ji(this,Yu,new Set),this.pushMessage=t=>{hs(this,gi,cn(this,gi).concat(t)),cn(this,kl).call(this)},this.popMessage=()=>{hs(this,gi,cn(this,gi).slice(0,-1)),cn(this,kl).call(this)},this.replaceMessage=(t,n)=>{hs(this,gi,[...cn(this,gi).slice(0,t),this.snapshot(n),...cn(this,gi).slice(t+1)]),cn(this,kl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,n)=>{const r=n?fP(t,n):t;return cn(this,Ku).add(r),()=>{cn(this,Ku).delete(r)}},this["~registerStatusCallback"]=t=>(cn(this,Gu).add(t),()=>{cn(this,Gu).delete(t)}),this["~registerErrorCallback"]=t=>(cn(this,Yu).add(t),()=>{cn(this,Yu).delete(t)}),Ji(this,kl,()=>{cn(this,Ku).forEach(t=>t())}),Ji(this,g1,()=>{cn(this,Gu).forEach(t=>t())}),Ji(this,y1,()=>{cn(this,Yu).forEach(t=>t())}),hs(this,gi,e)}get status(){return cn(this,Kf)}set status(e){hs(this,Kf,e),cn(this,g1).call(this)}get error(){return cn(this,Gf)}set error(e){hs(this,Gf,e),cn(this,y1).call(this)}get messages(){return cn(this,gi)}set messages(e){hs(this,gi,[...e]),cn(this,kl).call(this)}};gi=new WeakMap;Kf=new WeakMap;Gf=new WeakMap;Ku=new WeakMap;Gu=new WeakMap;Yu=new WeakMap;kl=new WeakMap;g1=new WeakMap;y1=new WeakMap;var wl,Pw=class extends aP{constructor({messages:e,...t}){const n=new hP(e);super({...t,state:n}),Ji(this,wl,void 0),this["~registerMessagesCallback"]=(r,i)=>cn(this,wl)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>cn(this,wl)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>cn(this,wl)["~registerErrorCallback"](r),hs(this,wl,n)}};wl=new WeakMap;function pP({experimental_throttle:e,resume:t=!1,...n}={}){const r=T.useRef("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const i={...n,onToolCall:m=>{var g,x;return(x=(g=r.current).onToolCall)==null?void 0:x.call(g,m)},onData:m=>{var g,x;return(x=(g=r.current).onData)==null?void 0:x.call(g,m)},onFinish:m=>{var g,x;return(x=(g=r.current).onFinish)==null?void 0:x.call(g,m)},onError:m=>{var g,x;return(x=(g=r.current).onError)==null?void 0:x.call(g,m)},sendAutomaticallyWhen:m=>{var g,x,b;return(b=(x=(g=r.current).sendAutomaticallyWhen)==null?void 0:x.call(g,m))!=null?b:!1}},o=T.useRef("chat"in n?n.chat:new Pw(i));("chat"in n&&n.chat!==o.current||"id"in n&&o.current.id!==n.id)&&(o.current="chat"in n?n.chat:new Pw(i));const a=T.useCallback(m=>o.current["~registerMessagesCallback"](m,e),[e,o.current.id]),u=T.useSyncExternalStore(a,()=>o.current.messages,()=>o.current.messages),c=T.useSyncExternalStore(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),f=T.useSyncExternalStore(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),h=T.useCallback(m=>{typeof m=="function"&&(m=m(o.current.messages)),o.current.messages=m},[o]);return T.useEffect(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:u,setMessages:h,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:f,resumeStream:o.current.resumeStream,status:c,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}/**
90
- * @license lucide-react v0.511.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const mP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),jw=e=>{const t=gP(e);return t.charAt(0).toUpperCase()+t.slice(1)},g_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),yP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
95
- * @license lucide-react v0.511.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */var xP={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
100
- * @license lucide-react v0.511.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const bP=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},u)=>T.createElement("svg",{ref:u,...xP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:g_("lucide",i),...!o&&!yP(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,f])=>T.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
105
- * @license lucide-react v0.511.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const gn=(e,t)=>{const n=T.forwardRef(({className:r,...i},o)=>T.createElement(bP,{ref:o,iconNode:t,className:g_(`lucide-${mP(jw(e))}`,`lucide-${e}`,r),...i}));return n.displayName=jw(e),n};/**
110
- * @license lucide-react v0.511.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const vP=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],kP=gn("brain",vP);/**
115
- * @license lucide-react v0.511.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const wP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],CP=gn("check",wP);/**
120
- * @license lucide-react v0.511.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const SP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Oc=gn("chevron-down",SP);/**
125
- * @license lucide-react v0.511.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const EP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_P=gn("chevron-right",EP);/**
130
- * @license lucide-react v0.511.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const TP=[["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"}]],Fs=gn("circle-alert",TP);/**
135
- * @license lucide-react v0.511.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const AP=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],MP=gn("cloud",AP);/**
140
- * @license lucide-react v0.511.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const NP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],x1=gn("code",NP);/**
145
- * @license lucide-react v0.511.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const IP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],y_=gn("eye",IP);/**
150
- * @license lucide-react v0.511.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const DP=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],OP=gn("file-code",DP);/**
155
- * @license lucide-react v0.511.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const RP=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],zw=gn("file-image",RP);/**
160
- * @license lucide-react v0.511.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const PP=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]],jP=gn("file-video",PP);/**
165
- * @license lucide-react v0.511.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const zP=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],LP=gn("file",zP);/**
170
- * @license lucide-react v0.511.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const FP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],$P=gn("folder-tree",FP);/**
175
- * @license lucide-react v0.511.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const BP=[["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"}]],UP=gn("folder",BP);/**
180
- * @license lucide-react v0.511.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const VP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ei=gn("loader-circle",VP);/**
185
- * @license lucide-react v0.511.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const HP=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],WP=gn("message-square",HP);/**
190
- * @license lucide-react v0.511.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const qP=[["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"}]],x_=gn("pencil",qP);/**
195
- * @license lucide-react v0.511.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const ZP=[["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"}]],b_=gn("rotate-ccw",ZP);/**
200
- * @license lucide-react v0.511.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const JP=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],KP=gn("save",JP);/**
205
- * @license lucide-react v0.511.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const GP=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],v_=gn("send",GP);/**
210
- * @license lucide-react v0.511.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const YP=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],QP=gn("server",YP);/**
215
- * @license lucide-react v0.511.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const XP=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],e9=gn("upload",XP);/**
220
- * @license lucide-react v0.511.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const t9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],n9=gn("x",t9);/**
225
- * @license lucide-react v0.511.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const r9=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],i9=gn("wrench",r9);function Lw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function My(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Lw(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Lw(e[i],null)}}}}function Vs(...e){return T.useCallback(My(...e),e)}var o9=Symbol.for("react.lazy"),mh=yy[" use ".trim().toString()];function s9(e){return typeof e=="object"&&e!==null&&"then"in e}function k_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===o9&&"_payload"in e&&s9(e._payload)}function w_(e){const t=l9(e),n=T.forwardRef((r,i)=>{let{children:o,...s}=r;k_(o)&&typeof mh=="function"&&(o=mh(o._payload));const a=T.Children.toArray(o),u=a.find(c9);if(u){const c=u.props.children,f=a.map(h=>h===u?T.Children.count(c)>1?T.Children.only(null):T.isValidElement(c)?c.props.children:null:h);return v.jsx(t,{...s,ref:i,children:T.isValidElement(c)?T.cloneElement(c,void 0,f):null})}return v.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var a9=w_("Slot");function l9(e){const t=T.forwardRef((n,r)=>{let{children:i,...o}=n;if(k_(i)&&typeof mh=="function"&&(i=mh(i._payload)),T.isValidElement(i)){const s=f9(i),a=d9(o,i.props);return i.type!==T.Fragment&&(a.ref=r?My(r,s):s),T.cloneElement(i,a)}return T.Children.count(i)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u9=Symbol("radix.slottable");function c9(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u9}function d9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function f9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function C_(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=C_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function S_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=C_(e))&&(r&&(r+=" "),r+=t);return r}const Fw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$w=S_,E_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return $w(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],h=o==null?void 0:o[c];if(f===null)return null;const m=Fw(f)||Fw(h);return i[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[h,m]=f;return m===void 0||(c[h]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:h,className:m,...g}=f;return Object.entries(g).every(x=>{let[b,k]=x;return Array.isArray(k)?k.includes({...o,...a}[b]):{...o,...a}[b]===k})?[...c,h,m]:c},[]);return $w(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},h9=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},p9=(e,t)=>({classGroupId:e,validator:t}),__=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gh="-",Bw=[],m9="arbitrary..",g9=e=>{const t=x9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return y9(s);const a=s.split(gh),u=a[0]===""&&a.length>1?1:0;return T_(a,u,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const u=r[s],c=n[s];return u?c?h9(c,u):u:c||Bw}return n[s]||Bw}}},T_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const c=T_(e,t+1,o);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(gh):e.slice(t).join(gh),u=s.length;for(let c=0;c<u;c++){const f=s[c];if(f.validator(a))return f.classGroupId}},y9=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?m9+r:void 0})(),x9=e=>{const{theme:t,classGroups:n}=e;return b9(n,t)},b9=(e,t)=>{const n=__();for(const r in e){const i=e[r];Ny(i,n,r,t)}return n},Ny=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const s=e[o];v9(s,t,n,r)}},v9=(e,t,n,r)=>{if(typeof e=="string"){k9(e,t,n);return}if(typeof e=="function"){w9(e,t,n,r);return}C9(e,t,n,r)},k9=(e,t,n)=>{const r=e===""?t:A_(t,e);r.classGroupId=n},w9=(e,t,n,r)=>{if(S9(e)){Ny(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(p9(n,e))},C9=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){const[a,u]=i[s];Ny(u,A_(t,a),n,r)}},A_=(e,t)=>{let n=e;const r=t.split(gh),i=r.length;for(let o=0;o<i;o++){const s=r[o];let a=n.nextPart.get(s);a||(a=__(),n.nextPart.set(s,a)),n=a}return n},S9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,E9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,s)=>{n[o]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=r[o])!==void 0)return i(o,s),s},set(o,s){o in n?n[o]=s:i(o,s)}}},b1="!",Uw=":",_9=[],Vw=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),T9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,u=0,c;const f=i.length;for(let b=0;b<f;b++){const k=i[b];if(s===0&&a===0){if(k===Uw){o.push(i.slice(u,b)),u=b+1;continue}if(k==="/"){c=b;continue}}k==="["?s++:k==="]"?s--:k==="("?a++:k===")"&&a--}const h=o.length===0?i:i.slice(u);let m=h,g=!1;h.endsWith(b1)?(m=h.slice(0,-1),g=!0):h.startsWith(b1)&&(m=h.slice(1),g=!0);const x=c&&c>u?c-u:void 0;return Vw(o,g,m,x)};if(t){const i=t+Uw,o=r;r=s=>s.startsWith(i)?o(s.slice(i.length)):Vw(_9,!1,s,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},A9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const s=n[o],a=s[0]==="[",u=t.has(s);a||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},M9=e=>({cache:E9(e.cacheSize),parseClassName:T9(e),sortModifiers:A9(e),...g9(e)}),N9=/\s+/,I9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(N9);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:b}=n(f);if(h){u=f+(u.length>0?" "+u:u);continue}let k=!!b,C=r(k?x.substring(0,b):x);if(!C){if(!k){u=f+(u.length>0?" "+u:u);continue}if(C=r(x),!C){u=f+(u.length>0?" "+u:u);continue}k=!1}const _=m.length===0?"":m.length===1?m[0]:o(m).join(":"),E=g?_+b1:_,I=E+C;if(s.indexOf(I)>-1)continue;s.push(I);const N=i(C,k);for(let M=0;M<N.length;++M){const j=N[M];s.push(E+j)}u=f+(u.length>0?" "+u:u)}return u},D9=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=M_(n))&&(i&&(i+=" "),i+=r);return i},M_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=M_(e[r]))&&(n&&(n+=" "),n+=t);return n},O9=(e,...t)=>{let n,r,i,o;const s=u=>{const c=t.reduce((f,h)=>h(f),e());return n=M9(c),r=n.cache.get,i=n.cache.set,o=a,a(u)},a=u=>{const c=r(u);if(c)return c;const f=I9(u,n);return i(u,f),f};return o=s,(...u)=>o(D9(...u))},R9=[],Bn=e=>{const t=n=>n[e]||R9;return t.isThemeGetter=!0,t},N_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,P9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,j9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z9=/\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$/,L9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,us=e=>P9.test(e),It=e=>!!e&&!Number.isNaN(Number(e)),cs=e=>!!e&&Number.isInteger(Number(e)),U0=e=>e.endsWith("%")&&It(e.slice(0,-1)),_o=e=>j9.test(e),D_=()=>!0,B9=e=>z9.test(e)&&!L9.test(e),Iy=()=>!1,U9=e=>F9.test(e),V9=e=>$9.test(e),H9=e=>!Xe(e)&&!nt(e),W9=e=>Hs(e,P_,Iy),Xe=e=>N_.test(e),fa=e=>Hs(e,j_,B9),Hw=e=>Hs(e,X9,It),q9=e=>Hs(e,L_,D_),Z9=e=>Hs(e,z_,Iy),Ww=e=>Hs(e,O_,Iy),J9=e=>Hs(e,R_,V9),Sf=e=>Hs(e,F_,U9),nt=e=>I_.test(e),zu=e=>Fa(e,j_),K9=e=>Fa(e,z_),qw=e=>Fa(e,O_),G9=e=>Fa(e,P_),Y9=e=>Fa(e,R_),Ef=e=>Fa(e,F_,!0),Q9=e=>Fa(e,L_,!0),Hs=(e,t,n)=>{const r=N_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fa=(e,t,n=!1)=>{const r=I_.exec(e);return r?r[1]?t(r[1]):n:!1},O_=e=>e==="position"||e==="percentage",R_=e=>e==="image"||e==="url",P_=e=>e==="length"||e==="size"||e==="bg-size",j_=e=>e==="length",X9=e=>e==="number",z_=e=>e==="family-name",L_=e=>e==="number"||e==="weight",F_=e=>e==="shadow",ej=()=>{const e=Bn("color"),t=Bn("font"),n=Bn("text"),r=Bn("font-weight"),i=Bn("tracking"),o=Bn("leading"),s=Bn("breakpoint"),a=Bn("container"),u=Bn("spacing"),c=Bn("radius"),f=Bn("shadow"),h=Bn("inset-shadow"),m=Bn("text-shadow"),g=Bn("drop-shadow"),x=Bn("blur"),b=Bn("perspective"),k=Bn("aspect"),C=Bn("ease"),_=Bn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...I(),nt,Xe],M=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],O=()=>[nt,Xe,u],R=()=>[us,"full","auto",...O()],F=()=>[cs,"none","subgrid",nt,Xe],ee=()=>["auto",{span:["full",cs,nt,Xe]},cs,nt,Xe],X=()=>[cs,"auto",nt,Xe],Se=()=>["auto","min","max","fr",nt,Xe],ue=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...O()],he=()=>[us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],te=()=>[us,"screen","full","dvw","lvw","svw","min","max","fit",...O()],Me=()=>[us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],D=()=>[e,nt,Xe],W=()=>[...I(),qw,Ww,{position:[nt,Xe]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",G9,W9,{size:[nt,Xe]}],tt=()=>[U0,zu,fa],U=()=>["","none","full",c,nt,Xe],ke=()=>["",It,zu,fa],_e=()=>["solid","dashed","dotted","double"],Pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[It,U0,qw,Ww],$e=()=>["","none",x,nt,Xe],xt=()=>["none",It,nt,Xe],on=()=>["none",It,nt,Xe],Yn=()=>[It,nt,Xe],Qn=()=>[us,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_o],breakpoint:[_o],color:[D_],container:[_o],"drop-shadow":[_o],ease:["in","out","in-out"],font:[H9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_o],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_o],shadow:[_o],spacing:["px",It],text:[_o],"text-shadow":[_o],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",us,Xe,nt,k]}],container:["container"],columns:[{columns:[It,Xe,nt,a]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[cs,"auto",nt,Xe]}],basis:[{basis:[us,"full","auto",a,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[It,us,"auto","initial","none",Xe]}],grow:[{grow:["",It,nt,Xe]}],shrink:[{shrink:["",It,nt,Xe]}],order:[{order:[cs,"first","last","none",nt,Xe]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ue(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...ue()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":ue()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:he()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...Me()]}],"min-block-size":[{"min-block":["auto",...Me()]}],"max-block-size":[{"max-block":["none",...Me()]}],w:[{w:[a,"screen",...he()]}],"min-w":[{"min-w":[a,"screen","none",...he()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...he()]}],h:[{h:["screen","lh",...he()]}],"min-h":[{"min-h":["screen","lh","none",...he()]}],"max-h":[{"max-h":["screen","lh",...he()]}],"font-size":[{text:["base",n,zu,fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Q9,q9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",U0,Xe]}],"font-family":[{font:[K9,Z9,t]}],"font-features":[{"font-features":[Xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,nt,Xe]}],"line-clamp":[{"line-clamp":[It,"none",nt,Hw]}],leading:[{leading:[o,...O()]}],"list-image":[{"list-image":["none",nt,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",nt,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[It,"from-font","auto",nt,fa]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[It,"auto",nt,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt,Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",nt,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cs,nt,Xe],radial:["",nt,Xe],conic:[cs,nt,Xe]},Y9,J9]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:tt()}],"gradient-via-pos":[{via:tt()}],"gradient-to-pos":[{to:tt()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:ke()}],"border-w-x":[{"border-x":ke()}],"border-w-y":[{"border-y":ke()}],"border-w-s":[{"border-s":ke()}],"border-w-e":[{"border-e":ke()}],"border-w-bs":[{"border-bs":ke()}],"border-w-be":[{"border-be":ke()}],"border-w-t":[{"border-t":ke()}],"border-w-r":[{"border-r":ke()}],"border-w-b":[{"border-b":ke()}],"border-w-l":[{"border-l":ke()}],"divide-x":[{"divide-x":ke()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ke()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[It,nt,Xe]}],"outline-w":[{outline:["",It,zu,fa]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",f,Ef,Sf]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",h,Ef,Sf]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[It,fa]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ke()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",m,Ef,Sf]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[It,nt,Xe]}],"mix-blend":[{"mix-blend":[...Pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[It]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[nt,Xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[It]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",nt,Xe]}],filter:[{filter:["","none",nt,Xe]}],blur:[{blur:$e()}],brightness:[{brightness:[It,nt,Xe]}],contrast:[{contrast:[It,nt,Xe]}],"drop-shadow":[{"drop-shadow":["","none",g,Ef,Sf]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",It,nt,Xe]}],"hue-rotate":[{"hue-rotate":[It,nt,Xe]}],invert:[{invert:["",It,nt,Xe]}],saturate:[{saturate:[It,nt,Xe]}],sepia:[{sepia:["",It,nt,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",nt,Xe]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[It,nt,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[It,nt,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",It,nt,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[It,nt,Xe]}],"backdrop-invert":[{"backdrop-invert":["",It,nt,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[It,nt,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[It,nt,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",It,nt,Xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",nt,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[It,"initial",nt,Xe]}],ease:[{ease:["linear","initial",C,nt,Xe]}],delay:[{delay:[It,nt,Xe]}],animate:[{animate:["none",_,nt,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,nt,Xe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:on()}],"scale-x":[{"scale-x":on()}],"scale-y":[{"scale-y":on()}],"scale-z":[{"scale-z":on()}],"scale-3d":["scale-3d"],skew:[{skew:Yn()}],"skew-x":[{"skew-x":Yn()}],"skew-y":[{"skew-y":Yn()}],transform:[{transform:[nt,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qn()}],"translate-x":[{"translate-x":Qn()}],"translate-y":[{"translate-y":Qn()}],"translate-z":[{"translate-z":Qn()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",nt,Xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",nt,Xe]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[It,zu,fa,Hw]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tj=O9(ej);function oi(...e){return tj(S_(e))}const nj=E_("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$_=T.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?a9:"button";return v.jsx(s,{className:oi(nj({variant:t,size:n,className:e})),ref:o,...i})});$_.displayName="Button";var Dy=sE();const rj=ja(Dy);function ij(e){const t=oj(e),n=T.forwardRef((r,i)=>{const{children:o,...s}=r,a=T.Children.toArray(o),u=a.find(aj);if(u){const c=u.props.children,f=a.map(h=>h===u?T.Children.count(c)>1?T.Children.only(null):T.isValidElement(c)?c.props.children:null:h);return v.jsx(t,{...s,ref:i,children:T.isValidElement(c)?T.cloneElement(c,void 0,f):null})}return v.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function oj(e){const t=T.forwardRef((n,r)=>{const{children:i,...o}=n;if(T.isValidElement(i)){const s=uj(i),a=lj(o,i.props);return i.type!==T.Fragment&&(a.ref=r?My(r,s):s),T.cloneElement(i,a)}return T.Children.count(i)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sj=Symbol("radix.slottable");function aj(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sj}function lj(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function uj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ws=cj.reduce((e,t)=>{const n=ij(`Primitive.${t}`),r=T.forwardRef((i,o)=>{const{asChild:s,...a}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fo=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{};function dj(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var Yl=e=>{const{present:t,children:n}=e,r=fj(t),i=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),o=Vs(r.ref,hj(i));return typeof n=="function"||r.isPresent?T.cloneElement(i,{ref:o}):null};Yl.displayName="Presence";function fj(e){const[t,n]=T.useState(),r=T.useRef(null),i=T.useRef(e),o=T.useRef("none"),s=e?"mounted":"unmounted",[a,u]=dj(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=_f(r.current);o.current=a==="mounted"?c:"none"},[a]),Fo(()=>{const c=r.current,f=i.current;if(f!==e){const m=o.current,g=_f(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Fo(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,h=g=>{const b=_f(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(u("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},m=g=>{g.target===t&&(o.current=_f(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:T.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function _f(e){return(e==null?void 0:e.animationName)||"none"}function hj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function B_(e,t=[]){let n=[];function r(o,s){const a=T.createContext(s),u=n.length;n=[...n,s];const c=h=>{var C;const{scope:m,children:g,...x}=h,b=((C=m==null?void 0:m[e])==null?void 0:C[u])||a,k=T.useMemo(()=>x,Object.values(x));return v.jsx(b.Provider,{value:k,children:g})};c.displayName=o+"Provider";function f(h,m){var b;const g=((b=m==null?void 0:m[e])==null?void 0:b[u])||a,x=T.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>T.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return T.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,pj(i,...t)]}function pj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ks(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var mj=T.createContext(void 0);function gj(e){const t=T.useContext(mj);return e||t||"ltr"}function yj(e,[t,n]){return Math.min(n,Math.max(t,e))}function Is(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function xj(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var Oy="ScrollArea",[U_]=B_(Oy),[bj,Si]=U_(Oy),V_=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=T.useState(null),[c,f]=T.useState(null),[h,m]=T.useState(null),[g,x]=T.useState(null),[b,k]=T.useState(null),[C,_]=T.useState(0),[E,I]=T.useState(0),[N,M]=T.useState(!1),[j,O]=T.useState(!1),R=Vs(t,ee=>u(ee)),F=gj(i);return v.jsx(bj,{scope:n,type:r,dir:F,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:h,onContentChange:m,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:k,scrollbarYEnabled:j,onScrollbarYEnabledChange:O,onCornerWidthChange:_,onCornerHeightChange:I,children:v.jsx(Ws.div,{dir:F,...s,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});V_.displayName=Oy;var H_="ScrollAreaViewport",W_=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=Si(H_,n),a=T.useRef(null),u=Vs(t,a,s.onViewportChange);return v.jsxs(v.Fragment,{children:[v.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:i}),v.jsx(Ws.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:v.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});W_.displayName=H_;var ao="ScrollAreaScrollbar",Ry=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Si(ao,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return T.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?v.jsx(vj,{...r,ref:t,forceMount:n}):i.type==="scroll"?v.jsx(kj,{...r,ref:t,forceMount:n}):i.type==="auto"?v.jsx(q_,{...r,ref:t,forceMount:n}):i.type==="always"?v.jsx(Py,{...r,ref:t}):null});Ry.displayName=ao;var vj=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Si(ao,e.__scopeScrollArea),[o,s]=T.useState(!1);return T.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const c=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),v.jsx(Yl,{present:n||o,children:v.jsx(q_,{"data-state":o?"visible":"hidden",...r,ref:t})})}),kj=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Si(ao,e.__scopeScrollArea),o=e.orientation==="horizontal",s=_p(()=>u("SCROLL_END"),100),[a,u]=xj("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 T.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,u]),T.useEffect(()=>{const c=i.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const m=()=>{const g=c[f];h!==g&&(u("SCROLL"),s()),h=g};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[i.viewport,o,u,s]),v.jsx(Yl,{present:n||a!=="hidden",children:v.jsx(Py,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Is(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Is(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),q_=T.forwardRef((e,t)=>{const n=Si(ao,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=T.useState(!1),a=e.orientation==="horizontal",u=_p(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:f)}},10);return Ll(n.viewport,u),Ll(n.content,u),v.jsx(Yl,{present:r||o,children:v.jsx(Py,{"data-state":o?"visible":"hidden",...i,ref:t})})}),Py=T.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Si(ao,e.__scopeScrollArea),o=T.useRef(null),s=T.useRef(0),[a,u]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Y_(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,g){return Tj(m,s.current,a,g)}return n==="horizontal"?v.jsx(wj,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=Zw(m,a,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,i.dir))}}):n==="vertical"?v.jsx(Cj,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=Zw(m,a);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),wj=T.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Si(ao,e.__scopeScrollArea),[s,a]=T.useState(),u=T.useRef(null),c=Vs(t,u,o.onScrollbarXChange);return T.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(J_,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ep(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const m=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),X_(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:xh(s.paddingLeft),paddingEnd:xh(s.paddingRight)}})}})}),Cj=T.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Si(ao,e.__scopeScrollArea),[s,a]=T.useState(),u=T.useRef(null),c=Vs(t,u,o.onScrollbarYChange);return T.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(J_,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ep(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const m=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),X_(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:xh(s.paddingTop),paddingEnd:xh(s.paddingBottom)}})}})}),[Sj,Z_]=U_(ao),J_=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:f,onResize:h,...m}=e,g=Si(ao,n),[x,b]=T.useState(null),k=Vs(t,R=>b(R)),C=T.useRef(null),_=T.useRef(""),E=g.viewport,I=r.content-r.viewport,N=ks(f),M=ks(u),j=_p(h,10);function O(R){if(C.current){const F=R.clientX-C.current.left,ee=R.clientY-C.current.top;c({x:F,y:ee})}}return T.useEffect(()=>{const R=F=>{const ee=F.target;(x==null?void 0:x.contains(ee))&&N(F,I)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[E,x,I,N]),T.useEffect(M,[r,M]),Ll(x,j),Ll(g.content,j),v.jsx(Sj,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:ks(o),onThumbPointerUp:ks(s),onThumbPositionChange:M,onThumbPointerDown:ks(a),children:v.jsx(Ws.div,{...m,ref:k,style:{position:"absolute",...m.style},onPointerDown:Is(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),C.current=x.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),O(R))}),onPointerMove:Is(e.onPointerMove,O),onPointerUp:Is(e.onPointerUp,R=>{const F=R.target;F.hasPointerCapture(R.pointerId)&&F.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),yh="ScrollAreaThumb",K_=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Z_(yh,e.__scopeScrollArea);return v.jsx(Yl,{present:n||i.hasThumb,children:v.jsx(Ej,{ref:t,...r})})}),Ej=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Si(yh,n),s=Z_(yh,n),{onThumbPositionChange:a}=s,u=Vs(t,h=>s.onThumbChange(h)),c=T.useRef(void 0),f=_p(()=>{c.current&&(c.current(),c.current=void 0)},100);return T.useEffect(()=>{const h=o.viewport;if(h){const m=()=>{if(f(),!c.current){const g=Aj(h,a);c.current=g,a()}};return a(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[o.viewport,f,a]),v.jsx(Ws.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Is(e.onPointerDownCapture,h=>{const g=h.target.getBoundingClientRect(),x=h.clientX-g.left,b=h.clientY-g.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:Is(e.onPointerUp,s.onThumbPointerUp)})});K_.displayName=yh;var jy="ScrollAreaCorner",G_=T.forwardRef((e,t)=>{const n=Si(jy,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?v.jsx(_j,{...e,ref:t}):null});G_.displayName=jy;var _j=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Si(jy,n),[o,s]=T.useState(0),[a,u]=T.useState(0),c=!!(o&&a);return Ll(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Ll(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?v.jsx(Ws.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function xh(e){return e?parseInt(e,10):0}function Y_(e,t){const n=e/t;return isNaN(n)?0:n}function Ep(e){const t=Y_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Tj(e,t,n,r="ltr"){const i=Ep(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return Q_([u,c],h)(e)}function Zw(e,t,n="ltr"){const r=Ep(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],c=yj(e,u);return Q_([0,s],[0,a])(c)}function Q_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function X_(e,t){return e>0&&e<t}var Aj=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function _p(e,t){const n=ks(e),r=T.useRef(0);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),T.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ll(e,t){const n=ks(t);Fo(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var e3=V_,Mj=W_,Nj=G_;const t3=T.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(e3,{ref:r,className:oi("relative overflow-hidden",e),...n,children:[v.jsx(Mj,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(n3,{}),v.jsx(Nj,{})]}));t3.displayName=e3.displayName;const n3=T.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(Ry,{ref:r,orientation:t,className:oi("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(K_,{className:"relative flex-1 rounded-full bg-border"})}));n3.displayName=Ry.displayName;function Ij(e,t=[]){let n=[];function r(o,s){const a=T.createContext(s);a.displayName=o+"Context";const u=n.length;n=[...n,s];const c=h=>{var C;const{scope:m,children:g,...x}=h,b=((C=m==null?void 0:m[e])==null?void 0:C[u])||a,k=T.useMemo(()=>x,Object.values(x));return v.jsx(b.Provider,{value:k,children:g})};c.displayName=o+"Provider";function f(h,m){var b;const g=((b=m==null?void 0:m[e])==null?void 0:b[u])||a,x=T.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>T.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return T.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,Dj(i,...t)]}function Dj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Oj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zy=Oj.reduce((e,t)=>{const n=w_(`Primitive.${t}`),r=T.forwardRef((i,o)=>{const{asChild:s,...a}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Rj(){return Ay.useSyncExternalStore(Pj,()=>!0,()=>!1)}function Pj(){return()=>{}}var Ly="Avatar",[jj]=Ij(Ly),[zj,r3]=jj(Ly),i3=T.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=T.useState("idle");return v.jsx(zj,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:v.jsx(zy.span,{...r,ref:t})})});i3.displayName=Ly;var o3="AvatarImage",s3=T.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=r3(o3,n),a=Lj(r,o),u=ks(c=>{i(c),s.onImageLoadingStatusChange(c)});return Fo(()=>{a!=="idle"&&u(a)},[a,u]),a==="loaded"?v.jsx(zy.img,{...o,ref:t,src:r}):null});s3.displayName=o3;var a3="AvatarFallback",l3=T.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=r3(a3,n),[s,a]=T.useState(r===void 0);return T.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(u)}},[r]),s&&o.imageLoadingStatus!=="loaded"?v.jsx(zy.span,{...i,ref:t}):null});l3.displayName=a3;function Jw(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Lj(e,{referrerPolicy:t,crossOrigin:n}){const r=Rj(),i=T.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=T.useState(()=>Jw(o,e));return Fo(()=>{a(Jw(o,e))},[o,e]),Fo(()=>{const u=h=>()=>{a(h)};if(!o)return;const c=u("loaded"),f=u("error");return o.addEventListener("load",c),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",c),o.removeEventListener("error",f)}},[o,n,t]),s}var u3=i3,c3=s3,d3=l3;const bh=T.forwardRef(({className:e,...t},n)=>v.jsx(u3,{ref:n,className:oi("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));bh.displayName=u3.displayName;const Fj=T.forwardRef(({className:e,...t},n)=>v.jsx(c3,{ref:n,className:oi("aspect-square h-full w-full",e),...t}));Fj.displayName=c3.displayName;const vh=T.forwardRef(({className:e,...t},n)=>v.jsx(d3,{ref:n,className:oi("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));vh.displayName=d3.displayName;const f3=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oi("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));f3.displayName="Card";const h3=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oi("flex flex-col space-y-1.5 p-6",e),...t}));h3.displayName="CardHeader";const p3=T.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:oi("text-2xl font-semibold leading-none tracking-tight",e),...t}));p3.displayName="CardTitle";const $j=T.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:oi("text-sm text-muted-foreground",e),...t}));$j.displayName="CardDescription";const m3=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oi("p-6 pt-0",e),...t}));m3.displayName="CardContent";const Bj=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oi("flex items-center p-6 pt-0",e),...t}));Bj.displayName="CardFooter";const Uj=E_("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Vj({className:e,variant:t,...n}){return v.jsx("div",{className:oi(Uj({variant:t}),e),...n})}var Hj=yy[" useInsertionEffect ".trim().toString()]||Fo;function Wj({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=qj({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:i;{const f=T.useRef(e!==void 0);T.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const c=T.useCallback(f=>{var h;if(a){const m=Zj(f)?f(e):f;m!==e&&((h=s.current)==null||h.call(s,m))}else o(f)},[a,e,o,s]);return[u,c]}function qj({defaultProp:e,onChange:t}){const[n,r]=T.useState(e),i=T.useRef(n),o=T.useRef(t);return Hj(()=>{o.current=t},[t]),T.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function Zj(e){return typeof e=="function"}var Jj=yy[" useId ".trim().toString()]||(()=>{}),Kj=0;function Gj(e){const[t,n]=T.useState(Jj());return Fo(()=>{n(r=>r??String(Kj++))},[e]),e||(t?`radix-${t}`:"")}var Tp="Collapsible",[Yj]=B_(Tp),[Qj,Fy]=Yj(Tp),g3=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[u,c]=Wj({prop:r,defaultProp:i??!1,onChange:s,caller:Tp});return v.jsx(Qj,{scope:n,disabled:o,contentId:Gj(),open:u,onOpenToggle:T.useCallback(()=>c(f=>!f),[c]),children:v.jsx(Ws.div,{"data-state":By(u),"data-disabled":o?"":void 0,...a,ref:t})})});g3.displayName=Tp;var y3="CollapsibleTrigger",x3=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Fy(y3,n);return v.jsx(Ws.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":By(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Is(e.onClick,i.onOpenToggle)})});x3.displayName=y3;var $y="CollapsibleContent",b3=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fy($y,e.__scopeCollapsible);return v.jsx(Yl,{present:n||i.open,children:({present:o})=>v.jsx(Xj,{...r,ref:t,present:o})})});b3.displayName=$y;var Xj=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Fy($y,n),[a,u]=T.useState(r),c=T.useRef(null),f=Vs(t,c),h=T.useRef(0),m=h.current,g=T.useRef(0),x=g.current,b=s.open||a,k=T.useRef(b),C=T.useRef(void 0);return T.useEffect(()=>{const _=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(_)},[]),Fo(()=>{const _=c.current;if(_){C.current=C.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const E=_.getBoundingClientRect();h.current=E.height,g.current=E.width,k.current||(_.style.transitionDuration=C.current.transitionDuration,_.style.animationName=C.current.animationName),u(r)}},[s.open,r]),v.jsx(Ws.div,{"data-state":By(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...o,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:b&&i})});function By(e){return e?"open":"closed"}var ez=g3;const v3=ez,k3=x3,w3=b3;function tz(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iz={};function Kw(e,t){return(iz.jsx?rz:nz).test(e)}const oz=/[ \t\n\f\r]/g;function sz(e){return typeof e=="object"?e.type==="text"?Gw(e.value):!1:Gw(e)}function Gw(e){return e.replace(oz,"")===""}let nd=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};nd.prototype.normal={};nd.prototype.property={};nd.prototype.space=void 0;function C3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new nd(n,r,t)}function v1(e){return e.toLowerCase()}class qr{constructor(t,n){this.attribute=n,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let az=0;const _t=$a(),In=$a(),k1=$a(),Ce=$a(),tn=$a(),Al=$a(),Qr=$a();function $a(){return 2**++az}const w1=Object.freeze(Object.defineProperty({__proto__:null,boolean:_t,booleanish:In,commaOrSpaceSeparated:Qr,commaSeparated:Al,number:Ce,overloadedBoolean:k1,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),V0=Object.keys(w1);class Uy extends qr{constructor(t,n,r,i){let o=-1;if(super(t,n),Yw(this,"space",i),typeof r=="number")for(;++o<V0.length;){const s=V0[o];Yw(this,V0[o],(r&w1[s])===w1[s])}}}Uy.prototype.defined=!0;function Yw(e,t,n){n&&(e[t]=n)}function Ql(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Uy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[v1(r)]=r,n[v1(o.attribute)]=r}return new nd(t,n,e.space)}const S3=Ql({properties:{ariaActiveDescendant:null,ariaAtomic:In,ariaAutoComplete:null,ariaBusy:In,ariaChecked:In,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:tn,ariaCurrent:null,ariaDescribedBy:tn,ariaDetails:null,ariaDisabled:In,ariaDropEffect:tn,ariaErrorMessage:null,ariaExpanded:In,ariaFlowTo:tn,ariaGrabbed:In,ariaHasPopup:null,ariaHidden:In,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tn,ariaLevel:Ce,ariaLive:null,ariaModal:In,ariaMultiLine:In,ariaMultiSelectable:In,ariaOrientation:null,ariaOwns:tn,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:In,ariaReadOnly:In,ariaRelevant:null,ariaRequired:In,ariaRoleDescription:tn,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:In,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E3(e,t){return t in e?e[t]:t}function _3(e,t){return E3(e,t.toLowerCase())}const lz=Ql({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Al,acceptCharset:tn,accessKey:tn,action:null,allow:null,allowFullScreen:_t,allowPaymentRequest:_t,allowUserMedia:_t,alt:null,as:null,async:_t,autoCapitalize:null,autoComplete:tn,autoFocus:_t,autoPlay:_t,blocking:tn,capture:null,charSet:null,checked:_t,cite:null,className:tn,cols:Ce,colSpan:null,content:null,contentEditable:In,controls:_t,controlsList:tn,coords:Ce|Al,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_t,defer:_t,dir:null,dirName:null,disabled:_t,download:k1,draggable:In,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_t,formTarget:null,headers:tn,height:Ce,hidden:k1,high:Ce,href:null,hrefLang:null,htmlFor:tn,httpEquiv:tn,id:null,imageSizes:null,imageSrcSet:null,inert:_t,inputMode:null,integrity:null,is:null,isMap:_t,itemId:null,itemProp:tn,itemRef:tn,itemScope:_t,itemType:tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_t,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:_t,muted:_t,name:null,nonce:null,noModule:_t,noValidate:_t,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:_t,optimum:Ce,pattern:null,ping:tn,placeholder:null,playsInline:_t,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_t,referrerPolicy:null,rel:tn,required:_t,reversed:_t,rows:Ce,rowSpan:Ce,sandbox:tn,scope:null,scoped:_t,seamless:_t,selected:_t,shadowRootClonable:_t,shadowRootDelegatesFocus:_t,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:In,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:_t,useMap:null,value:In,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tn,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_t,declare:_t,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:_t,noHref:_t,noShade:_t,noWrap:_t,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:In,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_t,disableRemotePlayback:_t,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:_3}),uz=Ql({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",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:Qr,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:tn,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:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:_t,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,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:Al,g2:Al,glyphName:Al,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Qr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,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:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qr,rev:Qr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qr,requiredFeatures:Qr,requiredFonts:Qr,requiredFormats:Qr,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:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Qr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qr,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E3}),T3=Ql({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()}}),A3=Ql({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_3}),M3=Ql({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),cz={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"},dz=/[A-Z]/g,Qw=/-[a-z]/g,fz=/^data[-\w.:]+$/i;function hz(e,t){const n=v1(t);let r=t,i=qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fz.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Qw,mz);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Qw.test(o)){let s=o.replace(dz,pz);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Uy}return new i(r,t)}function pz(e){return"-"+e.toLowerCase()}function mz(e){return e.charAt(1).toUpperCase()}const gz=C3([S3,lz,T3,A3,M3],"html"),Vy=C3([S3,uz,T3,A3,M3],"svg");function yz(e){return e.join(" ").trim()}var hl={},H0,Xw;function xz(){if(Xw)return H0;Xw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
230
- `,c="/",f="*",h="",m="comment",g="declaration";function x(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var _=1,E=1;function I(ue){var $=ue.match(t);$&&(_+=$.length);var Q=ue.lastIndexOf(u);E=~Q?ue.length-Q:E+ue.length}function N(){var ue={line:_,column:E};return function($){return $.position=new M(ue),R(),$}}function M(ue){this.start=ue,this.end={line:_,column:E},this.source=C.source}M.prototype.content=k;function j(ue){var $=new Error(C.source+":"+_+":"+E+": "+ue);if($.reason=ue,$.filename=C.source,$.line=_,$.column=E,$.source=k,!C.silent)throw $}function O(ue){var $=ue.exec(k);if($){var Q=$[0];return I(Q),k=k.slice(Q.length),$}}function R(){O(n)}function F(ue){var $;for(ue=ue||[];$=ee();)$!==!1&&ue.push($);return ue}function ee(){var ue=N();if(!(c!=k.charAt(0)||f!=k.charAt(1))){for(var $=2;h!=k.charAt($)&&(f!=k.charAt($)||c!=k.charAt($+1));)++$;if($+=2,h===k.charAt($-1))return j("End of comment missing");var Q=k.slice(2,$-2);return E+=2,I(Q),k=k.slice($),E+=2,ue({type:m,comment:Q})}}function X(){var ue=N(),$=O(r);if($){if(ee(),!O(i))return j("property missing ':'");var Q=O(o),he=ue({type:g,property:b($[0].replace(e,h)),value:Q?b(Q[0].replace(e,h)):h});return O(s),he}}function Se(){var ue=[];F(ue);for(var $;$=X();)$!==!1&&(ue.push($),F(ue));return ue}return R(),Se()}function b(k){return k?k.replace(a,h):h}return H0=x,H0}var e2;function bz(){if(e2)return hl;e2=1;var e=hl&&hl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hl,"__esModule",{value:!0}),hl.default=n;const t=e(xz());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),a=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:f}=u;a?i(c,f,u):f&&(o=o||{},o[c]=f)}),o}return hl}var Lu={},t2;function vz(){if(t2)return Lu;t2=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},s=function(c,f){return f.toUpperCase()},a=function(c,f){return"".concat(f,"-")},u=function(c,f){return f===void 0&&(f={}),o(c)?c:(c=c.toLowerCase(),f.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,s))};return Lu.camelCase=u,Lu}var Fu,n2;function kz(){if(n2)return Fu;n2=1;var e=Fu&&Fu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(bz()),n=vz();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(s[(0,n.camelCase)(a,o)]=u)}),s}return r.default=r,Fu=r,Fu}var wz=kz();const Cz=ja(wz),N3=I3("end"),Hy=I3("start");function I3(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Sz(e){const t=Hy(e),n=N3(e);if(t&&n)return{start:t,end:n}}function ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?r2(e.position):"start"in e||"end"in e?r2(e):"line"in e||"column"in e?C1(e):""}function C1(e){return i2(e&&e.line)+":"+i2(e&&e.column)}function r2(e){return C1(e&&e.start)+"-"+C1(e&&e.end)}function i2(e){return e&&typeof e=="number"?e:1}class fr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ac(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fr.prototype.file="";fr.prototype.name="";fr.prototype.reason="";fr.prototype.message="";fr.prototype.stack="";fr.prototype.column=void 0;fr.prototype.line=void 0;fr.prototype.ancestors=void 0;fr.prototype.cause=void 0;fr.prototype.fatal=void 0;fr.prototype.place=void 0;fr.prototype.ruleId=void 0;fr.prototype.source=void 0;const Wy={}.hasOwnProperty,Ez=new Map,_z=/[A-Z]/g,Tz=new Set(["table","tbody","thead","tfoot","tr"]),Az=new Set(["td","th"]),D3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zz(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jz(n,t.jsx,t.jsxs)}const 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"?Vy:gz,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=O3(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function O3(e,t,n){if(t.type==="element")return Nz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Iz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Oz(e,t,n);if(t.type==="mdxjsEsm")return Dz(e,t);if(t.type==="root")return Rz(e,t,n);if(t.type==="text")return Pz(e,t)}function Nz(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=P3(e,t.tagName,!1),s=Lz(e,t);let a=Zy(e,t);return Tz.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!sz(u):!0})),R3(e,s,o,t),qy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Iz(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Rc(e,t.position)}function Dz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rc(e,t.position)}function Oz(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:P3(e,t.name,!0),s=Fz(e,t),a=Zy(e,t);return R3(e,s,o,t),qy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Rz(e,t,n){const r={};return qy(r,Zy(e,t)),e.create(t,e.Fragment,r,n)}function Pz(e,t){return t.value}function R3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jz(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function zz(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=Hy(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Lz(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Wy.call(t.properties,i)){const o=$z(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Az.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Fz(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Rc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Zy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Ez;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const a=O3(e,o,s);a!==void 0&&n.push(a)}return n}function $z(e,t,n){const r=hz(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?tz(n):yz(n)),r.property==="style"){let i=typeof n=="object"?n:Bz(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Uz(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?cz[r.property]||r.property:r.attribute,n]}}function Bz(e,t){try{return Cz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new fr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=D3+"#cannot-parse-style-attribute",i}}function P3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Kw(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Kw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Wy.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rc(e)}function Rc(e,t){const n=new fr("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=D3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Uz(e){const t={};let n;for(n in e)Wy.call(e,n)&&(t[Vz(n)]=e[n]);return t}function Vz(e){let t=e.replace(_z,Hz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Hz(e){return"-"+e.toLowerCase()}const W0={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"]},Wz={};function Jy(e,t){const n=Wz,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return j3(e,r,i)}function j3(e,t,n){if(qz(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 o2(e.children,t,n)}return Array.isArray(e)?o2(e,t,n):""}function o2(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=j3(e[i],t,n);return r.join("")}function qz(e){return!!(e&&typeof e=="object")}const s2=document.createElement("i");function Ky(e){const t="&"+e+";";s2.innerHTML=t;const n=s2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ti(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function bi(e,t){return e.length>0?(ti(e,e.length,0,t),e):t}const a2={}.hasOwnProperty;function z3(e){const t={};let n=-1;for(;++n<e.length;)Zz(t,e[n]);return t}function Zz(e,t){let n;for(n in t){const i=(a2.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){a2.call(i,s)||(i[s]=[]);const a=o[s];Jz(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Jz(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ti(e,0,0,r)}function L3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Bi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wr=qs(/[A-Za-z]/),cr=qs(/[\dA-Za-z]/),Kz=qs(/[#-'*+\--9=?A-Z^-~]/);function kh(e){return e!==null&&(e<32||e===127)}const S1=qs(/\d/),Gz=qs(/[\dA-Fa-f]/),Yz=qs(/[!-/:-@[-`{-~]/);function pt(e){return e!==null&&e<-2}function Qt(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const Ap=qs(new RegExp("\\p{P}|\\p{S}","u")),Na=qs(/\s/);function qs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&cr(e.charCodeAt(n+1))&&cr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Bt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return Pt(u)?(e.enter(n),a(u)):t(u)}function a(u){return Pt(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Qz={tokenize:Xz};function Xz(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Bt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return pt(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const eL={tokenize:tL},l2={tokenize:nL};function tL(e){const t=this,n=[];let r=0,i,o,s;return a;function a(E){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,u,c)(E)}return c(E)}function u(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const I=t.events.length;let N=I,M;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){M=t.events[N][1].end;break}C(r);let j=I;for(;j<t.events.length;)t.events[j][1].end={...M},j++;return ti(t.events,N+1,0,t.events.slice(I)),t.events.length=j,c(E)}return a(E)}function c(E){if(r===n.length){if(!i)return m(E);if(i.currentConstruct&&i.currentConstruct.concrete)return x(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(l2,f,h)(E)}function f(E){return i&&_(),C(r),m(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(E)}function m(E){return t.containerState={},e.attempt(l2,g,x)(E)}function g(E){return r++,n.push([t.currentConstruct,t.containerState]),m(E)}function x(E){if(E===null){i&&_(),C(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(E)}function b(E){if(E===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return pt(E)?(e.consume(E),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),b)}function k(E,I){const N=t.sliceStream(E);if(I&&N.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(N),t.parser.lazy[E.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<s&&(!i.events[M][1].end||i.events[M][1].end.offset>s))return;const j=t.events.length;let O=j,R,F;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(R){F=t.events[O][1].end;break}R=!0}for(C(r),M=j;M<t.events.length;)t.events[M][1].end={...F},M++;ti(t.events,O+1,0,t.events.slice(j)),t.events.length=M}}function C(E){let I=n.length;for(;I-- >E;){const N=n[I];t.containerState=N[1],N[0].exit.call(t,e)}n.length=E}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function nL(e,t,n){return Bt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fl(e){if(e===null||Qt(e)||Na(e))return 1;if(Ap(e))return 2}function Mp(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const E1={name:"attention",resolveAll:rL,tokenize:iL};function rL(e,t){let n=-1,r,i,o,s,a,u,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};u2(h,-u),u2(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=bi(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=bi(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=bi(c,Mp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=bi(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=bi(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ti(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function iL(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Fl(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const c=e.exit("attentionSequence"),f=Fl(u),h=!f||f===2&&i||n.includes(u),m=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?h:h&&(i||!m)),c._close=!!(o===42?m:m&&(f||!h)),t(u)}}function u2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oL={name:"autolink",tokenize:sL};function sL(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return wr(g)?(e.consume(g),s):g===64?n(g):c(g)}function s(g){return g===43||g===45||g===46||cr(g)?(r=1,a(g)):c(g)}function a(g){return g===58?(e.consume(g),r=0,u):(g===43||g===45||g===46||cr(g))&&r++<32?(e.consume(g),a):(r=0,c(g))}function u(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||kh(g)?n(g):(e.consume(g),u)}function c(g){return g===64?(e.consume(g),f):Kz(g)?(e.consume(g),c):n(g)}function f(g){return cr(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,f):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):m(g)}function m(g){if((g===45||cr(g))&&r++<63){const x=g===45?m:h;return e.consume(g),x}return n(g)}}const rd={partial:!0,tokenize:aL};function aL(e,t,n){return r;function r(o){return Pt(o)?Bt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||pt(o)?t(o):n(o)}}const F3={continuation:{tokenize:uL},exit:cL,name:"blockQuote",tokenize:lL};function lL(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Pt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function uL(e,t,n){const r=this;return i;function i(s){return Pt(s)?Bt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(F3,t,n)(s)}}function cL(e){e.exit("blockQuote")}const $3={name:"characterEscape",tokenize:dL};function dL(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Yz(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const B3={name:"characterReference",tokenize:fL};function fL(e,t,n){const r=this;let i=0,o,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=cr,f(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Gz,f):(e.enter("characterReferenceValue"),o=7,s=S1,f(h))}function f(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return s===cr&&!Ky(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<o?(e.consume(h),f):n(h)}}const c2={partial:!0,tokenize:pL},d2={concrete:!0,name:"codeFenced",tokenize:hL};function hL(e,t,n){const r=this,i={partial:!0,tokenize:N};let o=0,s=0,a;return u;function u(M){return c(M)}function c(M){const j=r.events[r.events.length-1];return o=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(M)}function f(M){return M===a?(s++,e.consume(M),f):s<3?n(M):(e.exit("codeFencedFenceSequence"),Pt(M)?Bt(e,h,"whitespace")(M):h(M))}function h(M){return M===null||pt(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(c2,b,I)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||pt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(M)):Pt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Bt(e,g,"whitespace")(M)):M===96&&M===a?n(M):(e.consume(M),m)}function g(M){return M===null||pt(M)?h(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||pt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(M)):M===96&&M===a?n(M):(e.consume(M),x)}function b(M){return e.attempt(i,I,k)(M)}function k(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return o>0&&Pt(M)?Bt(e,_,"linePrefix",o+1)(M):_(M)}function _(M){return M===null||pt(M)?e.check(c2,b,I)(M):(e.enter("codeFlowValue"),E(M))}function E(M){return M===null||pt(M)?(e.exit("codeFlowValue"),_(M)):(e.consume(M),E)}function I(M){return e.exit("codeFenced"),t(M)}function N(M,j,O){let R=0;return F;function F($){return M.enter("lineEnding"),M.consume($),M.exit("lineEnding"),ee}function ee($){return M.enter("codeFencedFence"),Pt($)?Bt(M,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):X($)}function X($){return $===a?(M.enter("codeFencedFenceSequence"),Se($)):O($)}function Se($){return $===a?(R++,M.consume($),Se):R>=s?(M.exit("codeFencedFenceSequence"),Pt($)?Bt(M,ue,"whitespace")($):ue($)):O($)}function ue($){return $===null||pt($)?(M.exit("codeFencedFence"),j($)):O($)}}}function pL(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const q0={name:"codeIndented",tokenize:gL},mL={partial:!0,tokenize:yL};function gL(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Bt(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):pt(c)?e.attempt(mL,s,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||pt(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function yL(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):pt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Bt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):pt(s)?i(s):n(s)}}const xL={name:"codeText",previous:vL,resolve:bL,tokenize:kL};function bL(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 vL(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kL(e,t,n){let r=0,i,o;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(o=e.enter("codeTextSequence"),i=0,f(h)):pt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||pt(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",c(h))}}class wL{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$u(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$u(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$u(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$u(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$u(this.left,n.reverse())}}}function $u(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 U3(e){const t={};let n=-1,r,i,o,s,a,u,c;const f=new wL(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CL(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ti(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function CL(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,u=[],c={};let f,h,m=-1,g=n,x=0,b=0;const k=[b];for(;g;){for(;e.get(++i)[1]!==g;);o.push(i),g._tokenizer||(f=r.sliceStream(g),g.next||f.push(null),h&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(b=m+1,k.push(b),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):k.pop(),m=k.length;m--;){const C=a.slice(k[m],k[m+1]),_=o.pop();u.push([_,_+C.length-1]),e.splice(_,2,C)}for(u.reverse(),m=-1;++m<u.length;)c[x+u[m][0]]=x+u[m][1],x+=u[m][1]-u[m][0]-1;return c}const SL={resolve:_L,tokenize:TL},EL={partial:!0,tokenize:AL};function _L(e){return U3(e),e}function TL(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):pt(a)?e.check(EL,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function AL(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Bt(e,o,"linePrefix")}function o(s){if(s===null||pt(s))return n(s);const 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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function V3(e,t,n,r,i,o,s,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),m):C===null||C===32||C===41||kh(C)?n(C):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(C))}function m(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(a),m(C)):C===null||C===60||pt(C)?n(C):(e.consume(C),C===92?x:g)}function x(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function b(C){return!f&&(C===null||C===41||Qt(C))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(C)):f<c&&C===40?(e.consume(C),f++,b):C===41?(e.consume(C),f--,b):C===null||C===32||C===40||kh(C)?n(C):(e.consume(C),C===92?k:b)}function k(C){return C===40||C===41||C===92?(e.consume(C),b):b(C)}}function H3(e,t,n,r,i,o){const s=this;let a=0,u;return c;function c(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),f}function f(g){return a>999||g===null||g===91||g===93&&!u||g===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):pt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||pt(g)||a++>999?(e.exit("chunkString"),f(g)):(e.consume(g),u||(u=!Pt(g)),g===92?m:h)}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,h):h(g)}}function W3(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),c(m))}function c(m){return m===s?(e.exit(o),u(s)):m===null?n(m):pt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Bt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===s||m===null||pt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?h:f)}function h(m){return m===s||m===92?(e.consume(m),f):f(m)}}function lc(e,t){let n;return r;function r(i){return pt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Bt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ML={name:"definition",tokenize:IL},NL={partial:!0,tokenize:DL};function IL(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return H3.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return i=Bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return Qt(g)?lc(e,c)(g):c(g)}function c(g){return V3(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function f(g){return e.attempt(NL,h,h)(g)}function h(g){return Pt(g)?Bt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||pt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function DL(e,t,n){return r;function r(a){return Qt(a)?lc(e,i)(a):n(a)}function i(a){return W3(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Pt(a)?Bt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||pt(a)?t(a):n(a)}}const OL={name:"hardBreakEscape",tokenize:RL};function RL(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return pt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const PL={name:"headingAtx",resolve:jL,tokenize:zL};function jL(e,t){let n=e.length-2,r=3,i,o;return 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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ti(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function zL(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Qt(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||pt(f)?(e.exit("atxHeading"),t(f)):Pt(f)?Bt(e,a,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||Qt(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),c)}}const LL=["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"],f2=["pre","script","style","textarea"],FL={concrete:!0,name:"htmlFlow",resolveTo:UL,tokenize:VL},$L={partial:!0,tokenize:WL},BL={partial:!0,tokenize:HL};function UL(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 VL(e,t,n){const r=this;let i,o,s,a,u;return c;function c(P){return f(P)}function f(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),h}function h(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),o=!0,b):P===63?(e.consume(P),i=3,r.interrupt?t:D):wr(P)?(e.consume(P),s=String.fromCharCode(P),k):n(P)}function m(P){return P===45?(e.consume(P),i=2,g):P===91?(e.consume(P),i=5,a=0,x):wr(P)?(e.consume(P),i=4,r.interrupt?t:D):n(P)}function g(P){return P===45?(e.consume(P),r.interrupt?t:D):n(P)}function x(P){const tt="CDATA[";return P===tt.charCodeAt(a++)?(e.consume(P),a===tt.length?r.interrupt?t:X:x):n(P)}function b(P){return wr(P)?(e.consume(P),s=String.fromCharCode(P),k):n(P)}function k(P){if(P===null||P===47||P===62||Qt(P)){const tt=P===47,U=s.toLowerCase();return!tt&&!o&&f2.includes(U)?(i=1,r.interrupt?t(P):X(P)):LL.includes(s.toLowerCase())?(i=6,tt?(e.consume(P),C):r.interrupt?t(P):X(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?_(P):E(P))}return P===45||cr(P)?(e.consume(P),s+=String.fromCharCode(P),k):n(P)}function C(P){return P===62?(e.consume(P),r.interrupt?t:X):n(P)}function _(P){return Pt(P)?(e.consume(P),_):F(P)}function E(P){return P===47?(e.consume(P),F):P===58||P===95||wr(P)?(e.consume(P),I):Pt(P)?(e.consume(P),E):F(P)}function I(P){return P===45||P===46||P===58||P===95||cr(P)?(e.consume(P),I):N(P)}function N(P){return P===61?(e.consume(P),M):Pt(P)?(e.consume(P),N):E(P)}function M(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),u=P,j):Pt(P)?(e.consume(P),M):O(P)}function j(P){return P===u?(e.consume(P),u=null,R):P===null||pt(P)?n(P):(e.consume(P),j)}function O(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Qt(P)?N(P):(e.consume(P),O)}function R(P){return P===47||P===62||Pt(P)?E(P):n(P)}function F(P){return P===62?(e.consume(P),ee):n(P)}function ee(P){return P===null||pt(P)?X(P):Pt(P)?(e.consume(P),ee):n(P)}function X(P){return P===45&&i===2?(e.consume(P),Q):P===60&&i===1?(e.consume(P),he):P===62&&i===4?(e.consume(P),W):P===63&&i===3?(e.consume(P),D):P===93&&i===5?(e.consume(P),Me):pt(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($L,oe,Se)(P)):P===null||pt(P)?(e.exit("htmlFlowData"),Se(P)):(e.consume(P),X)}function Se(P){return e.check(BL,ue,oe)(P)}function ue(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),$}function $(P){return P===null||pt(P)?Se(P):(e.enter("htmlFlowData"),X(P))}function Q(P){return P===45?(e.consume(P),D):X(P)}function he(P){return P===47?(e.consume(P),s="",te):X(P)}function te(P){if(P===62){const tt=s.toLowerCase();return f2.includes(tt)?(e.consume(P),W):X(P)}return wr(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),te):X(P)}function Me(P){return P===93?(e.consume(P),D):X(P)}function D(P){return P===62?(e.consume(P),W):P===45&&i===2?(e.consume(P),D):X(P)}function W(P){return P===null||pt(P)?(e.exit("htmlFlowData"),oe(P)):(e.consume(P),W)}function oe(P){return e.exit("htmlFlow"),t(P)}}function HL(e,t,n){const r=this;return i;function i(s){return pt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function WL(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(rd,t,n)}}const qL={name:"htmlText",tokenize:ZL};function ZL(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),N):D===63?(e.consume(D),E):wr(D)?(e.consume(D),O):n(D)}function c(D){return D===45?(e.consume(D),f):D===91?(e.consume(D),o=0,x):wr(D)?(e.consume(D),_):n(D)}function f(D){return D===45?(e.consume(D),g):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),m):pt(D)?(s=h,he(D)):(e.consume(D),h)}function m(D){return D===45?(e.consume(D),g):h(D)}function g(D){return D===62?Q(D):D===45?m(D):h(D)}function x(D){const W="CDATA[";return D===W.charCodeAt(o++)?(e.consume(D),o===W.length?b:x):n(D)}function b(D){return D===null?n(D):D===93?(e.consume(D),k):pt(D)?(s=b,he(D)):(e.consume(D),b)}function k(D){return D===93?(e.consume(D),C):b(D)}function C(D){return D===62?Q(D):D===93?(e.consume(D),C):b(D)}function _(D){return D===null||D===62?Q(D):pt(D)?(s=_,he(D)):(e.consume(D),_)}function E(D){return D===null?n(D):D===63?(e.consume(D),I):pt(D)?(s=E,he(D)):(e.consume(D),E)}function I(D){return D===62?Q(D):E(D)}function N(D){return wr(D)?(e.consume(D),M):n(D)}function M(D){return D===45||cr(D)?(e.consume(D),M):j(D)}function j(D){return pt(D)?(s=j,he(D)):Pt(D)?(e.consume(D),j):Q(D)}function O(D){return D===45||cr(D)?(e.consume(D),O):D===47||D===62||Qt(D)?R(D):n(D)}function R(D){return D===47?(e.consume(D),Q):D===58||D===95||wr(D)?(e.consume(D),F):pt(D)?(s=R,he(D)):Pt(D)?(e.consume(D),R):Q(D)}function F(D){return D===45||D===46||D===58||D===95||cr(D)?(e.consume(D),F):ee(D)}function ee(D){return D===61?(e.consume(D),X):pt(D)?(s=ee,he(D)):Pt(D)?(e.consume(D),ee):R(D)}function X(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,Se):pt(D)?(s=X,he(D)):Pt(D)?(e.consume(D),X):(e.consume(D),ue)}function Se(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):pt(D)?(s=Se,he(D)):(e.consume(D),Se)}function ue(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||Qt(D)?R(D):(e.consume(D),ue)}function $(D){return D===47||D===62||Qt(D)?R(D):n(D)}function Q(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function he(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),te}function te(D){return Pt(D)?Bt(e,Me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):Me(D)}function Me(D){return e.enter("htmlTextData"),s(D)}}const Gy={name:"labelEnd",resolveAll:YL,resolveTo:QL,tokenize:XL},JL={tokenize:eF},KL={tokenize:tF},GL={tokenize:nF};function YL(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ti(e,0,e.length,n),e}function QL(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",c,t]],a=bi(a,e.slice(o+1,o+r+3)),a=bi(a,[["enter",f,t]]),a=bi(a,Mp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=bi(a,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),a=bi(a,e.slice(s+1)),a=bi(a,[["exit",u,t]]),ti(e,o,e.length,a),e}function XL(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?h(m):(s=r.parser.defined.includes(Bi(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(JL,f,s?f:h)(m):m===91?e.attempt(KL,f,s?c:h)(m):s?f(m):h(m)}function c(m){return e.attempt(GL,f,h)(m)}function f(m){return t(m)}function h(m){return o._balanced=!0,n(m)}}function eF(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Qt(h)?lc(e,o)(h):o(h)}function o(h){return h===41?f(h):V3(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Qt(h)?lc(e,u)(h):f(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?W3(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function c(h){return Qt(h)?lc(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function tF(e,t,n){const r=this;return i;function i(a){return H3.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function nF(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const rF={name:"labelStartImage",resolveAll:Gy.resolveAll,tokenize:iF};function iF(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const oF={name:"labelStartLink",resolveAll:Gy.resolveAll,tokenize:sF};function sF(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Z0={name:"lineEnding",tokenize:aF};function aF(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Bt(e,t,"linePrefix")}}const Yf={name:"thematicBreak",tokenize:lF};function lF(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||pt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Pt(c)?Bt(e,a,"whitespace")(c):a(c))}}const $r={continuation:{tokenize:fF},exit:pF,name:"list",tokenize:dF},uF={partial:!0,tokenize:mF},cF={partial:!0,tokenize:hF};function dF(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(g){const x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:S1(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Yf,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return S1(g)&&++s<10?(e.consume(g),u):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(rd,r.interrupt?n:f,e.attempt(uF,m,h))}function f(g){return r.containerState.initialBlankLine=!0,o++,m(g)}function h(g){return Pt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function fF(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(rd,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Pt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cF,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bt(e,e.attempt($r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hF(e,t,n){const r=this;return Bt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function pF(e){e.exit(this.containerState.type)}function mF(e,t,n){const r=this;return Bt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Pt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const h2={name:"setextUnderline",resolveTo:gF,tokenize:yF};function gF(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function yF(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Pt(c)?Bt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||pt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const xF={tokenize:bF};function bF(e){const t=this,n=e.attempt(rd,r,e.attempt(this.parser.constructs.flowInitial,i,Bt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(SL,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vF={resolveAll:Z3()},kF=q3("string"),wF=q3("text");function q3(e){return{resolveAll:Z3(e==="text"?CF:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return c(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const h=i[f];let m=-1;if(h)for(;++m<h.length;){const g=h[m];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function Z3(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function CF(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,u;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)u=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const SF={42:$r,43:$r,45:$r,48:$r,49:$r,50:$r,51:$r,52:$r,53:$r,54:$r,55:$r,56:$r,57:$r,62:F3},EF={91:ML},_F={[-2]:q0,[-1]:q0,32:q0},TF={35:PL,42:Yf,45:[h2,Yf],60:FL,61:h2,95:Yf,96:d2,126:d2},AF={38:B3,92:$3},MF={[-5]:Z0,[-4]:Z0,[-3]:Z0,33:rF,38:B3,42:E1,60:[oL,qL],91:oF,92:[OL,$3],93:Gy,95:E1,96:xL},NF={null:[E1,vF]},IF={null:[42,95]},DF={null:[]},OF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IF,contentInitial:EF,disable:DF,document:SF,flow:TF,flowInitial:_F,insideSpan:NF,string:AF,text:MF},Symbol.toStringTag,{value:"Module"}));function RF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const u={attempt:j(N),check:j(M),consume:_,enter:E,exit:I,interrupt:j(M,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:g,write:h};let f=t.tokenize.call(c,u);return t.resolveAll&&o.push(t),c;function h(ee){return s=bi(s,ee),k(),s[s.length-1]!==null?[]:(O(t,0),c.events=Mp(o,c.events,c),c.events)}function m(ee,X){return jF(g(ee),X)}function g(ee){return PF(s,ee)}function x(){const{_bufferIndex:ee,_index:X,line:Se,column:ue,offset:$}=r;return{_bufferIndex:ee,_index:X,line:Se,column:ue,offset:$}}function b(ee){i[ee.line]=ee.column,F()}function k(){let ee;for(;r._index<s.length;){const X=s[r._index];if(typeof X=="string")for(ee=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ee&&r._bufferIndex<X.length;)C(X.charCodeAt(r._bufferIndex));else C(X)}}function C(ee){f=f(ee)}function _(ee){pt(ee)?(r.line++,r.column=1,r.offset+=ee===-3?2:1,F()):ee!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=ee}function E(ee,X){const Se=X||{};return Se.type=ee,Se.start=x(),c.events.push(["enter",Se,c]),a.push(Se),Se}function I(ee){const X=a.pop();return X.end=x(),c.events.push(["exit",X,c]),X}function N(ee,X){O(ee,X.from)}function M(ee,X){X.restore()}function j(ee,X){return Se;function Se(ue,$,Q){let he,te,Me,D;return Array.isArray(ue)?oe(ue):"tokenize"in ue?oe([ue]):W(ue);function W(ke){return _e;function _e(Pe){const Ee=Pe!==null&&ke[Pe],$e=Pe!==null&&ke.null,xt=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return oe(xt)(Pe)}}function oe(ke){return he=ke,te=0,ke.length===0?Q:P(ke[te])}function P(ke){return _e;function _e(Pe){return D=R(),Me=ke,ke.partial||(c.currentConstruct=ke),ke.name&&c.parser.constructs.disable.null.includes(ke.name)?U():ke.tokenize.call(X?Object.assign(Object.create(c),X):c,u,tt,U)(Pe)}}function tt(ke){return ee(Me,D),$}function U(ke){return D.restore(),++te<he.length?P(he[te]):Q}}}function O(ee,X){ee.resolveAll&&!o.includes(ee)&&o.push(ee),ee.resolve&&ti(c.events,X,c.events.length-X,ee.resolve(c.events.slice(X),c)),ee.resolveTo&&(c.events=ee.resolveTo(c.events,c))}function R(){const ee=x(),X=c.previous,Se=c.currentConstruct,ue=c.events.length,$=Array.from(a);return{from:ue,restore:Q};function Q(){r=ee,c.previous=X,c.currentConstruct=Se,c.events.length=ue,a=$,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function PF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function jF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
231
- `;break}case-3:{s=`\r
232
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function zF(e){const r={constructs:z3([OF,...(e||{}).extensions||[]]),content:i(Qz),defined:[],document:i(eL),flow:i(xF),lazy:{},string:i(kF),text:i(wF)};return r;function i(o){return s;function s(a){return RF(r,o,a)}}}function LF(e){for(;!U3(e););return e}const p2=/[\0\t\n\r]/g;function FF(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const u=[];let c,f,h,m,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(p2.lastIndex=h,c=p2.exec(o),m=c&&c.index!==void 0?c.index:o.length,g=o.charCodeAt(m),!c){t=o.slice(h);break}if(g===10&&h===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<m&&(u.push(o.slice(h,m)),e+=m-h),g){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const $F=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BF(e){return e.replace($F,UF)}function UF(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return L3(n.slice(o?2:1),o?16:10)}return Ky(n)||e}const J3={}.hasOwnProperty;function VF(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HF(n)(LF(zF(n).document().write(FF()(e,t,!0))))}function HF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ar),autolinkProtocol:R,autolinkEmail:R,atxHeading:o(Gs),blockQuote:o($e),characterEscape:R,characterReference:R,codeFenced:o(xt),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(xt,s),codeText:o(on,s),codeTextData:R,data:R,codeFlowValue:R,definition:o(Yn),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Qn),hardBreakEscape:o(Ys),hardBreakTrailing:o(Ys),htmlFlow:o(ho,s),htmlFlowData:R,htmlText:o(ho,s),htmlTextData:R,image:o(po),label:s,link:o(Ar),listItem:o(Mr),listItemValue:m,listOrdered:o(Ei,h),listUnordered:o(Ei),paragraph:o(ai),reference:P,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Gs),strong:o(Qs),thematicBreak:o(mo)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:Ee,autolinkProtocol:Pe,blockQuote:u(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:ke,characterReference:_e,codeFenced:u(k),codeFencedFence:b,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:u(C),codeText:u($),codeTextData:F,data:F,definition:u(),definitionDestinationString:I,definitionLabelString:_,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(X),hardBreakTrailing:u(X),htmlFlow:u(Se),htmlFlowData:F,htmlText:u(ue),htmlTextData:F,image:u(he),label:Me,labelText:te,lineEnding:ee,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:tt,resourceDestinationString:D,resourceTitleString:W,resource:oe,setextHeading:u(O),setextHeadingLineSequence:j,setextHeadingText:M,strong:u(),thematicBreak:u()}};K3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(re){let Ie={type:"root",children:[]};const dt={stack:[Ie],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:f,data:n},Tt=[];let zt=-1;for(;++zt<re.length;)if(re[zt][1].type==="listOrdered"||re[zt][1].type==="listUnordered")if(re[zt][0]==="enter")Tt.push(zt);else{const zn=Tt.pop();zt=i(re,zn,zt)}for(zt=-1;++zt<re.length;){const zn=t[re[zt][0]];J3.call(zn,re[zt][1].type)&&zn[re[zt][1].type].call(Object.assign({sliceSerialize:re[zt][2].sliceSerialize},dt),re[zt][1])}if(dt.tokenStack.length>0){const zn=dt.tokenStack[dt.tokenStack.length-1];(zn[1]||m2).call(dt,void 0,zn[0])}for(Ie.position={start:ds(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:ds(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},zt=-1;++zt<t.transforms.length;)Ie=t.transforms[zt](Ie)||Ie;return Ie}function i(re,Ie,dt){let Tt=Ie-1,zt=-1,zn=!1,_i,Ir,Vi,go;for(;++Tt<=dt;){const Ln=re[Tt];switch(Ln[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ln[0]==="enter"?zt++:zt--,go=void 0;break}case"lineEndingBlank":{Ln[0]==="enter"&&(_i&&!go&&!zt&&!Vi&&(Vi=Tt),go=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:go=void 0}if(!zt&&Ln[0]==="enter"&&Ln[1].type==="listItemPrefix"||zt===-1&&Ln[0]==="exit"&&(Ln[1].type==="listUnordered"||Ln[1].type==="listOrdered")){if(_i){let li=Tt;for(Ir=void 0;li--;){const pr=re[li];if(pr[1].type==="lineEnding"||pr[1].type==="lineEndingBlank"){if(pr[0]==="exit")continue;Ir&&(re[Ir][1].type="lineEndingBlank",zn=!0),pr[1].type="lineEnding",Ir=li}else if(!(pr[1].type==="linePrefix"||pr[1].type==="blockQuotePrefix"||pr[1].type==="blockQuotePrefixWhitespace"||pr[1].type==="blockQuoteMarker"||pr[1].type==="listItemIndent"))break}Vi&&(!Ir||Vi<Ir)&&(_i._spread=!0),_i.end=Object.assign({},Ir?re[Ir][1].start:Ln[1].end),re.splice(Ir||Tt,0,["exit",_i,Ln[2]]),Tt++,dt++}if(Ln[1].type==="listItemPrefix"){const li={type:"listItem",_spread:!1,start:Object.assign({},Ln[1].start),end:void 0};_i=li,re.splice(Tt,0,["enter",li,Ln[2]]),Tt++,dt++,Vi=void 0,go=!0}}}return re[Ie][1]._spread=zn,dt}function o(re,Ie){return dt;function dt(Tt){a.call(this,re(Tt),Tt),Ie&&Ie.call(this,Tt)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(re,Ie,dt){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([Ie,dt||void 0]),re.position={start:ds(Ie.start),end:void 0}}function u(re){return Ie;function Ie(dt){re&&re.call(this,dt),c.call(this,dt)}}function c(re,Ie){const dt=this.stack.pop(),Tt=this.tokenStack.pop();if(Tt)Tt[0].type!==re.type&&(Ie?Ie.call(this,re,Tt[0]):(Tt[1]||m2).call(this,re,Tt[0]));else throw new Error("Cannot close `"+re.type+"` ("+ac({start:re.start,end:re.end})+"): it’s not open");dt.position.end=ds(re.end)}function f(){return Jy(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(re){if(this.data.expectingFirstListItemValue){const Ie=this.stack[this.stack.length-2];Ie.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function g(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.lang=re}function x(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.meta=re}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.value=re.replace(/(\r?\n|\r)$/g,"")}function _(re){const Ie=this.resume(),dt=this.stack[this.stack.length-1];dt.label=Ie,dt.identifier=Bi(this.sliceSerialize(re)).toLowerCase()}function E(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.title=re}function I(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.url=re}function N(re){const Ie=this.stack[this.stack.length-1];if(!Ie.depth){const dt=this.sliceSerialize(re).length;Ie.depth=dt}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function j(re){const Ie=this.stack[this.stack.length-1];Ie.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function R(re){const dt=this.stack[this.stack.length-1].children;let Tt=dt[dt.length-1];(!Tt||Tt.type!=="text")&&(Tt=Nr(),Tt.position={start:ds(re.start),end:void 0},dt.push(Tt)),this.stack.push(Tt)}function F(re){const Ie=this.stack.pop();Ie.value+=this.sliceSerialize(re),Ie.position.end=ds(re.end)}function ee(re){const Ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const dt=Ie.children[Ie.children.length-1];dt.position.end=ds(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ie.type)&&(R.call(this,re),F.call(this,re))}function X(){this.data.atHardBreak=!0}function Se(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.value=re}function ue(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.value=re}function $(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.value=re}function Q(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const Ie=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=Ie,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function he(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const Ie=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=Ie,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function te(re){const Ie=this.sliceSerialize(re),dt=this.stack[this.stack.length-2];dt.label=BF(Ie),dt.identifier=Bi(Ie).toLowerCase()}function Me(){const re=this.stack[this.stack.length-1],Ie=this.resume(),dt=this.stack[this.stack.length-1];if(this.data.inReference=!0,dt.type==="link"){const Tt=re.children;dt.children=Tt}else dt.alt=Ie}function D(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.url=re}function W(){const re=this.resume(),Ie=this.stack[this.stack.length-1];Ie.title=re}function oe(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function tt(re){const Ie=this.resume(),dt=this.stack[this.stack.length-1];dt.label=Ie,dt.identifier=Bi(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function U(re){this.data.characterReferenceType=re.type}function ke(re){const Ie=this.sliceSerialize(re),dt=this.data.characterReferenceType;let Tt;dt?(Tt=L3(Ie,dt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Tt=Ky(Ie);const zt=this.stack[this.stack.length-1];zt.value+=Tt}function _e(re){const Ie=this.stack.pop();Ie.position.end=ds(re.end)}function Pe(re){F.call(this,re);const Ie=this.stack[this.stack.length-1];Ie.url=this.sliceSerialize(re)}function Ee(re){F.call(this,re);const Ie=this.stack[this.stack.length-1];Ie.url="mailto:"+this.sliceSerialize(re)}function $e(){return{type:"blockquote",children:[]}}function xt(){return{type:"code",lang:null,meta:null,value:""}}function on(){return{type:"inlineCode",value:""}}function Yn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qn(){return{type:"emphasis",children:[]}}function Gs(){return{type:"heading",depth:0,children:[]}}function Ys(){return{type:"break"}}function ho(){return{type:"html",value:""}}function po(){return{type:"image",title:null,url:"",alt:null}}function Ar(){return{type:"link",title:null,url:"",children:[]}}function Ei(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function Mr(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function ai(){return{type:"paragraph",children:[]}}function Qs(){return{type:"strong",children:[]}}function Nr(){return{type:"text",value:""}}function mo(){return{type:"thematicBreak"}}}function ds(e){return{line:e.line,column:e.column,offset:e.offset}}function K3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?K3(e,r):WF(e,r)}}function WF(e,t){let n;for(n in t)if(J3.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function m2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ac({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is still open")}function qF(e){const t=this;t.parser=n;function n(r){return VF(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZF(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function JF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
233
- `}]}function KF(e,t){const n=t.value?t.value+`
234
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function GF(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Xl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function XF(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function e7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function G3(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function t7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return G3(e,t);const i={src:Xl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function n7(e,t){const n={src:Xl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function r7(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function i7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return G3(e,t);const i={href:Xl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function o7(e,t){const n={href:Xl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function s7(e,t,n){const r=e.all(t),i=n?a7(n):Y3(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
235
- `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
236
- `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function a7(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Y3(n[r])}return t}function Y3(e){const t=e.spread;return t??e.children.length>1}function l7(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function u7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function d7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function f7(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Hy(t.children[1]),u=N3(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function h7(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<a;){const h=t.children[u],m={},g=s?s[u]:void 0;g&&(m.align=g);let x={type:"element",tagName:o,properties:m,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),c.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function p7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const g2=9,y2=32;function m7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(x2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(x2(t.slice(i),i>0,!1)),o.join("")}function x2(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===g2||o===y2;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===g2||o===y2;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function g7(e,t){const n={type:"text",value:m7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function y7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const x7={blockquote:ZF,break:JF,code:KF,delete:GF,emphasis:YF,footnoteReference:QF,heading:XF,html:e7,imageReference:t7,image:n7,inlineCode:r7,linkReference:i7,link:o7,listItem:s7,list:l7,paragraph:u7,root:c7,strong:d7,table:f7,tableCell:p7,tableRow:h7,text:g7,thematicBreak:y7,toml:Tf,yaml:Tf,definition:Tf,footnoteDefinition:Tf};function Tf(){}const Q3=-1,Np=0,uc=1,wh=2,Yy=3,Qy=4,Xy=5,ex=6,X3=7,e4=8,b2=typeof self=="object"?self:globalThis,b7=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Np:case Q3:return n(s,i);case uc:{const a=n([],i);for(const u of s)a.push(r(u));return a}case wh:{const a=n({},i);for(const[u,c]of s)a[r(u)]=r(c);return a}case Yy:return n(new Date(s),i);case Qy:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case Xy:{const a=n(new Map,i);for(const[u,c]of s)a.set(r(u),r(c));return a}case ex:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case X3:{const{name:a,message:u}=s;return n(new b2[a](u),i)}case e4:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new b2[o](s),i)};return r},v2=e=>b7(new Map,e)(0),pl="",{toString:v7}={},{keys:k7}=Object,Bu=e=>{const t=typeof e;if(t!=="object"||!e)return[Np,t];const n=v7.call(e).slice(8,-1);switch(n){case"Array":return[uc,pl];case"Object":return[wh,pl];case"Date":return[Yy,pl];case"RegExp":return[Qy,pl];case"Map":return[Xy,pl];case"Set":return[ex,pl];case"DataView":return[uc,n]}return n.includes("Array")?[uc,n]:n.includes("Error")?[X3,n]:[wh,n]},Af=([e,t])=>e===Np&&(t==="function"||t==="symbol"),w7=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=Bu(s);switch(a){case Np:{let f=s;switch(u){case"bigint":a=e4,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Q3],s)}return i([a,f],s)}case uc:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),i([u,[...m]],s)}const f=[],h=i([a,f],s);for(const m of s)f.push(o(m));return h}case wh:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],h=i([a,f],s);for(const m of k7(s))(e||!Af(Bu(s[m])))&&f.push([o(m),o(s[m])]);return h}case Yy:return i([a,s.toISOString()],s);case Qy:{const{source:f,flags:h}=s;return i([a,{source:f,flags:h}],s)}case Xy:{const f=[],h=i([a,f],s);for(const[m,g]of s)(e||!(Af(Bu(m))||Af(Bu(g))))&&f.push([o(m),o(g)]);return h}case ex:{const f=[],h=i([a,f],s);for(const m of s)(e||!Af(Bu(m)))&&f.push(o(m));return h}}const{message:c}=s;return i([a,{name:u,message:c}],s)};return o},k2=(e,{json:t,lossy:n}={})=>{const r=[];return w7(!(t||n),!!t,new Map,r)(e),r},Ch=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?v2(k2(e,t)):structuredClone(e):(e,t)=>v2(k2(e,t));function C7(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function S7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function E7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||C7,r=e.options.footnoteBackLabel||S7,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const f=e.all(c),h=String(c.identifier).toUpperCase(),m=Xl(h.toLowerCase());let g=0;const x=[],b=e.footnoteCounts.get(h);for(;b!==void 0&&++g<=b;){x.length>0&&x.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,g);typeof _=="string"&&(_={type:"text",value:_}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=f[f.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...x)}else f.push(...x);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(f,!0)};e.patch(c,C),a.push(C)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ch(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
237
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
238
- `}]}}const Ip=(function(e){if(e==null)return M7;if(typeof e=="function")return Dp(e);if(typeof e=="object")return Array.isArray(e)?_7(e):T7(e);if(typeof e=="string")return A7(e);throw new Error("Expected function, string, or object as test")});function _7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ip(e[n]);return Dp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function T7(e){const t=e;return Dp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function A7(e){return Dp(t);function t(n){return n&&n.type===e}}function Dp(e){return t;function t(n,r,i){return!!(N7(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function M7(){return!0}function N7(e){return e!==null&&typeof e=="object"&&"type"in e}const t4=[],I7=!0,_1=!1,D7="skip";function n4(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ip(i),s=r?-1:1;a(e,void 0,[])();function a(u,c,f){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=t4,x,b,k;if((!t||o(u,c,f[f.length-1]||void 0))&&(g=O7(n(u,f)),g[0]===_1))return g;if("children"in u&&u.children){const C=u;if(C.children&&g[0]!==D7)for(b=(r?C.children.length:-1)+s,k=f.concat(C);b>-1&&b<C.children.length;){const _=C.children[b];if(x=a(_,b,k)(),x[0]===_1)return x;b=typeof x[1]=="number"?x[1]:b+s}}return g}}}function O7(e){return Array.isArray(e)?e:typeof e=="number"?[I7,e]:e==null?t4:[e]}function tx(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),n4(e,o,a,i);function a(u,c){const f=c[c.length-1],h=f?f.children.indexOf(u):void 0;return s(u,h,f)}}const T1={}.hasOwnProperty,R7={};function P7(e,t){const n=t||R7,r=new Map,i=new Map,o=new Map,s={...x7,...n.handlers},a={all:c,applyData:z7,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:j7,wrap:F7};return tx(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,m=String(f.identifier).toUpperCase();h.has(m)||h.set(m,f)}}),a;function u(f,h){const m=f.type,g=a.handlers[m];if(T1.call(a.handlers,m)&&g)return g(a,f,h);if(a.options.passThrough&&a.options.passThrough.includes(m)){if("children"in f){const{children:b,...k}=f,C=Ch(k);return C.children=a.all(f),C}return Ch(f)}return(a.options.unknownHandler||L7)(a,f,h)}function c(f){const h=[];if("children"in f){const m=f.children;let g=-1;for(;++g<m.length;){const x=a.one(m[g],f);if(x){if(g&&m[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=w2(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=w2(b.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function j7(e,t){e.position&&(t.position=Sz(e))}function z7(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Ch(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function L7(e,t){const n=t.data||{},r="value"in t&&!(T1.call(n,"hProperties")||T1.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 F7(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
239
- `});++r<e.length;)r&&n.push({type:"text",value:`
240
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
241
- `}),n}function w2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function C2(e,t){const n=P7(e,t),r=n.one(e,void 0),i=E7(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
242
- `},i),o}function $7(e,t){return e&&"run"in e?async function(n,r){const i=C2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return C2(n,{file:r,...e||t})}}function S2(e){if(e)throw e}var J0,E2;function B7(){if(E2)return J0;E2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var f=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!f&&!h)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},s=function(c,f){n&&f.name==="__proto__"?n(c,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):c[f.name]=f.newValue},a=function(c,f){if(f==="__proto__")if(e.call(c,f)){if(r)return r(c,f).value}else return;return c[f]};return J0=function u(){var c,f,h,m,g,x,b=arguments[0],k=1,C=arguments.length,_=!1;for(typeof b=="boolean"&&(_=b,b=arguments[1]||{},k=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});k<C;++k)if(c=arguments[k],c!=null)for(f in c)h=a(b,f),m=a(c,f),b!==m&&(_&&m&&(o(m)||(g=i(m)))?(g?(g=!1,x=h&&i(h)?h:[]):x=h&&o(h)?h:{},s(b,{name:f,newValue:u(_,x,m)})):typeof m<"u"&&s(b,{name:f,newValue:m}));return b},J0}var U7=B7();const K0=ja(U7);function A1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function V7(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...c){const f=e[++o];let h=-1;if(u){s(u);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,f?H7(f,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function H7(e,t){let n;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ki={basename:W7,dirname:q7,extname:Z7,join:J7,sep:"/"};function W7(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');id(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function q7(e){if(id(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Z7(e){id(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function J7(...e){let t=-1,n;for(;++t<e.length;)id(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":K7(n)}function K7(e){id(e);const t=e.codePointAt(0)===47;let n=G7(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function G7(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function id(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Y7={cwd:Q7};function Q7(){return"/"}function M1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function X7(e){if(typeof e=="string")e=new URL(e);else if(!M1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return e$(e)}function e$(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const G0=["history","path","basename","stem","extname","dirname"];class r4{constructor(t){let n;t?M1(t)?n={path:t}:typeof t=="string"||t$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Y7.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<G0.length;){const o=G0[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)G0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ki.basename(this.path):void 0}set basename(t){Q0(t,"basename"),Y0(t,"basename"),this.path=Ki.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ki.dirname(this.path):void 0}set dirname(t){_2(this.basename,"dirname"),this.path=Ki.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ki.extname(this.path):void 0}set extname(t){if(Y0(t,"extname"),_2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ki.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){M1(t)&&(t=X7(t)),Q0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ki.basename(this.path,this.extname):void 0}set stem(t){Q0(t,"stem"),Y0(t,"stem"),this.path=Ki.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new fr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Y0(e,t){if(e&&e.includes(Ki.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ki.sep+"`")}function Q0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function t$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const n$=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),r$={}.hasOwnProperty;class nx extends n${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=V7()}copy(){const t=new nx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(K0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(tg("data",this.frozen),this.namespace[t]=n,this):r$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(tg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Mf(t),r=this.parser||this.Parser;return X0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),X0("process",this.parser||this.Parser),eg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Mf(t),u=r.parse(a);r.run(u,a,function(f,h,m){if(f||!h||!m)return c(f);const g=h,x=r.stringify(g,m);s$(x)?m.value=x:m.result=x,c(f,m)});function c(f,h){f||!h?s(f):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),X0("processSync",this.parser||this.Parser),eg("processSync",this.compiler||this.Compiler),this.process(t,i),A2("processSync","process",n),r;function i(o,s){n=!0,S2(o),r=s}}run(t,n,r){T2(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const u=Mf(n);i.run(t,u,c);function c(f,h,m){const g=h||t;f?a(f):s?s(g):r(void 0,g,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),A2("runSync","run",r),i;function o(s,a){S2(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Mf(n),i=this.compiler||this.Compiler;return eg("stringify",i),T2(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(tg("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...h]=c;u(f,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=K0(!0,i.settings,c.settings))}function a(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const h=c[f];o(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,f){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===c){m=h;break}if(m===-1)r.push([c,...f]);else if(f.length>0){let[g,...x]=f;const b=r[m][1];A1(b)&&A1(g)&&(g=K0(!0,b,g)),r[m]=[c,g,...x]}}}}const i$=new nx().freeze();function X0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function eg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function T2(e){if(!A1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function A2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mf(e){return o$(e)?e:new r4(e)}function o$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s$(e){return typeof e=="string"||a$(e)}function a$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",M2=[],N2={allowDangerousHtml:!0},u$=/^(https?|ircs?|mailto|xmpp)$/i,c$=[{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 cc(e){const t=d$(e),n=f$(e);return h$(t.runSync(t.parse(n),n),e)}function d$(e){const t=e.rehypePlugins||M2,n=e.remarkPlugins||M2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...N2}:N2;return i$().use(qF).use(n).use($7,r).use(t)}function f$(e){const t=e.children||"",n=new r4;return typeof t=="string"&&(n.value=t),n}function h$(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||p$;for(const f of c$)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+l$+f.id,void 0);return tx(e,c),Mz(e,{Fragment:v.Fragment,components:i,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function c(f,h,m){if(f.type==="raw"&&m&&typeof h=="number")return s?m.children.splice(h,1):m.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let g;for(g in W0)if(Object.hasOwn(W0,g)&&Object.hasOwn(f.properties,g)){const x=f.properties[g],b=W0[g];(b===null||b.includes(f.tagName))&&(f.properties[g]=u(String(x||""),g,f))}}if(f.type==="element"){let g=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(f,h,m)),g&&m&&typeof h=="number")return a&&f.children?m.children.splice(h,1,...f.children):m.children.splice(h,1),h}}}function p$(e){const 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||u$.test(e.slice(0,t))?e:""}function I2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function m$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function g$(e,t,n){const i=Ip((n||{}).ignore||[]),o=y$(t);let s=-1;for(;++s<o.length;)n4(e,"text",a);function a(c,f){let h=-1,m;for(;++h<f.length;){const g=f[h],x=m?m.children:void 0;if(i(g,x?x.indexOf(g):void 0,m))return;m=g}if(m)return u(c,f)}function u(c,f){const h=f[f.length-1],m=o[s][0],g=o[s][1];let x=0;const k=h.children.indexOf(c);let C=!1,_=[];m.lastIndex=0;let E=m.exec(c.value);for(;E;){const I=E.index,N={index:E.index,input:E.input,stack:[...f,c]};let M=g(...E,N);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=I+1:(x!==I&&_.push({type:"text",value:c.value.slice(x,I)}),Array.isArray(M)?_.push(...M):M&&_.push(M),x=I+E[0].length,C=!0),!m.global)break;E=m.exec(c.value)}return C?(x<c.value.length&&_.push({type:"text",value:c.value.slice(x)}),h.children.splice(k,1,..._)):_=[c],k+_.length}}function y$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([x$(i[0]),b$(i[1])])}return t}function x$(e){return typeof e=="string"?new RegExp(m$(e),"g"):e}function b$(e){return typeof e=="function"?e:function(){return e}}const ng="phrasing",rg=["autolink","link","image","label"];function v$(){return{transforms:[T$],enter:{literalAutolink:w$,literalAutolinkEmail:ig,literalAutolinkHttp:ig,literalAutolinkWww:ig},exit:{literalAutolink:_$,literalAutolinkEmail:E$,literalAutolinkHttp:C$,literalAutolinkWww:S$}}}function k$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ng,notInConstruct:rg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ng,notInConstruct:rg},{character:":",before:"[ps]",after:"\\/",inConstruct:ng,notInConstruct:rg}]}}function w$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ig(e){this.config.enter.autolinkProtocol.call(this,e)}function C$(e){this.config.exit.autolinkProtocol.call(this,e)}function S$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function E$(e){this.config.exit.autolinkEmail.call(this,e)}function _$(e){this.exit(e)}function T$(e){g$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,A$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),M$]],{ignore:["link","linkReference"]})}function A$(e,t,n,r,i){let o="";if(!i4(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!N$(n)))return!1;const s=I$(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function M$(e,t,n,r){return!i4(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function N$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function I$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=I2(e,"(");let o=I2(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function i4(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Na(n)||Ap(n))&&(!t||n!==47)}o4.peek=$$;function D$(){this.buffer()}function O$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function R$(){this.buffer()}function P$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function j$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Bi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function z$(e){this.exit(e)}function L$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Bi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function F$(e){this.exit(e)}function $$(){return"["}function o4(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function B$(){return{enter:{gfmFootnoteCallString:D$,gfmFootnoteCall:O$,gfmFootnoteDefinitionLabelString:R$,gfmFootnoteDefinition:P$},exit:{gfmFootnoteCallString:j$,gfmFootnoteCall:z$,gfmFootnoteDefinitionLabelString:L$,gfmFootnoteDefinition:F$}}}function U$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:o4},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let u=a.move("[^");const c=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
243
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?s4:V$))),c(),u}}function V$(e,t,n){return t===0?e:s4(e,t,n)}function s4(e,t,n){return(n?"":" ")+e}const H$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];a4.peek=K$;function W$(){return{canContainEols:["delete"],enter:{strikethrough:Z$},exit:{strikethrough:J$}}}function q$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:H$}],handlers:{delete:a4}}}function Z$(e){this.enter({type:"delete",children:[]},e)}function J$(e){this.exit(e)}function a4(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function K$(){return"~"}function G$(e){return e.length}function Y$(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||G$,o=[],s=[],a=[],u=[];let c=0,f=-1;for(;++f<e.length;){const b=[],k=[];let C=-1;for(e[f].length>c&&(c=e[f].length);++C<e[f].length;){const _=Q$(e[f][C]);if(n.alignDelimiters!==!1){const E=i(_);k[C]=E,(u[C]===void 0||E>u[C])&&(u[C]=E)}b.push(_)}s[f]=b,a[f]=k}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)o[h]=D2(r[h]);else{const b=D2(r);for(;++h<c;)o[h]=b}h=-1;const m=[],g=[];for(;++h<c;){const b=o[h];let k="",C="";b===99?(k=":",C=":"):b===108?k=":":b===114&&(C=":");let _=n.alignDelimiters===!1?1:Math.max(1,u[h]-k.length-C.length);const E=k+"-".repeat(_)+C;n.alignDelimiters!==!1&&(_=k.length+_+C.length,_>u[h]&&(u[h]=_),g[h]=_),m[h]=E}s.splice(1,0,m),a.splice(1,0,g),f=-1;const x=[];for(;++f<s.length;){const b=s[f],k=a[f];h=-1;const C=[];for(;++h<c;){const _=b[h]||"";let E="",I="";if(n.alignDelimiters!==!1){const N=u[h]-(k[h]||0),M=o[h];M===114?E=" ".repeat(N):M===99?N%2?(E=" ".repeat(N/2+.5),I=" ".repeat(N/2-.5)):(E=" ".repeat(N/2),I=E):I=" ".repeat(N)}n.delimiterStart!==!1&&!h&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||h)&&C.push(" "),n.alignDelimiters!==!1&&C.push(E),C.push(_),n.alignDelimiters!==!1&&C.push(I),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||h!==c-1)&&C.push("|")}x.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return x.join(`
244
- `)}function Q$(e){return e==null?"":String(e)}function D2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function X$(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),eB);return i(),s}function eB(e,t,n){return">"+(n?"":" ")+e}function tB(e,t){return O2(e,t.inConstruct,!0)&&!O2(e,t.notInConstruct,!1)}function O2(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 R2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
245
- `&&tB(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
246
- `}function nB(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function rB(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iB(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function oB(e,t,n,r){const i=iB(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(rB(e,n)){const h=n.enter("codeIndented"),m=n.indentLines(o,sB);return h(),m}const a=n.createTracker(r),u=i.repeat(Math.max(nB(o,i)+1,3)),c=n.enter("codeFenced");let f=a.move(u);if(e.lang){const h=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
247
- `,encode:["`"],...a.current()})),h()}return f+=a.move(`
248
- `),o&&(f+=a.move(o+`
249
- `)),f+=a.move(u),c(),f}function sB(e,t,n){return(n?"":" ")+e}function rx(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aB(e,t,n,r){const i=rx(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
250
- `,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),s(),c}function lB(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Sh(e,t,n){const r=Fl(e),i=Fl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}l4.peek=uB;function l4(e,t,n,r){const i=lB(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=Sh(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Pc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),m=Sh(r.after.charCodeAt(0),h,i);m.inside&&(u=u.slice(0,-1)+Pc(h));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},a+u+g}function uB(e,t,n){return n.options.emphasis||"*"}function cB(e,t){let n=!1;return tx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,_1}),!!((!e.depth||e.depth<3)&&Jy(e)&&(t.options.setext||n))}function dB(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(cB(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),m=n.containerPhrasing(e,{...o.current(),before:`
251
- `,after:`
252
- `});return h(),f(),m+`
253
- `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
254
- `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
255
- `,...o.current()});return/^[\t ]/.test(c)&&(c=Pc(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),a(),c}u4.peek=fB;function u4(e){return e.value||""}function fB(){return"<"}c4.peek=hB;function c4(e,t,n,r){const i=rx(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),c+=u.move(")"),s(),c}function hB(){return"!"}d4.peek=pB;function d4(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const c=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function pB(){return"!"}f4.peek=mB;function f4(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function mB(){return"`"}function h4(e,t){const n=Jy(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))}p4.peek=gB;function p4(e,t,n,r){const i=rx(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(h4(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),n.stack=f,h}a=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),u()),c+=s.move(")"),a(),c}function gB(e,t,n){return h4(e,n)?"<":"["}m4.peek=yB;function m4(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function yB(){return"["}function ix(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xB(e){const t=ix(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bB(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function g4(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vB(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?bB(n):ix(n);const a=e.ordered?s==="."?")":".":xB(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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&&(u=!0),g4(n)===s&&f){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function kB(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wB(e,t,n,r){const i=kB(n);let o=n.bulletCurrent||ix(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),f);return u(),c;function f(h,m,g){return m?(g?"":" ".repeat(s))+h:(g?o:o+" ".repeat(s-o.length))+h}}function CB(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const SB=Ip(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EB(e,t,n,r){return(e.children.some(function(s){return SB(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function _B(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}y4.peek=TB;function y4(e,t,n,r){const i=_B(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=Sh(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Pc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),m=Sh(r.after.charCodeAt(0),h,i);m.inside&&(u=u.slice(0,-1)+Pc(h));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},a+u+g}function TB(e,t,n){return n.options.strong||"*"}function AB(e,t,n,r){return n.safe(e.value,r)}function MB(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function NB(e,t,n){const r=(g4(n)+(n.options.ruleSpaces?" ":"")).repeat(MB(n));return n.options.ruleSpaces?r.slice(0,-1):r}const x4={blockquote:X$,break:R2,code:oB,definition:aB,emphasis:l4,hardBreak:R2,heading:dB,html:u4,image:c4,imageReference:d4,inlineCode:f4,link:p4,linkReference:m4,list:vB,listItem:wB,paragraph:CB,root:EB,strong:y4,text:AB,thematicBreak:NB};function IB(){return{enter:{table:DB,tableData:P2,tableHeader:P2,tableRow:RB},exit:{codeText:PB,table:OB,tableData:og,tableHeader:og,tableRow:og}}}function DB(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function OB(e){this.exit(e),this.data.inTable=void 0}function RB(e){this.enter({type:"tableRow",children:[]},e)}function og(e){this.exit(e)}function P2(e){this.enter({type:"tableCell",children:[]},e)}function PB(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jB));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function jB(e,t){return t==="|"?t:e}function zB(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
256
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:u,tableRow:a}};function s(g,x,b,k){return c(f(g,b,k),g.align)}function a(g,x,b,k){const C=h(g,b,k),_=c([C]);return _.slice(0,_.indexOf(`
257
- `))}function u(g,x,b,k){const C=b.enter("tableCell"),_=b.enter("phrasing"),E=b.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),E}function c(g,x){return Y$(g,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(g,x,b){const k=g.children;let C=-1;const _=[],E=x.enter("table");for(;++C<k.length;)_[C]=h(k[C],x,b);return E(),_}function h(g,x,b){const k=g.children;let C=-1;const _=[],E=x.enter("tableRow");for(;++C<k.length;)_[C]=u(k[C],g,x,b);return E(),_}function m(g,x,b){let k=x4.inlineCode(g,x,b);return b.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function LB(){return{exit:{taskListCheckValueChecked:j2,taskListCheckValueUnchecked:j2,paragraph:$B}}}function FB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BB}}}function j2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function $B(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function BB(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=x4.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function UB(){return[v$(),B$(),W$(),IB(),LB()]}function VB(e){return{extensions:[k$(),U$(e),q$(),zB(e),FB()]}}const HB={tokenize:GB,partial:!0},b4={tokenize:YB,partial:!0},v4={tokenize:QB,partial:!0},k4={tokenize:XB,partial:!0},WB={tokenize:eU,partial:!0},w4={name:"wwwAutolink",tokenize:JB,previous:S4},C4={name:"protocolAutolink",tokenize:KB,previous:E4},$o={name:"emailAutolink",tokenize:ZB,previous:_4},lo={};function qB(){return{text:lo}}let ha=48;for(;ha<123;)lo[ha]=$o,ha++,ha===58?ha=65:ha===91&&(ha=97);lo[43]=$o;lo[45]=$o;lo[46]=$o;lo[95]=$o;lo[72]=[$o,C4];lo[104]=[$o,C4];lo[87]=[$o,w4];lo[119]=[$o,w4];function ZB(e,t,n){const r=this;let i,o;return s;function s(h){return!N1(h)||!_4.call(r,r.previous)||ox(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return N1(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(WB,f,c)(h):h===45||h===95||cr(h)?(o=!0,e.consume(h),u):f(h)}function c(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&wr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function JB(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!S4.call(r,r.previous)||ox(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(HB,e.attempt(b4,e.attempt(v4,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function KB(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&E4.call(r,r.previous)&&!ox(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(wr(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?c:(o=!0,u)):n(h)}function c(h){return h===null||kh(h)||Qt(h)||Na(h)||Ap(h)?n(h):e.attempt(b4,e.attempt(v4,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function GB(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function YB(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(k4,u,a)(c):c===null||Qt(c)||Na(c)||c!==45&&Ap(c)?u(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function QB(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(k4,t,o)(s):s===null||Qt(s)||Na(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function XB(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Qt(a)||Na(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Qt(a)||Na(a)?t(a):r(a)}function o(a){return wr(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):wr(a)?(e.consume(a),s):n(a)}}function eU(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return cr(o)?n(o):t(o)}}function S4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qt(e)}function E4(e){return!wr(e)}function _4(e){return!(e===47||N1(e))}function N1(e){return e===43||e===45||e===46||e===95||cr(e)}function ox(e){let t=e.length,n=!1;for(;t--;){const 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}const tU={tokenize:uU,partial:!0};function nU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sU,continuation:{tokenize:aU},exit:lU}},text:{91:{name:"gfmFootnoteCall",tokenize:oU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rU,resolveTo:iU}}}}function rU(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const c=Bi(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function iU(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const 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++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function oU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(o>999||h===93&&!s||h===null||h===91||Qt(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(Bi(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Qt(h)||(s=!0),o++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function sU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(s>999||x===93&&!a||x===null||x===91||Qt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=Bi(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Qt(x)||(a=!0),s++,e.consume(x),x===92?h:f}function h(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),Bt(e,g,"gfmFootnoteDefinitionWhitespace")):n(x)}function g(x){return t(x)}}function aU(e,t,n){return e.check(rd,t,e.attempt(tU,t,n))}function lU(e){e.exit("gfmFootnoteDefinition")}function uU(e,t,n){const r=this;return Bt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function cU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",f,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",h,a]],g=a.parser.constructs.insideSpan.null;g&&ti(m,m.length,0,Mp(g,s.slice(c+1,u),a)),ti(m,m.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),ti(s,c-1,u-c+3,m),u=c+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const c=this.previous,f=this.events;let h=0;return m;function m(x){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(s.enter("strikethroughSequenceTemporary"),g(x))}function g(x){const b=Fl(c);if(x===126)return h>1?u(x):(s.consume(x),h++,g);if(h<2&&!n)return u(x);const k=s.exit("strikethroughSequenceTemporary"),C=Fl(x);return k._open=!C||C===2&&!!b,k._close=!b||b===2&&!!C,a(x)}}}class dU{constructor(){this.map=[]}add(t,n,r){fU(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function fU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function hU(e,t){let n=!1;const r=[];for(;t<e.length;){const 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"){const o=r.length-1;r[o]=r[o]==="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 pU(){return{flow:{null:{name:"table",tokenize:mU,resolveAll:gU}}}}function mU(e,t,n){const r=this;let i=0,o=0,s;return a;function a(F){let ee=r.events.length-1;for(;ee>-1;){const ue=r.events[ee][1].type;if(ue==="lineEnding"||ue==="linePrefix")ee--;else break}const X=ee>-1?r.events[ee][1].type:null,Se=X==="tableHead"||X==="tableRow"?M:u;return Se===M&&r.parser.lazy[r.now().line]?n(F):Se(F)}function u(F){return e.enter("tableHead"),e.enter("tableRow"),c(F)}function c(F){return F===124||(s=!0,o+=1),f(F)}function f(F){return F===null?n(F):pt(F)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):Pt(F)?Bt(e,f,"whitespace")(F):(o+=1,s&&(s=!1,i+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(F)))}function h(F){return F===null||F===124||Qt(F)?(e.exit("data"),f(F)):(e.consume(F),F===92?m:h)}function m(F){return F===92||F===124?(e.consume(F),h):h(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),s=!1,Pt(F)?Bt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):x(F))}function x(F){return F===45||F===58?k(F):F===124?(s=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),b):N(F)}function b(F){return Pt(F)?Bt(e,k,"whitespace")(F):k(F)}function k(F){return F===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(o+=1,C(F)):F===null||pt(F)?I(F):N(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),_(F)):N(F)}function _(F){return F===45?(e.consume(F),_):F===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(F))}function E(F){return Pt(F)?Bt(e,I,"whitespace")(F):I(F)}function I(F){return F===124?x(F):F===null||pt(F)?!s||i!==o?N(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):N(F)}function N(F){return n(F)}function M(F){return e.enter("tableRow"),j(F)}function j(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):F===null||pt(F)?(e.exit("tableRow"),t(F)):Pt(F)?Bt(e,j,"whitespace")(F):(e.enter("data"),O(F))}function O(F){return F===null||F===124||Qt(F)?(e.exit("data"),j(F)):(e.consume(F),F===92?R:O)}function R(F){return F===92||F===124?(e.consume(F),O):O(F)}}function gU(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,c,f,h;const m=new dU;for(;++n<e.length;){const g=e[n],x=g[1];g[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(z2(m,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Nf(m,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Nf(m,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Nf(m,t,o,i,n,h)):s[1]!==0&&(h=Nf(m,t,s,i,n,h)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&z2(m,t,u,c,f),m.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=hU(t.events,n))}return e}function Nf(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Cl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=Cl(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=Cl(t.events,n[2]),f=Cl(t.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],g=t.events[n[3]];if(m[1].end=Object.assign({},g[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},Cl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function z2(e,t,n,r,i){const o=[],s=Cl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Cl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yU={name:"tasklistCheck",tokenize:bU};function xU(){return{text:{91:yU}}}function bU(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Qt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return pt(u)?t(u):Pt(u)?e.check({tokenize:vU},t,n)(u):n(u)}}function vU(e,t,n){return Bt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kU(e){return z3([qB(),nU(),cU(e),pU(),xU()])}const wU={};function dc(e){const t=this,n=e||wU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kU(n)),o.push(UB()),s.push(VB(n))}const CU="modulepreload",SU=function(e){return"/"+e},L2={},sg=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=s(n.map(c=>{if(c=SU(c),c in L2)return;L2[c]=!0;const f=c.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":CU,f||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((g,x)=>{m.addEventListener("load",g),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var ag={exports:{}},F2;function EU(){return F2||(F2=1,(function(e){(t=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(L,B)=>{for(var Z in B)n(L,Z,{get:B[Z],enumerable:!0})},a=(L,B,Z,se)=>{if(B&&typeof B=="object"||typeof B=="function")for(let we of i(B))!o.call(L,we)&&we!==Z&&n(L,we,{get:()=>B[we],enumerable:!(se=r(B,we))||se.enumerable});return L},u=L=>a(n({},"__esModule",{value:!0}),L),c=(L,B,Z)=>new Promise((se,we)=>{var De=de=>{try{Ue(Z.next(de))}catch(vt){we(vt)}},be=de=>{try{Ue(Z.throw(de))}catch(vt){we(vt)}},Ue=de=>de.done?se(de.value):Promise.resolve(de.value).then(De,be);Ue((Z=Z.apply(L,B)).next())}),f={};s(f,{analyzeMetafile:()=>Vi,analyzeMetafileSync:()=>pr,build:()=>zt,buildSync:()=>go,context:()=>zn,default:()=>gd,formatMessages:()=>Ir,formatMessagesSync:()=>li,initialize:()=>pd,stop:()=>ru,transform:()=>_i,transformSync:()=>Ln,version:()=>Tt}),t.exports=u(f);function h(L){let B=se=>{if(se===null)Z.write8(0);else if(typeof se=="boolean")Z.write8(1),Z.write8(+se);else if(typeof se=="number")Z.write8(2),Z.write32(se|0);else if(typeof se=="string")Z.write8(3),Z.write(x(se));else if(se instanceof Uint8Array)Z.write8(4),Z.write(se);else if(se instanceof Array){Z.write8(5),Z.write32(se.length);for(let we of se)B(we)}else{let we=Object.keys(se);Z.write8(6),Z.write32(we.length);for(let De of we)Z.write(x(De)),B(se[De])}},Z=new g;return Z.write32(0),Z.write32(L.id<<1|+!L.isRequest),B(L.value),_(Z.buf,Z.len-4,0),Z.buf.subarray(0,Z.len)}function m(L){let B=()=>{switch(Z.read8()){case 0:return null;case 1:return!!Z.read8();case 2:return Z.read32();case 3:return b(Z.read());case 4:return Z.read();case 5:{let be=Z.read32(),Ue=[];for(let de=0;de<be;de++)Ue.push(B());return Ue}case 6:{let be=Z.read32(),Ue={};for(let de=0;de<be;de++)Ue[b(Z.read())]=B();return Ue}default:throw new Error("Invalid packet")}},Z=new g(L),se=Z.read32(),we=(se&1)===0;se>>>=1;let De=B();if(Z.ptr!==L.length)throw new Error("Invalid packet");return{id:se,isRequest:we,value:De}}var g=class{constructor(L=new Uint8Array(1024)){this.buf=L,this.len=0,this.ptr=0}_write(L){if(this.len+L>this.buf.length){let B=new Uint8Array((this.len+L)*2);B.set(this.buf),this.buf=B}return this.len+=L,this.len-L}write8(L){let B=this._write(1);this.buf[B]=L}write32(L){let B=this._write(4);_(this.buf,L,B)}write(L){let B=this._write(4+L.length);_(this.buf,L.length,B),this.buf.set(L,B+4)}_read(L){if(this.ptr+L>this.buf.length)throw new Error("Invalid packet");return this.ptr+=L,this.ptr-L}read8(){return this.buf[this._read(1)]}read32(){return C(this.buf,this._read(4))}read(){let L=this.read32(),B=new Uint8Array(L),Z=this._read(B.length);return B.set(this.buf.subarray(Z,Z+L)),B}},x,b,k;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let L=new TextEncoder,B=new TextDecoder;x=Z=>L.encode(Z),b=Z=>B.decode(Z),k='new TextEncoder().encode("")'}else if(typeof Buffer<"u")x=L=>Buffer.from(L),b=L=>{let{buffer:B,byteOffset:Z,byteLength:se}=L;return Buffer.from(B,Z,se).toString()},k='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(x("")instanceof Uint8Array))throw new Error(`Invariant violation: "${k} instanceof Uint8Array" is incorrectly false
258
-
259
- This indicates that your JavaScript environment is broken. You cannot use
260
- esbuild in this environment because esbuild relies on this invariant. This
261
- is not a problem with esbuild. You need to fix your environment instead.
262
- `);function C(L,B){return L[B++]|L[B++]<<8|L[B++]<<16|L[B++]<<24}function _(L,B,Z){L[Z++]=B,L[Z++]=B>>8,L[Z++]=B>>16,L[Z++]=B>>24}var E=JSON.stringify,I="warning",N="silent";function M(L,B){const Z=[];for(const se of L){if($e(se,B),se.indexOf(",")>=0)throw new Error(`Invalid ${B}: ${se}`);Z.push(se)}return Z.join(",")}var j=()=>null,O=L=>typeof L=="boolean"?null:"a boolean",R=L=>typeof L=="string"?null:"a string",F=L=>L instanceof RegExp?null:"a RegExp object",ee=L=>typeof L=="number"&&L===(L|0)?null:"an integer",X=L=>typeof L=="number"&&L===(L|0)&&L>=0&&L<=65535?null:"a valid port number",Se=L=>typeof L=="function"?null:"a function",ue=L=>Array.isArray(L)?null:"an array",$=L=>Array.isArray(L)&&L.every(B=>typeof B=="string")?null:"an array of strings",Q=L=>typeof L=="object"&&L!==null&&!Array.isArray(L)?null:"an object",he=L=>typeof L=="object"&&L!==null?null:"an array or an object",te=L=>L instanceof WebAssembly.Module?null:"a WebAssembly.Module",Me=L=>typeof L=="object"&&!Array.isArray(L)?null:"an object or null",D=L=>typeof L=="string"||typeof L=="boolean"?null:"a string or a boolean",W=L=>typeof L=="string"||typeof L=="object"&&L!==null&&!Array.isArray(L)?null:"a string or an object",oe=L=>typeof L=="string"||Array.isArray(L)&&L.every(B=>typeof B=="string")?null:"a string or an array of strings",P=L=>typeof L=="string"||L instanceof Uint8Array?null:"a string or a Uint8Array",tt=L=>typeof L=="string"||L instanceof URL?null:"a string or a URL";function U(L,B,Z,se){let we=L[Z];if(B[Z+""]=!0,we===void 0)return;let De=se(we);if(De!==null)throw new Error(`${E(Z)} must be ${De}`);return we}function ke(L,B,Z){for(let se in L)if(!(se in B))throw new Error(`Invalid option ${Z}: ${E(se)}`)}function _e(L){let B=Object.create(null),Z=U(L,B,"wasmURL",tt),se=U(L,B,"wasmModule",te),we=U(L,B,"worker",O);return ke(L,B,"in initialize() call"),{wasmURL:Z,wasmModule:se,worker:we}}function Pe(L){let B;if(L!==void 0){B=Object.create(null);for(let Z in L){let se=L[Z];if(typeof se=="string"||se===!1)B[Z]=se;else throw new Error(`Expected ${E(Z)} in mangle cache to map to either a string or false`)}}return B}function Ee(L,B,Z,se,we){let De=U(B,Z,"color",O),be=U(B,Z,"logLevel",R),Ue=U(B,Z,"logLimit",ee);De!==void 0?L.push(`--color=${De}`):se&&L.push("--color=true"),L.push(`--log-level=${be||we}`),L.push(`--log-limit=${Ue||0}`)}function $e(L,B,Z){if(typeof L!="string")throw new Error(`Expected value for ${B}${Z!==void 0?" "+E(Z):""} to be a string, got ${typeof L} instead`);return L}function xt(L,B,Z){let se=U(B,Z,"legalComments",R),we=U(B,Z,"sourceRoot",R),De=U(B,Z,"sourcesContent",O),be=U(B,Z,"target",oe),Ue=U(B,Z,"format",R),de=U(B,Z,"globalName",R),vt=U(B,Z,"mangleProps",F),Ct=U(B,Z,"reserveProps",F),ct=U(B,Z,"mangleQuoted",O),Lt=U(B,Z,"minify",O),kt=U(B,Z,"minifySyntax",O),wt=U(B,Z,"minifyWhitespace",O),Dt=U(B,Z,"minifyIdentifiers",O),Ge=U(B,Z,"lineLimit",ee),sn=U(B,Z,"drop",$),Je=U(B,Z,"dropLabels",$),Ze=U(B,Z,"charset",R),Oe=U(B,Z,"treeShaking",O),fe=U(B,Z,"ignoreAnnotations",O),G=U(B,Z,"jsx",R),le=U(B,Z,"jsxFactory",R),ae=U(B,Z,"jsxFragment",R),Le=U(B,Z,"jsxImportSource",R),Be=U(B,Z,"jsxDev",O),ce=U(B,Z,"jsxSideEffects",O),ye=U(B,Z,"define",Q),Fe=U(B,Z,"logOverride",Q),H=U(B,Z,"supported",Q),ne=U(B,Z,"pure",$),Re=U(B,Z,"keepNames",O),ze=U(B,Z,"platform",R),Ye=U(B,Z,"tsconfigRaw",W),Gt=U(B,Z,"absPaths",$);if(se&&L.push(`--legal-comments=${se}`),we!==void 0&&L.push(`--source-root=${we}`),De!==void 0&&L.push(`--sources-content=${De}`),be&&L.push(`--target=${M(Array.isArray(be)?be:[be],"target")}`),Ue&&L.push(`--format=${Ue}`),de&&L.push(`--global-name=${de}`),ze&&L.push(`--platform=${ze}`),Ye&&L.push(`--tsconfig-raw=${typeof Ye=="string"?Ye:JSON.stringify(Ye)}`),Lt&&L.push("--minify"),kt&&L.push("--minify-syntax"),wt&&L.push("--minify-whitespace"),Dt&&L.push("--minify-identifiers"),Ge&&L.push(`--line-limit=${Ge}`),Ze&&L.push(`--charset=${Ze}`),Oe!==void 0&&L.push(`--tree-shaking=${Oe}`),fe&&L.push("--ignore-annotations"),sn)for(let He of sn)L.push(`--drop:${$e(He,"drop")}`);if(Je&&L.push(`--drop-labels=${M(Je,"drop label")}`),Gt&&L.push(`--abs-paths=${M(Gt,"abs paths")}`),vt&&L.push(`--mangle-props=${dt(vt)}`),Ct&&L.push(`--reserve-props=${dt(Ct)}`),ct!==void 0&&L.push(`--mangle-quoted=${ct}`),G&&L.push(`--jsx=${G}`),le&&L.push(`--jsx-factory=${le}`),ae&&L.push(`--jsx-fragment=${ae}`),Le&&L.push(`--jsx-import-source=${Le}`),Be&&L.push("--jsx-dev"),ce&&L.push("--jsx-side-effects"),ye)for(let He in ye){if(He.indexOf("=")>=0)throw new Error(`Invalid define: ${He}`);L.push(`--define:${He}=${$e(ye[He],"define",He)}`)}if(Fe)for(let He in Fe){if(He.indexOf("=")>=0)throw new Error(`Invalid log override: ${He}`);L.push(`--log-override:${He}=${$e(Fe[He],"log override",He)}`)}if(H)for(let He in H){if(He.indexOf("=")>=0)throw new Error(`Invalid supported: ${He}`);const Rt=H[He];if(typeof Rt!="boolean")throw new Error(`Expected value for supported ${E(He)} to be a boolean, got ${typeof Rt} instead`);L.push(`--supported:${He}=${Rt}`)}if(ne)for(let He of ne)L.push(`--pure:${$e(He,"pure")}`);Re&&L.push("--keep-names")}function on(L,B,Z,se,we){var De;let be=[],Ue=[],de=Object.create(null),vt=null,Ct=null;Ee(be,B,de,Z,se),xt(be,B,de);let ct=U(B,de,"sourcemap",D),Lt=U(B,de,"bundle",O),kt=U(B,de,"splitting",O),wt=U(B,de,"preserveSymlinks",O),Dt=U(B,de,"metafile",O),Ge=U(B,de,"outfile",R),sn=U(B,de,"outdir",R),Je=U(B,de,"outbase",R),Ze=U(B,de,"tsconfig",R),Oe=U(B,de,"resolveExtensions",$),fe=U(B,de,"nodePaths",$),G=U(B,de,"mainFields",$),le=U(B,de,"conditions",$),ae=U(B,de,"external",$),Le=U(B,de,"packages",R),Be=U(B,de,"alias",Q),ce=U(B,de,"loader",Q),ye=U(B,de,"outExtension",Q),Fe=U(B,de,"publicPath",R),H=U(B,de,"entryNames",R),ne=U(B,de,"chunkNames",R),Re=U(B,de,"assetNames",R),ze=U(B,de,"inject",$),Ye=U(B,de,"banner",Q),Gt=U(B,de,"footer",Q),He=U(B,de,"entryPoints",he),Rt=U(B,de,"absWorkingDir",R),Et=U(B,de,"stdin",Q),St=(De=U(B,de,"write",O))!=null?De:we,Mn=U(B,de,"allowOverwrite",O),Xt=U(B,de,"mangleCache",Q);if(de.plugins=!0,ke(B,de,`in ${L}() call`),ct&&be.push(`--sourcemap${ct===!0?"":`=${ct}`}`),Lt&&be.push("--bundle"),Mn&&be.push("--allow-overwrite"),kt&&be.push("--splitting"),wt&&be.push("--preserve-symlinks"),Dt&&be.push("--metafile"),Ge&&be.push(`--outfile=${Ge}`),sn&&be.push(`--outdir=${sn}`),Je&&be.push(`--outbase=${Je}`),Ze&&be.push(`--tsconfig=${Ze}`),Le&&be.push(`--packages=${Le}`),Oe&&be.push(`--resolve-extensions=${M(Oe,"resolve extension")}`),Fe&&be.push(`--public-path=${Fe}`),H&&be.push(`--entry-names=${H}`),ne&&be.push(`--chunk-names=${ne}`),Re&&be.push(`--asset-names=${Re}`),G&&be.push(`--main-fields=${M(G,"main field")}`),le&&be.push(`--conditions=${M(le,"condition")}`),ae)for(let at of ae)be.push(`--external:${$e(at,"external")}`);if(Be)for(let at in Be){if(at.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${at}`);be.push(`--alias:${at}=${$e(Be[at],"alias",at)}`)}if(Ye)for(let at in Ye){if(at.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${at}`);be.push(`--banner:${at}=${$e(Ye[at],"banner",at)}`)}if(Gt)for(let at in Gt){if(at.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${at}`);be.push(`--footer:${at}=${$e(Gt[at],"footer",at)}`)}if(ze)for(let at of ze)be.push(`--inject:${$e(at,"inject")}`);if(ce)for(let at in ce){if(at.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${at}`);be.push(`--loader:${at}=${$e(ce[at],"loader",at)}`)}if(ye)for(let at in ye){if(at.indexOf("=")>=0)throw new Error(`Invalid out extension: ${at}`);be.push(`--out-extension:${at}=${$e(ye[at],"out extension",at)}`)}if(He)if(Array.isArray(He))for(let at=0,Zr=He.length;at<Zr;at++){let mr=He[at];if(typeof mr=="object"&&mr!==null){let Dr=Object.create(null),gr=U(mr,Dr,"in",R),Or=U(mr,Dr,"out",R);if(ke(mr,Dr,"in entry point at index "+at),gr===void 0)throw new Error('Missing property "in" for entry point at index '+at);if(Or===void 0)throw new Error('Missing property "out" for entry point at index '+at);Ue.push([Or,gr])}else Ue.push(["",$e(mr,"entry point at index "+at)])}else for(let at in He)Ue.push([at,$e(He[at],"entry point",at)]);if(Et){let at=Object.create(null),Zr=U(Et,at,"contents",P),mr=U(Et,at,"resolveDir",R),Dr=U(Et,at,"sourcefile",R),gr=U(Et,at,"loader",R);ke(Et,at,'in "stdin" object'),Dr&&be.push(`--sourcefile=${Dr}`),gr&&be.push(`--loader=${gr}`),mr&&(Ct=mr),typeof Zr=="string"?vt=x(Zr):Zr instanceof Uint8Array&&(vt=Zr)}let Ni=[];if(fe)for(let at of fe)at+="",Ni.push(at);return{entries:Ue,flags:be,write:St,stdinContents:vt,stdinResolveDir:Ct,absWorkingDir:Rt,nodePaths:Ni,mangleCache:Pe(Xt)}}function Yn(L,B,Z,se){let we=[],De=Object.create(null);Ee(we,B,De,Z,se),xt(we,B,De);let be=U(B,De,"sourcemap",D),Ue=U(B,De,"sourcefile",R),de=U(B,De,"loader",R),vt=U(B,De,"banner",R),Ct=U(B,De,"footer",R),ct=U(B,De,"mangleCache",Q);return ke(B,De,`in ${L}() call`),be&&we.push(`--sourcemap=${be===!0?"external":be}`),Ue&&we.push(`--sourcefile=${Ue}`),de&&we.push(`--loader=${de}`),vt&&we.push(`--banner=${vt}`),Ct&&we.push(`--footer=${Ct}`),{flags:we,mangleCache:Pe(ct)}}function Qn(L){const B={},Z={didClose:!1,reason:""};let se={},we=0,De=0,be=new Uint8Array(16*1024),Ue=0,de=Ze=>{let Oe=Ue+Ze.length;if(Oe>be.length){let G=new Uint8Array(Oe*2);G.set(be),be=G}be.set(Ze,Ue),Ue+=Ze.length;let fe=0;for(;fe+4<=Ue;){let G=C(be,fe);if(fe+4+G>Ue)break;fe+=4,wt(be.subarray(fe,fe+G)),fe+=G}fe>0&&(be.copyWithin(0,fe,Ue),Ue-=fe)},vt=Ze=>{Z.didClose=!0,Ze&&(Z.reason=": "+(Ze.message||Ze));const Oe="The service was stopped"+Z.reason;for(let fe in se)se[fe](Oe,null);se={}},Ct=(Ze,Oe,fe)=>{if(Z.didClose)return fe("The service is no longer running"+Z.reason,null);let G=we++;se[G]=(le,ae)=>{try{fe(le,ae)}finally{Ze&&Ze.unref()}},Ze&&Ze.ref(),L.writeToStdin(h({id:G,isRequest:!0,value:Oe}))},ct=(Ze,Oe)=>{if(Z.didClose)throw new Error("The service is no longer running"+Z.reason);L.writeToStdin(h({id:Ze,isRequest:!1,value:Oe}))},Lt=(Ze,Oe)=>c(null,null,function*(){try{if(Oe.command==="ping"){ct(Ze,{});return}if(typeof Oe.key=="number"){const fe=B[Oe.key];if(!fe)return;const G=fe[Oe.command];if(G){yield G(Ze,Oe);return}}throw new Error("Invalid command: "+Oe.command)}catch(fe){const G=[Ar(fe,L,null,void 0,"")];try{ct(Ze,{errors:G})}catch{}}}),kt=!0,wt=Ze=>{if(kt){kt=!1;let fe=String.fromCharCode(...Ze);if(fe!=="0.27.3")throw new Error(`Cannot start service: Host version "0.27.3" does not match binary version ${E(fe)}`);return}let Oe=m(Ze);if(Oe.isRequest)Lt(Oe.id,Oe.value);else{let fe=se[Oe.id];delete se[Oe.id],Oe.value.error?fe(Oe.value.error,{}):fe(null,Oe.value)}};return{readFromStdout:de,afterClose:vt,service:{buildOrContext:({callName:Ze,refs:Oe,options:fe,isTTY:G,defaultWD:le,callback:ae})=>{let Le=0;const Be=De++,ce={},ye={ref(){++Le===1&&Oe&&Oe.ref()},unref(){--Le===0&&(delete B[Be],Oe&&Oe.unref())}};B[Be]=ce,ye.ref(),Gs(Ze,Be,Ct,ct,ye,L,ce,fe,G,le,(Fe,H)=>{try{ae(Fe,H)}finally{ye.unref()}})},transform:({callName:Ze,refs:Oe,input:fe,options:G,isTTY:le,fs:ae,callback:Le})=>{const Be=ho();let ce=ye=>{try{if(typeof fe!="string"&&!(fe instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:Fe,mangleCache:H}=Yn(Ze,G,le,N),ne={command:"transform",flags:Fe,inputFS:ye!==null,input:ye!==null?x(ye):typeof fe=="string"?x(fe):fe};H&&(ne.mangleCache=H),Ct(Oe,ne,(Re,ze)=>{if(Re)return Le(new Error(Re),null);let Ye=ai(ze.errors,Be),Gt=ai(ze.warnings,Be),He=1,Rt=()=>{if(--He===0){let Et={warnings:Gt,code:ze.code,map:ze.map,mangleCache:void 0,legalComments:void 0};"legalComments"in ze&&(Et.legalComments=ze==null?void 0:ze.legalComments),ze.mangleCache&&(Et.mangleCache=ze==null?void 0:ze.mangleCache),Le(null,Et)}};if(Ye.length>0)return Le(Mr("Transform failed",Ye,Gt),null);ze.codeFS&&(He++,ae.readFile(ze.code,(Et,St)=>{Et!==null?Le(Et,null):(ze.code=St,Rt())})),ze.mapFS&&(He++,ae.readFile(ze.map,(Et,St)=>{Et!==null?Le(Et,null):(ze.map=St,Rt())})),Rt()})}catch(Fe){let H=[];try{Ee(H,G,{},le,N)}catch{}const ne=Ar(Fe,L,Be,void 0,"");Ct(Oe,{command:"error",flags:H,error:ne},()=>{ne.detail=Be.load(ne.detail),Le(Mr("Transform failed",[ne],[]),null)})}};if((typeof fe=="string"||fe instanceof Uint8Array)&&fe.length>1024*1024){let ye=ce;ce=()=>ae.writeFile(fe,ye)}ce(null)},formatMessages:({callName:Ze,refs:Oe,messages:fe,options:G,callback:le})=>{if(!G)throw new Error(`Missing second argument in ${Ze}() call`);let ae={},Le=U(G,ae,"kind",R),Be=U(G,ae,"color",O),ce=U(G,ae,"terminalWidth",ee);if(ke(G,ae,`in ${Ze}() call`),Le===void 0)throw new Error(`Missing "kind" in ${Ze}() call`);if(Le!=="error"&&Le!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${Ze}() call`);let ye={command:"format-msgs",messages:Nr(fe,"messages",null,"",ce),isWarning:Le==="warning"};Be!==void 0&&(ye.color=Be),ce!==void 0&&(ye.terminalWidth=ce),Ct(Oe,ye,(Fe,H)=>{if(Fe)return le(new Error(Fe),null);le(null,H.messages)})},analyzeMetafile:({callName:Ze,refs:Oe,metafile:fe,options:G,callback:le})=>{G===void 0&&(G={});let ae={},Le=U(G,ae,"color",O),Be=U(G,ae,"verbose",O);ke(G,ae,`in ${Ze}() call`);let ce={command:"analyze-metafile",metafile:fe};Le!==void 0&&(ce.color=Le),Be!==void 0&&(ce.verbose=Be),Ct(Oe,ce,(ye,Fe)=>{if(ye)return le(new Error(ye),null);le(null,Fe.result)})}}}}function Gs(L,B,Z,se,we,De,be,Ue,de,vt,Ct){const ct=ho(),Lt=L==="context",kt=(Ge,sn)=>{const Je=[];try{Ee(Je,Ue,{},de,I)}catch{}const Ze=Ar(Ge,De,ct,void 0,sn);Z(we,{command:"error",flags:Je,error:Ze},()=>{Ze.detail=ct.load(Ze.detail),Ct(Mr(Lt?"Context failed":"Build failed",[Ze],[]),null)})};let wt;if(typeof Ue=="object"){const Ge=Ue.plugins;if(Ge!==void 0){if(!Array.isArray(Ge))return kt(new Error('"plugins" must be an array'),"");wt=Ge}}if(wt&&wt.length>0){if(De.isSync)return kt(new Error("Cannot use plugins in synchronous API calls"),"");Ys(B,Z,se,we,De,be,Ue,wt,ct).then(Ge=>{if(!Ge.ok)return kt(Ge.error,Ge.pluginName);try{Dt(Ge.requestPlugins,Ge.runOnEndCallbacks,Ge.scheduleOnDisposeCallbacks)}catch(sn){kt(sn,"")}},Ge=>kt(Ge,""));return}try{Dt(null,(Ge,sn)=>sn([],[]),()=>{})}catch(Ge){kt(Ge,"")}function Dt(Ge,sn,Je){const Ze=De.hasFS,{entries:Oe,flags:fe,write:G,stdinContents:le,stdinResolveDir:ae,absWorkingDir:Le,nodePaths:Be,mangleCache:ce}=on(L,Ue,de,I,Ze);if(G&&!De.hasFS)throw new Error('The "write" option is unavailable in this environment');const ye={command:"build",key:B,entries:Oe,flags:fe,write:G,stdinContents:le,stdinResolveDir:ae,absWorkingDir:Le||vt,nodePaths:Be,context:Lt};Ge&&(ye.plugins=Ge),ce&&(ye.mangleCache=ce);const Fe=(Re,ze)=>{const Ye={errors:ai(Re.errors,ct),warnings:ai(Re.warnings,ct),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Gt=Ye.errors.slice(),He=Ye.warnings.slice();Re.outputFiles&&(Ye.outputFiles=Re.outputFiles.map(Ie)),Re.metafile&&(Ye.metafile=JSON.parse(Re.metafile)),Re.mangleCache&&(Ye.mangleCache=Re.mangleCache),Re.writeToStdout!==void 0&&console.log(b(Re.writeToStdout).replace(/\n$/,"")),sn(Ye,(Rt,Et)=>{if(Gt.length>0||Rt.length>0){const St=Mr("Build failed",Gt.concat(Rt),He.concat(Et));return ze(St,null,Rt,Et)}ze(null,Ye,Rt,Et)})};let H,ne;Lt&&(be["on-end"]=(Re,ze)=>new Promise(Ye=>{Fe(ze,(Gt,He,Rt,Et)=>{const St={errors:Rt,warnings:Et};ne&&ne(Gt,He),H=void 0,ne=void 0,se(Re,St),Ye()})})),Z(we,ye,(Re,ze)=>{if(Re)return Ct(new Error(Re),null);if(!Lt)return Fe(ze,(He,Rt)=>(Je(),Ct(He,Rt)));if(ze.errors.length>0)return Ct(Mr("Context failed",ze.errors,ze.warnings),null);let Ye=!1;const Gt={rebuild:()=>(H||(H=new Promise((He,Rt)=>{let Et;ne=(Mn,Xt)=>{Et||(Et=()=>Mn?Rt(Mn):He(Xt))};const St=()=>{Z(we,{command:"rebuild",key:B},(Xt,Ni)=>{Xt?Rt(new Error(Xt)):Et?Et():St()})};St()})),H),watch:(He={})=>new Promise((Rt,Et)=>{if(!De.hasFS)throw new Error('Cannot use the "watch" API in this environment');const St={},Mn=U(He,St,"delay",ee);ke(He,St,"in watch() call");const Xt={command:"watch",key:B};Mn&&(Xt.delay=Mn),Z(we,Xt,Ni=>{Ni?Et(new Error(Ni)):Rt(void 0)})}),serve:(He={})=>new Promise((Rt,Et)=>{if(!De.hasFS)throw new Error('Cannot use the "serve" API in this environment');const St={},Mn=U(He,St,"port",X),Xt=U(He,St,"host",R),Ni=U(He,St,"servedir",R),at=U(He,St,"keyfile",R),Zr=U(He,St,"certfile",R),mr=U(He,St,"fallback",R),Dr=U(He,St,"cors",Q),gr=U(He,St,"onRequest",Se);ke(He,St,"in serve() call");const Or={command:"serve",key:B,onRequest:!!gr};if(Mn!==void 0&&(Or.port=Mn),Xt!==void 0&&(Or.host=Xt),Ni!==void 0&&(Or.servedir=Ni),at!==void 0&&(Or.keyfile=at),Zr!==void 0&&(Or.certfile=Zr),mr!==void 0&&(Or.fallback=mr),Dr){const yo={},jt=U(Dr,yo,"origin",oe);ke(Dr,yo,'on "cors" object'),Array.isArray(jt)?Or.corsOrigin=jt:jt!==void 0&&(Or.corsOrigin=[jt])}Z(we,Or,(yo,jt)=>{if(yo)return Et(new Error(yo));gr&&(be["serve-request"]=(yd,xd)=>{gr(xd.args),se(yd,{})}),Rt(jt)})}),cancel:()=>new Promise(He=>{if(Ye)return He();Z(we,{command:"cancel",key:B},()=>{He()})}),dispose:()=>new Promise(He=>{if(Ye)return He();Ye=!0,Z(we,{command:"dispose",key:B},()=>{He(),Je(),we.unref()})})};we.ref(),Ct(null,Gt)})}}var Ys=(L,B,Z,se,we,De,be,Ue,de)=>c(null,null,function*(){let vt=[],Ct=[],ct={},Lt={},kt=[],wt=0,Dt=0,Ge=[],sn=!1;Ue=[...Ue];for(let Oe of Ue){let fe={};if(typeof Oe!="object")throw new Error(`Plugin at index ${Dt} must be an object`);const G=U(Oe,fe,"name",R);if(typeof G!="string"||G==="")throw new Error(`Plugin at index ${Dt} is missing a name`);try{let le=U(Oe,fe,"setup",Se);if(typeof le!="function")throw new Error("Plugin is missing a setup function");ke(Oe,fe,`on plugin ${E(G)}`);let ae={name:G,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};Dt++;let Be=le({initialOptions:be,resolve:(ce,ye={})=>{if(!sn)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof ce!="string")throw new Error("The path to resolve must be a string");let Fe=Object.create(null),H=U(ye,Fe,"pluginName",R),ne=U(ye,Fe,"importer",R),Re=U(ye,Fe,"namespace",R),ze=U(ye,Fe,"resolveDir",R),Ye=U(ye,Fe,"kind",R),Gt=U(ye,Fe,"pluginData",j),He=U(ye,Fe,"with",Q);return ke(ye,Fe,"in resolve() call"),new Promise((Rt,Et)=>{const St={command:"resolve",path:ce,key:L,pluginName:G};if(H!=null&&(St.pluginName=H),ne!=null&&(St.importer=ne),Re!=null&&(St.namespace=Re),ze!=null&&(St.resolveDir=ze),Ye!=null)St.kind=Ye;else throw new Error('Must specify "kind" when calling "resolve"');Gt!=null&&(St.pluginData=de.store(Gt)),He!=null&&(St.with=re(He,"with")),B(se,St,(Mn,Xt)=>{Mn!==null?Et(new Error(Mn)):Rt({errors:ai(Xt.errors,de),warnings:ai(Xt.warnings,de),path:Xt.path,external:Xt.external,sideEffects:Xt.sideEffects,namespace:Xt.namespace,suffix:Xt.suffix,pluginData:de.load(Xt.pluginData)})})})},onStart(ce){let ye='This error came from the "onStart" callback registered here:',Fe=po(new Error(ye),we,"onStart");vt.push({name:G,callback:ce,note:Fe}),ae.onStart=!0},onEnd(ce){let ye='This error came from the "onEnd" callback registered here:',Fe=po(new Error(ye),we,"onEnd");Ct.push({name:G,callback:ce,note:Fe}),ae.onEnd=!0},onResolve(ce,ye){let Fe='This error came from the "onResolve" callback registered here:',H=po(new Error(Fe),we,"onResolve"),ne={},Re=U(ce,ne,"filter",F),ze=U(ce,ne,"namespace",R);if(ke(ce,ne,`in onResolve() call for plugin ${E(G)}`),Re==null)throw new Error("onResolve() call is missing a filter");let Ye=wt++;ct[Ye]={name:G,callback:ye,note:H},ae.onResolve.push({id:Ye,filter:dt(Re),namespace:ze||""})},onLoad(ce,ye){let Fe='This error came from the "onLoad" callback registered here:',H=po(new Error(Fe),we,"onLoad"),ne={},Re=U(ce,ne,"filter",F),ze=U(ce,ne,"namespace",R);if(ke(ce,ne,`in onLoad() call for plugin ${E(G)}`),Re==null)throw new Error("onLoad() call is missing a filter");let Ye=wt++;Lt[Ye]={name:G,callback:ye,note:H},ae.onLoad.push({id:Ye,filter:dt(Re),namespace:ze||""})},onDispose(ce){kt.push(ce)},esbuild:we.esbuild});Be&&(yield Be),Ge.push(ae)}catch(le){return{ok:!1,error:le,pluginName:G}}}De["on-start"]=(Oe,fe)=>c(null,null,function*(){de.clear();let G={errors:[],warnings:[]};yield Promise.all(vt.map(le=>c(null,[le],function*({name:ae,callback:Le,note:Be}){try{let ce=yield Le();if(ce!=null){if(typeof ce!="object")throw new Error(`Expected onStart() callback in plugin ${E(ae)} to return an object`);let ye={},Fe=U(ce,ye,"errors",ue),H=U(ce,ye,"warnings",ue);ke(ce,ye,`from onStart() callback in plugin ${E(ae)}`),Fe!=null&&G.errors.push(...Nr(Fe,"errors",de,ae,void 0)),H!=null&&G.warnings.push(...Nr(H,"warnings",de,ae,void 0))}}catch(ce){G.errors.push(Ar(ce,we,de,Be&&Be(),ae))}}))),Z(Oe,G)}),De["on-resolve"]=(Oe,fe)=>c(null,null,function*(){let G={},le="",ae,Le;for(let Be of fe.ids)try{({name:le,callback:ae,note:Le}=ct[Be]);let ce=yield ae({path:fe.path,importer:fe.importer,namespace:fe.namespace,resolveDir:fe.resolveDir,kind:fe.kind,pluginData:de.load(fe.pluginData),with:fe.with});if(ce!=null){if(typeof ce!="object")throw new Error(`Expected onResolve() callback in plugin ${E(le)} to return an object`);let ye={},Fe=U(ce,ye,"pluginName",R),H=U(ce,ye,"path",R),ne=U(ce,ye,"namespace",R),Re=U(ce,ye,"suffix",R),ze=U(ce,ye,"external",O),Ye=U(ce,ye,"sideEffects",O),Gt=U(ce,ye,"pluginData",j),He=U(ce,ye,"errors",ue),Rt=U(ce,ye,"warnings",ue),Et=U(ce,ye,"watchFiles",$),St=U(ce,ye,"watchDirs",$);ke(ce,ye,`from onResolve() callback in plugin ${E(le)}`),G.id=Be,Fe!=null&&(G.pluginName=Fe),H!=null&&(G.path=H),ne!=null&&(G.namespace=ne),Re!=null&&(G.suffix=Re),ze!=null&&(G.external=ze),Ye!=null&&(G.sideEffects=Ye),Gt!=null&&(G.pluginData=de.store(Gt)),He!=null&&(G.errors=Nr(He,"errors",de,le,void 0)),Rt!=null&&(G.warnings=Nr(Rt,"warnings",de,le,void 0)),Et!=null&&(G.watchFiles=mo(Et,"watchFiles")),St!=null&&(G.watchDirs=mo(St,"watchDirs"));break}}catch(ce){G={id:Be,errors:[Ar(ce,we,de,Le&&Le(),le)]};break}Z(Oe,G)}),De["on-load"]=(Oe,fe)=>c(null,null,function*(){let G={},le="",ae,Le;for(let Be of fe.ids)try{({name:le,callback:ae,note:Le}=Lt[Be]);let ce=yield ae({path:fe.path,namespace:fe.namespace,suffix:fe.suffix,pluginData:de.load(fe.pluginData),with:fe.with});if(ce!=null){if(typeof ce!="object")throw new Error(`Expected onLoad() callback in plugin ${E(le)} to return an object`);let ye={},Fe=U(ce,ye,"pluginName",R),H=U(ce,ye,"contents",P),ne=U(ce,ye,"resolveDir",R),Re=U(ce,ye,"pluginData",j),ze=U(ce,ye,"loader",R),Ye=U(ce,ye,"errors",ue),Gt=U(ce,ye,"warnings",ue),He=U(ce,ye,"watchFiles",$),Rt=U(ce,ye,"watchDirs",$);ke(ce,ye,`from onLoad() callback in plugin ${E(le)}`),G.id=Be,Fe!=null&&(G.pluginName=Fe),H instanceof Uint8Array?G.contents=H:H!=null&&(G.contents=x(H)),ne!=null&&(G.resolveDir=ne),Re!=null&&(G.pluginData=de.store(Re)),ze!=null&&(G.loader=ze),Ye!=null&&(G.errors=Nr(Ye,"errors",de,le,void 0)),Gt!=null&&(G.warnings=Nr(Gt,"warnings",de,le,void 0)),He!=null&&(G.watchFiles=mo(He,"watchFiles")),Rt!=null&&(G.watchDirs=mo(Rt,"watchDirs"));break}}catch(ce){G={id:Be,errors:[Ar(ce,we,de,Le&&Le(),le)]};break}Z(Oe,G)});let Je=(Oe,fe)=>fe([],[]);Ct.length>0&&(Je=(Oe,fe)=>{c(null,null,function*(){const G=[],le=[];for(const{name:ae,callback:Le,note:Be}of Ct){let ce,ye;try{const Fe=yield Le(Oe);if(Fe!=null){if(typeof Fe!="object")throw new Error(`Expected onEnd() callback in plugin ${E(ae)} to return an object`);let H={},ne=U(Fe,H,"errors",ue),Re=U(Fe,H,"warnings",ue);ke(Fe,H,`from onEnd() callback in plugin ${E(ae)}`),ne!=null&&(ce=Nr(ne,"errors",de,ae,void 0)),Re!=null&&(ye=Nr(Re,"warnings",de,ae,void 0))}}catch(Fe){ce=[Ar(Fe,we,de,Be&&Be(),ae)]}if(ce){G.push(...ce);try{Oe.errors.push(...ce)}catch{}}if(ye){le.push(...ye);try{Oe.warnings.push(...ye)}catch{}}}fe(G,le)})});let Ze=()=>{for(const Oe of kt)setTimeout(()=>Oe(),0)};return sn=!0,{ok:!0,requestPlugins:Ge,runOnEndCallbacks:Je,scheduleOnDisposeCallbacks:Ze}});function ho(){const L=new Map;let B=0;return{clear(){L.clear()},load(Z){return L.get(Z)},store(Z){if(Z===void 0)return-1;const se=B++;return L.set(se,Z),se}}}function po(L,B,Z){let se,we=!1;return()=>{if(we)return se;we=!0;try{let De=(L.stack+"").split(`
263
- `);De.splice(1,1);let be=Ei(B,De,Z);if(be)return se={text:L.message,location:be},se}catch{}}}function Ar(L,B,Z,se,we){let De="Internal error",be=null;try{De=(L&&L.message||L)+""}catch{}try{be=Ei(B,(L.stack+"").split(`
264
- `),"")}catch{}return{id:"",pluginName:we,text:De,location:be,notes:se?[se]:[],detail:Z?Z.store(L):-1}}function Ei(L,B,Z){let se=" at ";if(L.readFileSync&&!B[0].startsWith(se)&&B[1].startsWith(se))for(let we=1;we<B.length;we++){let De=B[we];if(De.startsWith(se))for(De=De.slice(se.length);;){let be=/^(?:new |async )?\S+ \((.*)\)$/.exec(De);if(be){De=be[1];continue}if(be=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(De),be){De=be[1];continue}if(be=/^(\S+):(\d+):(\d+)$/.exec(De),be){let Ue;try{Ue=L.readFileSync(be[1],"utf8")}catch{break}let de=Ue.split(/\r\n|\r|\n|\u2028|\u2029/)[+be[2]-1]||"",vt=+be[3]-1,Ct=de.slice(vt,vt+Z.length)===Z?Z.length:0;return{file:be[1],namespace:"file",line:+be[2],column:x(de.slice(0,vt)).length,length:x(de.slice(vt,vt+Ct)).length,lineText:de+`
265
- `+B.slice(1).join(`
266
- `),suggestion:""}}break}}return null}function Mr(L,B,Z){let se=5;L+=B.length<1?"":` with ${B.length} error${B.length<2?"":"s"}:`+B.slice(0,se+1).map((De,be)=>{if(be===se)return`
267
- ...`;if(!De.location)return`
268
- error: ${De.text}`;let{file:Ue,line:de,column:vt}=De.location,Ct=De.pluginName?`[plugin: ${De.pluginName}] `:"";return`
269
- ${Ue}:${de}:${vt}: ERROR: ${Ct}${De.text}`}).join("");let we=new Error(L);for(const[De,be]of[["errors",B],["warnings",Z]])Object.defineProperty(we,De,{configurable:!0,enumerable:!0,get:()=>be,set:Ue=>Object.defineProperty(we,De,{configurable:!0,enumerable:!0,value:Ue})});return we}function ai(L,B){for(const Z of L)Z.detail=B.load(Z.detail);return L}function Qs(L,B,Z){if(L==null)return null;let se={},we=U(L,se,"file",R),De=U(L,se,"namespace",R),be=U(L,se,"line",ee),Ue=U(L,se,"column",ee),de=U(L,se,"length",ee),vt=U(L,se,"lineText",R),Ct=U(L,se,"suggestion",R);if(ke(L,se,B),vt){const ct=vt.slice(0,(Ue&&Ue>0?Ue:0)+(de&&de>0?de:0)+(Z&&Z>0?Z:80));!/[\x7F-\uFFFF]/.test(ct)&&!/\n/.test(vt)&&(vt=ct)}return{file:we||"",namespace:De||"",line:be||0,column:Ue||0,length:de||0,lineText:vt||"",suggestion:Ct||""}}function Nr(L,B,Z,se,we){let De=[],be=0;for(const Ue of L){let de={},vt=U(Ue,de,"id",R),Ct=U(Ue,de,"pluginName",R),ct=U(Ue,de,"text",R),Lt=U(Ue,de,"location",Me),kt=U(Ue,de,"notes",ue),wt=U(Ue,de,"detail",j),Dt=`in element ${be} of "${B}"`;ke(Ue,de,Dt);let Ge=[];if(kt)for(const sn of kt){let Je={},Ze=U(sn,Je,"text",R),Oe=U(sn,Je,"location",Me);ke(sn,Je,Dt),Ge.push({text:Ze||"",location:Qs(Oe,Dt,we)})}De.push({id:vt||"",pluginName:Ct||se,text:ct||"",location:Qs(Lt,Dt,we),notes:Ge,detail:Z?Z.store(wt):-1}),be++}return De}function mo(L,B){const Z=[];for(const se of L){if(typeof se!="string")throw new Error(`${E(B)} must be an array of strings`);Z.push(se)}return Z}function re(L,B){const Z=Object.create(null);for(const se in L){const we=L[se];if(typeof we!="string")throw new Error(`key ${E(se)} in object ${E(B)} must be a string`);Z[se]=we}return Z}function Ie({path:L,contents:B,hash:Z}){let se=null;return{path:L,contents:B,hash:Z,get text(){const we=this.contents;return(se===null||we!==B)&&(B=we,se=b(we)),se}}}function dt(L){let B=L.source;return L.flags&&(B=`(?${L.flags})${B}`),B}var Tt="0.27.3",zt=L=>Uo().build(L),zn=L=>Uo().context(L),_i=(L,B)=>Uo().transform(L,B),Ir=(L,B)=>Uo().formatMessages(L,B),Vi=(L,B)=>Uo().analyzeMetafile(L,B),go=()=>{throw new Error('The "buildSync" API only works in node')},Ln=()=>{throw new Error('The "transformSync" API only works in node')},li=()=>{throw new Error('The "formatMessagesSync" API only works in node')},pr=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ru=()=>(Ai&&Ai(),Promise.resolve()),Ti,Ai,Mi,Uo=()=>{if(Mi)return Mi;throw Ti?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},pd=L=>{L=_e(L||{});let B=L.wasmURL,Z=L.wasmModule,se=L.worker!==!1;if(!B&&!Z)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Ti)throw new Error('Cannot call "initialize" more than once');return Ti=md(B||"",Z,se),Ti.catch(()=>{Ti=void 0}),Ti},md=(L,B,Z)=>c(null,null,function*(){let se,we;const De=new Promise(ct=>we=ct);if(Z){let ct=new Blob([`onmessage=((postMessage) => {
270
- // Copyright 2018 The Go Authors. All rights reserved.
271
- // Use of this source code is governed by a BSD-style
272
- // license that can be found in the LICENSE file.
273
- var __async = (__this, __arguments, generator) => {
274
- return new Promise((resolve, reject) => {
275
- var fulfilled = (value) => {
276
- try {
277
- step(generator.next(value));
278
- } catch (e) {
279
- reject(e);
280
- }
281
- };
282
- var rejected = (value) => {
283
- try {
284
- step(generator.throw(value));
285
- } catch (e) {
286
- reject(e);
287
- }
288
- };
289
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
290
- step((generator = generator.apply(__this, __arguments)).next());
291
- });
292
- };
293
- let onmessage;
294
- let globalThis = {};
295
- for (let o = self; o; o = Object.getPrototypeOf(o))
296
- for (let k of Object.getOwnPropertyNames(o))
297
- if (!(k in globalThis))
298
- Object.defineProperty(globalThis, k, { get: () => self[k] });
299
- "use strict";
300
- (() => {
301
- const enosys = () => {
302
- const err = new Error("not implemented");
303
- err.code = "ENOSYS";
304
- return err;
305
- };
306
- if (!globalThis.fs) {
307
- let outputBuf = "";
308
- globalThis.fs = {
309
- constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 },
310
- // unused
311
- writeSync(fd, buf) {
312
- outputBuf += decoder.decode(buf);
313
- const nl = outputBuf.lastIndexOf("\\n");
314
- if (nl != -1) {
315
- console.log(outputBuf.substring(0, nl));
316
- outputBuf = outputBuf.substring(nl + 1);
317
- }
318
- return buf.length;
319
- },
320
- write(fd, buf, offset, length, position, callback) {
321
- if (offset !== 0 || length !== buf.length || position !== null) {
322
- callback(enosys());
323
- return;
324
- }
325
- const n = this.writeSync(fd, buf);
326
- callback(null, n);
327
- },
328
- chmod(path, mode, callback) {
329
- callback(enosys());
330
- },
331
- chown(path, uid, gid, callback) {
332
- callback(enosys());
333
- },
334
- close(fd, callback) {
335
- callback(enosys());
336
- },
337
- fchmod(fd, mode, callback) {
338
- callback(enosys());
339
- },
340
- fchown(fd, uid, gid, callback) {
341
- callback(enosys());
342
- },
343
- fstat(fd, callback) {
344
- callback(enosys());
345
- },
346
- fsync(fd, callback) {
347
- callback(null);
348
- },
349
- ftruncate(fd, length, callback) {
350
- callback(enosys());
351
- },
352
- lchown(path, uid, gid, callback) {
353
- callback(enosys());
354
- },
355
- link(path, link, callback) {
356
- callback(enosys());
357
- },
358
- lstat(path, callback) {
359
- callback(enosys());
360
- },
361
- mkdir(path, perm, callback) {
362
- callback(enosys());
363
- },
364
- open(path, flags, mode, callback) {
365
- callback(enosys());
366
- },
367
- read(fd, buffer, offset, length, position, callback) {
368
- callback(enosys());
369
- },
370
- readdir(path, callback) {
371
- callback(enosys());
372
- },
373
- readlink(path, callback) {
374
- callback(enosys());
375
- },
376
- rename(from, to, callback) {
377
- callback(enosys());
378
- },
379
- rmdir(path, callback) {
380
- callback(enosys());
381
- },
382
- stat(path, callback) {
383
- callback(enosys());
384
- },
385
- symlink(path, link, callback) {
386
- callback(enosys());
387
- },
388
- truncate(path, length, callback) {
389
- callback(enosys());
390
- },
391
- unlink(path, callback) {
392
- callback(enosys());
393
- },
394
- utimes(path, atime, mtime, callback) {
395
- callback(enosys());
396
- }
397
- };
398
- }
399
- if (!globalThis.process) {
400
- globalThis.process = {
401
- getuid() {
402
- return -1;
403
- },
404
- getgid() {
405
- return -1;
406
- },
407
- geteuid() {
408
- return -1;
409
- },
410
- getegid() {
411
- return -1;
412
- },
413
- getgroups() {
414
- throw enosys();
415
- },
416
- pid: -1,
417
- ppid: -1,
418
- umask() {
419
- throw enosys();
420
- },
421
- cwd() {
422
- throw enosys();
423
- },
424
- chdir() {
425
- throw enosys();
426
- }
427
- };
428
- }
429
- if (!globalThis.path) {
430
- globalThis.path = {
431
- resolve(...pathSegments) {
432
- return pathSegments.join("/");
433
- }
434
- };
435
- }
436
- if (!globalThis.crypto) {
437
- throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
438
- }
439
- if (!globalThis.performance) {
440
- throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");
441
- }
442
- if (!globalThis.TextEncoder) {
443
- throw new Error("globalThis.TextEncoder is not available, polyfill required");
444
- }
445
- if (!globalThis.TextDecoder) {
446
- throw new Error("globalThis.TextDecoder is not available, polyfill required");
447
- }
448
- const encoder = new TextEncoder("utf-8");
449
- const decoder = new TextDecoder("utf-8");
450
- globalThis.Go = class {
451
- constructor() {
452
- this.argv = ["js"];
453
- this.env = {};
454
- this.exit = (code) => {
455
- if (code !== 0) {
456
- console.warn("exit code:", code);
457
- }
458
- };
459
- this._exitPromise = new Promise((resolve) => {
460
- this._resolveExitPromise = resolve;
461
- });
462
- this._pendingEvent = null;
463
- this._scheduledTimeouts = /* @__PURE__ */ new Map();
464
- this._nextCallbackTimeoutID = 1;
465
- const setInt64 = (addr, v) => {
466
- this.mem.setUint32(addr + 0, v, true);
467
- this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
468
- };
469
- const setInt32 = (addr, v) => {
470
- this.mem.setUint32(addr + 0, v, true);
471
- };
472
- const getInt64 = (addr) => {
473
- const low = this.mem.getUint32(addr + 0, true);
474
- const high = this.mem.getInt32(addr + 4, true);
475
- return low + high * 4294967296;
476
- };
477
- const loadValue = (addr) => {
478
- const f = this.mem.getFloat64(addr, true);
479
- if (f === 0) {
480
- return void 0;
481
- }
482
- if (!isNaN(f)) {
483
- return f;
484
- }
485
- const id = this.mem.getUint32(addr, true);
486
- return this._values[id];
487
- };
488
- const storeValue = (addr, v) => {
489
- const nanHead = 2146959360;
490
- if (typeof v === "number" && v !== 0) {
491
- if (isNaN(v)) {
492
- this.mem.setUint32(addr + 4, nanHead, true);
493
- this.mem.setUint32(addr, 0, true);
494
- return;
495
- }
496
- this.mem.setFloat64(addr, v, true);
497
- return;
498
- }
499
- if (v === void 0) {
500
- this.mem.setFloat64(addr, 0, true);
501
- return;
502
- }
503
- let id = this._ids.get(v);
504
- if (id === void 0) {
505
- id = this._idPool.pop();
506
- if (id === void 0) {
507
- id = this._values.length;
508
- }
509
- this._values[id] = v;
510
- this._goRefCounts[id] = 0;
511
- this._ids.set(v, id);
512
- }
513
- this._goRefCounts[id]++;
514
- let typeFlag = 0;
515
- switch (typeof v) {
516
- case "object":
517
- if (v !== null) {
518
- typeFlag = 1;
519
- }
520
- break;
521
- case "string":
522
- typeFlag = 2;
523
- break;
524
- case "symbol":
525
- typeFlag = 3;
526
- break;
527
- case "function":
528
- typeFlag = 4;
529
- break;
530
- }
531
- this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
532
- this.mem.setUint32(addr, id, true);
533
- };
534
- const loadSlice = (addr) => {
535
- const array = getInt64(addr + 0);
536
- const len = getInt64(addr + 8);
537
- return new Uint8Array(this._inst.exports.mem.buffer, array, len);
538
- };
539
- const loadSliceOfValues = (addr) => {
540
- const array = getInt64(addr + 0);
541
- const len = getInt64(addr + 8);
542
- const a = new Array(len);
543
- for (let i = 0; i < len; i++) {
544
- a[i] = loadValue(array + i * 8);
545
- }
546
- return a;
547
- };
548
- const loadString = (addr) => {
549
- const saddr = getInt64(addr + 0);
550
- const len = getInt64(addr + 8);
551
- return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
552
- };
553
- const testCallExport = (a, b) => {
554
- this._inst.exports.testExport0();
555
- return this._inst.exports.testExport(a, b);
556
- };
557
- const timeOrigin = Date.now() - performance.now();
558
- this.importObject = {
559
- _gotest: {
560
- add: (a, b) => a + b,
561
- callExport: testCallExport
562
- },
563
- gojs: {
564
- // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
565
- // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
566
- // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
567
- // This changes the SP, thus we have to update the SP used by the imported function.
568
- // func wasmExit(code int32)
569
- "runtime.wasmExit": (sp) => {
570
- sp >>>= 0;
571
- const code = this.mem.getInt32(sp + 8, true);
572
- this.exited = true;
573
- delete this._inst;
574
- delete this._values;
575
- delete this._goRefCounts;
576
- delete this._ids;
577
- delete this._idPool;
578
- this.exit(code);
579
- },
580
- // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
581
- "runtime.wasmWrite": (sp) => {
582
- sp >>>= 0;
583
- const fd = getInt64(sp + 8);
584
- const p = getInt64(sp + 16);
585
- const n = this.mem.getInt32(sp + 24, true);
586
- globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
587
- },
588
- // func resetMemoryDataView()
589
- "runtime.resetMemoryDataView": (sp) => {
590
- sp >>>= 0;
591
- this.mem = new DataView(this._inst.exports.mem.buffer);
592
- },
593
- // func nanotime1() int64
594
- "runtime.nanotime1": (sp) => {
595
- sp >>>= 0;
596
- setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);
597
- },
598
- // func walltime() (sec int64, nsec int32)
599
- "runtime.walltime": (sp) => {
600
- sp >>>= 0;
601
- const msec = (/* @__PURE__ */ new Date()).getTime();
602
- setInt64(sp + 8, msec / 1e3);
603
- this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);
604
- },
605
- // func scheduleTimeoutEvent(delay int64) int32
606
- "runtime.scheduleTimeoutEvent": (sp) => {
607
- sp >>>= 0;
608
- const id = this._nextCallbackTimeoutID;
609
- this._nextCallbackTimeoutID++;
610
- this._scheduledTimeouts.set(id, setTimeout(
611
- () => {
612
- this._resume();
613
- while (this._scheduledTimeouts.has(id)) {
614
- console.warn("scheduleTimeoutEvent: missed timeout event");
615
- this._resume();
616
- }
617
- },
618
- getInt64(sp + 8)
619
- ));
620
- this.mem.setInt32(sp + 16, id, true);
621
- },
622
- // func clearTimeoutEvent(id int32)
623
- "runtime.clearTimeoutEvent": (sp) => {
624
- sp >>>= 0;
625
- const id = this.mem.getInt32(sp + 8, true);
626
- clearTimeout(this._scheduledTimeouts.get(id));
627
- this._scheduledTimeouts.delete(id);
628
- },
629
- // func getRandomData(r []byte)
630
- "runtime.getRandomData": (sp) => {
631
- sp >>>= 0;
632
- crypto.getRandomValues(loadSlice(sp + 8));
633
- },
634
- // func finalizeRef(v ref)
635
- "syscall/js.finalizeRef": (sp) => {
636
- sp >>>= 0;
637
- const id = this.mem.getUint32(sp + 8, true);
638
- this._goRefCounts[id]--;
639
- if (this._goRefCounts[id] === 0) {
640
- const v = this._values[id];
641
- this._values[id] = null;
642
- this._ids.delete(v);
643
- this._idPool.push(id);
644
- }
645
- },
646
- // func stringVal(value string) ref
647
- "syscall/js.stringVal": (sp) => {
648
- sp >>>= 0;
649
- storeValue(sp + 24, loadString(sp + 8));
650
- },
651
- // func valueGet(v ref, p string) ref
652
- "syscall/js.valueGet": (sp) => {
653
- sp >>>= 0;
654
- const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
655
- sp = this._inst.exports.getsp() >>> 0;
656
- storeValue(sp + 32, result);
657
- },
658
- // func valueSet(v ref, p string, x ref)
659
- "syscall/js.valueSet": (sp) => {
660
- sp >>>= 0;
661
- Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
662
- },
663
- // func valueDelete(v ref, p string)
664
- "syscall/js.valueDelete": (sp) => {
665
- sp >>>= 0;
666
- Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
667
- },
668
- // func valueIndex(v ref, i int) ref
669
- "syscall/js.valueIndex": (sp) => {
670
- sp >>>= 0;
671
- storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
672
- },
673
- // valueSetIndex(v ref, i int, x ref)
674
- "syscall/js.valueSetIndex": (sp) => {
675
- sp >>>= 0;
676
- Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
677
- },
678
- // func valueCall(v ref, m string, args []ref) (ref, bool)
679
- "syscall/js.valueCall": (sp) => {
680
- sp >>>= 0;
681
- try {
682
- const v = loadValue(sp + 8);
683
- const m = Reflect.get(v, loadString(sp + 16));
684
- const args = loadSliceOfValues(sp + 32);
685
- const result = Reflect.apply(m, v, args);
686
- sp = this._inst.exports.getsp() >>> 0;
687
- storeValue(sp + 56, result);
688
- this.mem.setUint8(sp + 64, 1);
689
- } catch (err) {
690
- sp = this._inst.exports.getsp() >>> 0;
691
- storeValue(sp + 56, err);
692
- this.mem.setUint8(sp + 64, 0);
693
- }
694
- },
695
- // func valueInvoke(v ref, args []ref) (ref, bool)
696
- "syscall/js.valueInvoke": (sp) => {
697
- sp >>>= 0;
698
- try {
699
- const v = loadValue(sp + 8);
700
- const args = loadSliceOfValues(sp + 16);
701
- const result = Reflect.apply(v, void 0, args);
702
- sp = this._inst.exports.getsp() >>> 0;
703
- storeValue(sp + 40, result);
704
- this.mem.setUint8(sp + 48, 1);
705
- } catch (err) {
706
- sp = this._inst.exports.getsp() >>> 0;
707
- storeValue(sp + 40, err);
708
- this.mem.setUint8(sp + 48, 0);
709
- }
710
- },
711
- // func valueNew(v ref, args []ref) (ref, bool)
712
- "syscall/js.valueNew": (sp) => {
713
- sp >>>= 0;
714
- try {
715
- const v = loadValue(sp + 8);
716
- const args = loadSliceOfValues(sp + 16);
717
- const result = Reflect.construct(v, args);
718
- sp = this._inst.exports.getsp() >>> 0;
719
- storeValue(sp + 40, result);
720
- this.mem.setUint8(sp + 48, 1);
721
- } catch (err) {
722
- sp = this._inst.exports.getsp() >>> 0;
723
- storeValue(sp + 40, err);
724
- this.mem.setUint8(sp + 48, 0);
725
- }
726
- },
727
- // func valueLength(v ref) int
728
- "syscall/js.valueLength": (sp) => {
729
- sp >>>= 0;
730
- setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
731
- },
732
- // valuePrepareString(v ref) (ref, int)
733
- "syscall/js.valuePrepareString": (sp) => {
734
- sp >>>= 0;
735
- const str = encoder.encode(String(loadValue(sp + 8)));
736
- storeValue(sp + 16, str);
737
- setInt64(sp + 24, str.length);
738
- },
739
- // valueLoadString(v ref, b []byte)
740
- "syscall/js.valueLoadString": (sp) => {
741
- sp >>>= 0;
742
- const str = loadValue(sp + 8);
743
- loadSlice(sp + 16).set(str);
744
- },
745
- // func valueInstanceOf(v ref, t ref) bool
746
- "syscall/js.valueInstanceOf": (sp) => {
747
- sp >>>= 0;
748
- this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);
749
- },
750
- // func copyBytesToGo(dst []byte, src ref) (int, bool)
751
- "syscall/js.copyBytesToGo": (sp) => {
752
- sp >>>= 0;
753
- const dst = loadSlice(sp + 8);
754
- const src = loadValue(sp + 32);
755
- if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
756
- this.mem.setUint8(sp + 48, 0);
757
- return;
758
- }
759
- const toCopy = src.subarray(0, dst.length);
760
- dst.set(toCopy);
761
- setInt64(sp + 40, toCopy.length);
762
- this.mem.setUint8(sp + 48, 1);
763
- },
764
- // func copyBytesToJS(dst ref, src []byte) (int, bool)
765
- "syscall/js.copyBytesToJS": (sp) => {
766
- sp >>>= 0;
767
- const dst = loadValue(sp + 8);
768
- const src = loadSlice(sp + 16);
769
- if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
770
- this.mem.setUint8(sp + 48, 0);
771
- return;
772
- }
773
- const toCopy = src.subarray(0, dst.length);
774
- dst.set(toCopy);
775
- setInt64(sp + 40, toCopy.length);
776
- this.mem.setUint8(sp + 48, 1);
777
- },
778
- "debug": (value) => {
779
- console.log(value);
780
- }
781
- }
782
- };
783
- }
784
- run(instance) {
785
- return __async(this, null, function* () {
786
- if (!(instance instanceof WebAssembly.Instance)) {
787
- throw new Error("Go.run: WebAssembly.Instance expected");
788
- }
789
- this._inst = instance;
790
- this.mem = new DataView(this._inst.exports.mem.buffer);
791
- this._values = [
792
- // JS values that Go currently has references to, indexed by reference id
793
- NaN,
794
- 0,
795
- null,
796
- true,
797
- false,
798
- globalThis,
799
- this
800
- ];
801
- this._goRefCounts = new Array(this._values.length).fill(Infinity);
802
- this._ids = /* @__PURE__ */ new Map([
803
- // mapping from JS values to reference ids
804
- [0, 1],
805
- [null, 2],
806
- [true, 3],
807
- [false, 4],
808
- [globalThis, 5],
809
- [this, 6]
810
- ]);
811
- this._idPool = [];
812
- this.exited = false;
813
- let offset = 4096;
814
- const strPtr = (str) => {
815
- const ptr = offset;
816
- const bytes = encoder.encode(str + "\\0");
817
- new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
818
- offset += bytes.length;
819
- if (offset % 8 !== 0) {
820
- offset += 8 - offset % 8;
821
- }
822
- return ptr;
823
- };
824
- const argc = this.argv.length;
825
- const argvPtrs = [];
826
- this.argv.forEach((arg) => {
827
- argvPtrs.push(strPtr(arg));
828
- });
829
- argvPtrs.push(0);
830
- const keys = Object.keys(this.env).sort();
831
- keys.forEach((key) => {
832
- argvPtrs.push(strPtr(\`\${key}=\${this.env[key]}\`));
833
- });
834
- argvPtrs.push(0);
835
- const argv = offset;
836
- argvPtrs.forEach((ptr) => {
837
- this.mem.setUint32(offset, ptr, true);
838
- this.mem.setUint32(offset + 4, 0, true);
839
- offset += 8;
840
- });
841
- const wasmMinDataAddr = 4096 + 8192;
842
- if (offset >= wasmMinDataAddr) {
843
- throw new Error("total length of command line and environment variables exceeds limit");
844
- }
845
- this._inst.exports.run(argc, argv);
846
- if (this.exited) {
847
- this._resolveExitPromise();
848
- }
849
- yield this._exitPromise;
850
- });
851
- }
852
- _resume() {
853
- if (this.exited) {
854
- throw new Error("Go program has already exited");
855
- }
856
- this._inst.exports.resume();
857
- if (this.exited) {
858
- this._resolveExitPromise();
859
- }
860
- }
861
- _makeFuncWrapper(id) {
862
- const go = this;
863
- return function() {
864
- const event = { id, this: this, args: arguments };
865
- go._pendingEvent = event;
866
- go._resume();
867
- return event.result;
868
- };
869
- }
870
- };
871
- })();
872
- onmessage = ({ data: wasm }) => {
873
- let decoder = new TextDecoder();
874
- let fs = globalThis.fs;
875
- let stderr = "";
876
- fs.writeSync = (fd, buffer) => {
877
- if (fd === 1) {
878
- postMessage(buffer);
879
- } else if (fd === 2) {
880
- stderr += decoder.decode(buffer);
881
- let parts = stderr.split("\\n");
882
- if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));
883
- stderr = parts[parts.length - 1];
884
- } else {
885
- throw new Error("Bad write");
886
- }
887
- return buffer.length;
888
- };
889
- let stdin = [];
890
- let resumeStdin;
891
- let stdinPos = 0;
892
- onmessage = ({ data }) => {
893
- if (data.length > 0) {
894
- stdin.push(data);
895
- if (resumeStdin) resumeStdin();
896
- }
897
- return go;
898
- };
899
- fs.read = (fd, buffer, offset, length, position, callback) => {
900
- if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {
901
- throw new Error("Bad read");
902
- }
903
- if (stdin.length === 0) {
904
- resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);
905
- return;
906
- }
907
- let first = stdin[0];
908
- let count = Math.max(0, Math.min(length, first.length - stdinPos));
909
- buffer.set(first.subarray(stdinPos, stdinPos + count), offset);
910
- stdinPos += count;
911
- if (stdinPos === first.length) {
912
- stdin.shift();
913
- stdinPos = 0;
914
- }
915
- callback(null, count);
916
- };
917
- let go = new globalThis.Go();
918
- go.argv = ["", \`--service=\${"0.27.3"}\`];
919
- tryToInstantiateModule(wasm, go).then(
920
- (instance) => {
921
- postMessage(null);
922
- go.run(instance);
923
- },
924
- (error) => {
925
- postMessage(error);
926
- }
927
- );
928
- return go;
929
- };
930
- function tryToInstantiateModule(wasm, go) {
931
- return __async(this, null, function* () {
932
- if (wasm instanceof WebAssembly.Module) {
933
- return WebAssembly.instantiate(wasm, go.importObject);
934
- }
935
- const res = yield fetch(wasm);
936
- if (!res.ok) throw new Error(\`Failed to download \${JSON.stringify(wasm)}\`);
937
- if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {
938
- const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject);
939
- return result2.instance;
940
- }
941
- const bytes = yield res.arrayBuffer();
942
- const result = yield WebAssembly.instantiate(bytes, go.importObject);
943
- return result.instance;
944
- });
945
- }
946
- return (m) => onmessage(m);
947
- })(postMessage)`],{type:"text/javascript"});se=new Worker(URL.createObjectURL(ct))}else{let ct=(kt=>{var wt=(Je,Ze,Oe)=>new Promise((fe,G)=>{var le=Be=>{try{Le(Oe.next(Be))}catch(ce){G(ce)}},ae=Be=>{try{Le(Oe.throw(Be))}catch(ce){G(ce)}},Le=Be=>Be.done?fe(Be.value):Promise.resolve(Be.value).then(le,ae);Le((Oe=Oe.apply(Je,Ze)).next())});let Dt,Ge={};for(let Je=self;Je;Je=Object.getPrototypeOf(Je))for(let Ze of Object.getOwnPropertyNames(Je))Ze in Ge||Object.defineProperty(Ge,Ze,{get:()=>self[Ze]});(()=>{const Je=()=>{const fe=new Error("not implemented");return fe.code="ENOSYS",fe};if(!Ge.fs){let fe="";Ge.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(G,le){fe+=Oe.decode(le);const ae=fe.lastIndexOf(`
948
- `);return ae!=-1&&(console.log(fe.substring(0,ae)),fe=fe.substring(ae+1)),le.length},write(G,le,ae,Le,Be,ce){if(ae!==0||Le!==le.length||Be!==null){ce(Je());return}const ye=this.writeSync(G,le);ce(null,ye)},chmod(G,le,ae){ae(Je())},chown(G,le,ae,Le){Le(Je())},close(G,le){le(Je())},fchmod(G,le,ae){ae(Je())},fchown(G,le,ae,Le){Le(Je())},fstat(G,le){le(Je())},fsync(G,le){le(null)},ftruncate(G,le,ae){ae(Je())},lchown(G,le,ae,Le){Le(Je())},link(G,le,ae){ae(Je())},lstat(G,le){le(Je())},mkdir(G,le,ae){ae(Je())},open(G,le,ae,Le){Le(Je())},read(G,le,ae,Le,Be,ce){ce(Je())},readdir(G,le){le(Je())},readlink(G,le){le(Je())},rename(G,le,ae){ae(Je())},rmdir(G,le){le(Je())},stat(G,le){le(Je())},symlink(G,le,ae){ae(Je())},truncate(G,le,ae){ae(Je())},unlink(G,le){le(Je())},utimes(G,le,ae,Le){Le(Je())}}}if(Ge.process||(Ge.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw Je()},pid:-1,ppid:-1,umask(){throw Je()},cwd(){throw Je()},chdir(){throw Je()}}),Ge.path||(Ge.path={resolve(...fe){return fe.join("/")}}),!Ge.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!Ge.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!Ge.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!Ge.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const Ze=new TextEncoder("utf-8"),Oe=new TextDecoder("utf-8");Ge.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=H=>{H!==0&&console.warn("exit code:",H)},this._exitPromise=new Promise(H=>{this._resolveExitPromise=H}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const fe=(H,ne)=>{this.mem.setUint32(H+0,ne,!0),this.mem.setUint32(H+4,Math.floor(ne/4294967296),!0)},G=H=>{const ne=this.mem.getUint32(H+0,!0),Re=this.mem.getInt32(H+4,!0);return ne+Re*4294967296},le=H=>{const ne=this.mem.getFloat64(H,!0);if(ne===0)return;if(!isNaN(ne))return ne;const Re=this.mem.getUint32(H,!0);return this._values[Re]},ae=(H,ne)=>{if(typeof ne=="number"&&ne!==0){if(isNaN(ne)){this.mem.setUint32(H+4,2146959360,!0),this.mem.setUint32(H,0,!0);return}this.mem.setFloat64(H,ne,!0);return}if(ne===void 0){this.mem.setFloat64(H,0,!0);return}let ze=this._ids.get(ne);ze===void 0&&(ze=this._idPool.pop(),ze===void 0&&(ze=this._values.length),this._values[ze]=ne,this._goRefCounts[ze]=0,this._ids.set(ne,ze)),this._goRefCounts[ze]++;let Ye=0;switch(typeof ne){case"object":ne!==null&&(Ye=1);break;case"string":Ye=2;break;case"symbol":Ye=3;break;case"function":Ye=4;break}this.mem.setUint32(H+4,2146959360|Ye,!0),this.mem.setUint32(H,ze,!0)},Le=H=>{const ne=G(H+0),Re=G(H+8);return new Uint8Array(this._inst.exports.mem.buffer,ne,Re)},Be=H=>{const ne=G(H+0),Re=G(H+8),ze=new Array(Re);for(let Ye=0;Ye<Re;Ye++)ze[Ye]=le(ne+Ye*8);return ze},ce=H=>{const ne=G(H+0),Re=G(H+8);return Oe.decode(new DataView(this._inst.exports.mem.buffer,ne,Re))},ye=(H,ne)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(H,ne)),Fe=Date.now()-performance.now();this.importObject={_gotest:{add:(H,ne)=>H+ne,callExport:ye},gojs:{"runtime.wasmExit":H=>{H>>>=0;const ne=this.mem.getInt32(H+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(ne)},"runtime.wasmWrite":H=>{H>>>=0;const ne=G(H+8),Re=G(H+16),ze=this.mem.getInt32(H+24,!0);Ge.fs.writeSync(ne,new Uint8Array(this._inst.exports.mem.buffer,Re,ze))},"runtime.resetMemoryDataView":H=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":H=>{H>>>=0,fe(H+8,(Fe+performance.now())*1e6)},"runtime.walltime":H=>{H>>>=0;const ne=new Date().getTime();fe(H+8,ne/1e3),this.mem.setInt32(H+16,ne%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":H=>{H>>>=0;const ne=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(ne,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(ne);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},G(H+8))),this.mem.setInt32(H+16,ne,!0)},"runtime.clearTimeoutEvent":H=>{H>>>=0;const ne=this.mem.getInt32(H+8,!0);clearTimeout(this._scheduledTimeouts.get(ne)),this._scheduledTimeouts.delete(ne)},"runtime.getRandomData":H=>{H>>>=0,crypto.getRandomValues(Le(H+8))},"syscall/js.finalizeRef":H=>{H>>>=0;const ne=this.mem.getUint32(H+8,!0);if(this._goRefCounts[ne]--,this._goRefCounts[ne]===0){const Re=this._values[ne];this._values[ne]=null,this._ids.delete(Re),this._idPool.push(ne)}},"syscall/js.stringVal":H=>{H>>>=0,ae(H+24,ce(H+8))},"syscall/js.valueGet":H=>{H>>>=0;const ne=Reflect.get(le(H+8),ce(H+16));H=this._inst.exports.getsp()>>>0,ae(H+32,ne)},"syscall/js.valueSet":H=>{H>>>=0,Reflect.set(le(H+8),ce(H+16),le(H+32))},"syscall/js.valueDelete":H=>{H>>>=0,Reflect.deleteProperty(le(H+8),ce(H+16))},"syscall/js.valueIndex":H=>{H>>>=0,ae(H+24,Reflect.get(le(H+8),G(H+16)))},"syscall/js.valueSetIndex":H=>{H>>>=0,Reflect.set(le(H+8),G(H+16),le(H+24))},"syscall/js.valueCall":H=>{H>>>=0;try{const ne=le(H+8),Re=Reflect.get(ne,ce(H+16)),ze=Be(H+32),Ye=Reflect.apply(Re,ne,ze);H=this._inst.exports.getsp()>>>0,ae(H+56,Ye),this.mem.setUint8(H+64,1)}catch(ne){H=this._inst.exports.getsp()>>>0,ae(H+56,ne),this.mem.setUint8(H+64,0)}},"syscall/js.valueInvoke":H=>{H>>>=0;try{const ne=le(H+8),Re=Be(H+16),ze=Reflect.apply(ne,void 0,Re);H=this._inst.exports.getsp()>>>0,ae(H+40,ze),this.mem.setUint8(H+48,1)}catch(ne){H=this._inst.exports.getsp()>>>0,ae(H+40,ne),this.mem.setUint8(H+48,0)}},"syscall/js.valueNew":H=>{H>>>=0;try{const ne=le(H+8),Re=Be(H+16),ze=Reflect.construct(ne,Re);H=this._inst.exports.getsp()>>>0,ae(H+40,ze),this.mem.setUint8(H+48,1)}catch(ne){H=this._inst.exports.getsp()>>>0,ae(H+40,ne),this.mem.setUint8(H+48,0)}},"syscall/js.valueLength":H=>{H>>>=0,fe(H+16,parseInt(le(H+8).length))},"syscall/js.valuePrepareString":H=>{H>>>=0;const ne=Ze.encode(String(le(H+8)));ae(H+16,ne),fe(H+24,ne.length)},"syscall/js.valueLoadString":H=>{H>>>=0;const ne=le(H+8);Le(H+16).set(ne)},"syscall/js.valueInstanceOf":H=>{H>>>=0,this.mem.setUint8(H+24,le(H+8)instanceof le(H+16)?1:0)},"syscall/js.copyBytesToGo":H=>{H>>>=0;const ne=Le(H+8),Re=le(H+32);if(!(Re instanceof Uint8Array||Re instanceof Uint8ClampedArray)){this.mem.setUint8(H+48,0);return}const ze=Re.subarray(0,ne.length);ne.set(ze),fe(H+40,ze.length),this.mem.setUint8(H+48,1)},"syscall/js.copyBytesToJS":H=>{H>>>=0;const ne=le(H+8),Re=Le(H+16);if(!(ne instanceof Uint8Array||ne instanceof Uint8ClampedArray)){this.mem.setUint8(H+48,0);return}const ze=Re.subarray(0,ne.length);ne.set(ze),fe(H+40,ze.length),this.mem.setUint8(H+48,1)},debug:H=>{console.log(H)}}}}run(fe){return wt(this,null,function*(){if(!(fe instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=fe,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,Ge,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[Ge,5],[this,6]]),this._idPool=[],this.exited=!1;let G=4096;const le=Fe=>{const H=G,ne=Ze.encode(Fe+"\0");return new Uint8Array(this.mem.buffer,G,ne.length).set(ne),G+=ne.length,G%8!==0&&(G+=8-G%8),H},ae=this.argv.length,Le=[];this.argv.forEach(Fe=>{Le.push(le(Fe))}),Le.push(0),Object.keys(this.env).sort().forEach(Fe=>{Le.push(le(`${Fe}=${this.env[Fe]}`))}),Le.push(0);const ce=G;if(Le.forEach(Fe=>{this.mem.setUint32(G,Fe,!0),this.mem.setUint32(G+4,0,!0),G+=8}),G>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(ae,ce),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(fe){const G=this;return function(){const le={id:fe,this:this,args:arguments};return G._pendingEvent=le,G._resume(),le.result}}}})(),Dt=({data:Je})=>{let Ze=new TextDecoder,Oe=Ge.fs,fe="";Oe.writeSync=(Be,ce)=>{if(Be===1)kt(ce);else if(Be===2){fe+=Ze.decode(ce);let ye=fe.split(`
949
- `);ye.length>1&&console.log(ye.slice(0,-1).join(`
950
- `)),fe=ye[ye.length-1]}else throw new Error("Bad write");return ce.length};let G=[],le,ae=0;Dt=({data:Be})=>(Be.length>0&&(G.push(Be),le&&le()),Le),Oe.read=(Be,ce,ye,Fe,H,ne)=>{if(Be!==0||ye!==0||Fe!==ce.length||H!==null)throw new Error("Bad read");if(G.length===0){le=()=>Oe.read(Be,ce,ye,Fe,H,ne);return}let Re=G[0],ze=Math.max(0,Math.min(Fe,Re.length-ae));ce.set(Re.subarray(ae,ae+ze),ye),ae+=ze,ae===Re.length&&(G.shift(),ae=0),ne(null,ze)};let Le=new Ge.Go;return Le.argv=["","--service=0.27.3"],sn(Je,Le).then(Be=>{kt(null),Le.run(Be)},Be=>{kt(Be)}),Le};function sn(Je,Ze){return wt(this,null,function*(){if(Je instanceof WebAssembly.Module)return WebAssembly.instantiate(Je,Ze.importObject);const Oe=yield fetch(Je);if(!Oe.ok)throw new Error(`Failed to download ${JSON.stringify(Je)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(Oe.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(Oe,Ze.importObject)).instance;const fe=yield Oe.arrayBuffer();return(yield WebAssembly.instantiate(fe,Ze.importObject)).instance})}return Je=>Dt(Je)})(kt=>se.onmessage({data:kt})),Lt;se={onmessage:null,postMessage:kt=>setTimeout(()=>{try{Lt=ct({data:kt})}catch(wt){we(wt)}}),terminate(){if(Lt)for(let kt of Lt._scheduledTimeouts.values())clearTimeout(kt)}}}let be,Ue;const de=new Promise((ct,Lt)=>{be=ct,Ue=Lt});se.onmessage=({data:ct})=>{se.onmessage=({data:Lt})=>vt(Lt),ct?Ue(ct):be()},se.postMessage(B||new URL(L,location.href).toString());let{readFromStdout:vt,service:Ct}=Qn({writeToStdin(ct){se.postMessage(ct)},isSync:!1,hasFS:!1,esbuild:f});yield de,Ai=()=>{se.terminate(),Ti=void 0,Ai=void 0,Mi=void 0},Mi={build:ct=>new Promise((Lt,kt)=>{De.then(kt),Ct.buildOrContext({callName:"build",refs:null,options:ct,isTTY:!1,defaultWD:"/",callback:(wt,Dt)=>wt?kt(wt):Lt(Dt)})}),context:ct=>new Promise((Lt,kt)=>{De.then(kt),Ct.buildOrContext({callName:"context",refs:null,options:ct,isTTY:!1,defaultWD:"/",callback:(wt,Dt)=>wt?kt(wt):Lt(Dt)})}),transform:(ct,Lt)=>new Promise((kt,wt)=>{De.then(wt),Ct.transform({callName:"transform",refs:null,input:ct,options:Lt||{},isTTY:!1,fs:{readFile(Dt,Ge){Ge(new Error("Internal error"),null)},writeFile(Dt,Ge){Ge(null)}},callback:(Dt,Ge)=>Dt?wt(Dt):kt(Ge)})}),formatMessages:(ct,Lt)=>new Promise((kt,wt)=>{De.then(wt),Ct.formatMessages({callName:"formatMessages",refs:null,messages:ct,options:Lt,callback:(Dt,Ge)=>Dt?wt(Dt):kt(Ge)})}),analyzeMetafile:(ct,Lt)=>new Promise((kt,wt)=>{De.then(wt),Ct.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof ct=="string"?ct:JSON.stringify(ct),options:Lt,callback:(Dt,Ge)=>Dt?wt(Dt):kt(Ge)})})}}),gd=f})(e)})(ag)),ag.exports}var T4=EU();function _U(e){const t=Array.from(e.keys()),n=t.find(o=>/\bmain\.(tsx?|jsx?)$/.test(o));if(n)return n;const r=t.find(o=>/\bindex\.(tsx?|jsx?)$/.test(o));if(r)return r;const i=t.find(o=>/\.(tsx|jsx)$/.test(o));return i||t[0]||"main.tsx"}function Eh(e,t="main.tsx",n="inline"){return{id:n,entry:t,files:new Map([[t,{path:t,content:e}]])}}var A4=Nc(["browser","cli"]),TU=La({target:kn().optional(),format:Nc(["esm","cjs","iife"]).optional(),jsx:Nc(["automatic","transform","preserve"]).optional(),jsxFactory:kn().optional(),jsxFragment:kn().optional()}).strict().optional(),AU=La({globals:Aa(kn(),kn()).optional(),preload:Ey(kn()).optional(),deps:Aa(kn(),kn()).optional()}).strict().optional(),MU=Aa(kn(),kn()).optional(),NU=Aa(kn(),kn()).optional(),IU=La({platform:A4,dependencies:NU,esbuild:TU,framework:AU,aliases:MU}).strict(),DU=La({type:Nc(["string","number","boolean","object","array"]),default:GE().optional(),required:KE().optional(),description:kn().optional()});La({name:kn(),version:kn(),description:kn().optional(),platform:A4,image:kn(),inputs:Aa(kn(),DU).optional(),services:Ey(kn()).optional(),packages:Aa(kn(),kn()).optional()});La({typescript:KE().optional()}).strict().optional();var OU=Nc(["embedded","iframe"]);La({target:MR(e=>e instanceof HTMLElement,{message:"Expected HTMLElement"}),mode:OU,sandbox:Ey(kn()).optional(),inputs:Aa(kn(),GE()).optional()});function M4(e){const t=IU.safeParse(e);return t.success?t.data:null}var N4={platform:"browser",esbuild:{target:"es2020",format:"esm",jsx:"automatic"},framework:{}},RU="https://esm.sh",sx=RU;function PU(e){sx=e}function Qu(e){if(e.startsWith("@")){const n=e.split("/");if(n.length>=2){const r=n[0],i=n.slice(1).join("/"),o=i.lastIndexOf("@");return o>0?{name:`${r}/${i.slice(0,o)}`,version:i.slice(o+1)}:{name:`${r}/${i}`}}}const t=e.lastIndexOf("@");return t>0?{name:e.slice(0,t),version:e.slice(t+1)}:{name:e}}async function jU(e,t){const n=t?`@${t}`:"",r=`${sx}/${e}${n}/package.json`,i=await fetch(r);if(!i.ok)throw new Error(`Failed to fetch package.json for ${e}: ${i.statusText}`);return i.json()}async function zU(e){if(typeof globalThis.require>"u"&&typeof process>"u")return null;try{const{createRequire:t}=await sg(async()=>{const{createRequire:g}=await import("./__vite-browser-external-BIHI7g3E.js");return{createRequire:g}},[]),{readFile:n}=await sg(async()=>{const{readFile:g}=await import("./__vite-browser-external-BIHI7g3E.js");return{readFile:g}},[]),{dirname:r,join:i}=await sg(async()=>{const{dirname:g,join:x}=await import("./__vite-browser-external-BIHI7g3E.js");return{dirname:g,join:x}},[]),o=t(import.meta.url);let s;try{s=o.resolve(`${e}/package.json`)}catch{return null}const a=await n(s,"utf-8"),u=JSON.parse(a),c=M4(u.patchwork)||N4;let f,h;const m=r(s);if(u.main)try{const x=await import(i(m,u.main));typeof x.setup=="function"&&(f=x.setup),typeof x.mount=="function"&&(h=x.mount)}catch{}return{name:u.name,version:u.version,config:c,dependencies:u.dependencies||{},setup:f,mount:h}}catch{return null}}async function LU(e){const{name:t,version:n}=Qu(e),r=await zU(t);if(r)return r;const i=await jU(t,n),o=M4(i.patchwork)||N4;let s,a,u;if(i.main&&typeof window<"u")try{const c=n?`@${n}`:"",f=i.main.startsWith("./")?i.main.slice(2):i.main,h=`${sx}/${t}${c}/${f}`;u=h;const m=await import(h);typeof m.setup=="function"&&(s=m.setup),typeof m.mount=="function"&&(a=m.mount)}catch(c){console.error("[patchwork-compiler] Failed to load image module:",c)}return{name:i.name,version:i.version,moduleUrl:u,config:o,dependencies:i.dependencies||{},setup:s,mount:a}}var FU=class{constructor(){vn(this,"images",new Map);vn(this,"loading",new Map)}get(e){const{name:t}=Qu(e);return this.images.get(t)}has(e){const{name:t}=Qu(e);return this.images.has(t)}async load(e){const{name:t}=Qu(e),n=this.images.get(t);if(n)return n;const r=this.loading.get(t);if(r)return r;const i=LU(e).then(o=>(this.images.set(t,o),this.loading.delete(t),o));return this.loading.set(t,i),i}async preload(e){await this.load(e)}clear(e){const{name:t}=Qu(e);this.images.delete(t),this.loading.delete(t)}clearAll(){this.images.clear(),this.loading.clear()}getLoadedNames(){return Array.from(this.images.keys())}},lg=null;function $U(){return lg||(lg=new FU),lg}var BU="https://esm.sh",I4=BU;function $2(e){I4=e}var UU=new Set(["react","react-dom","ink"]),VU=new Set(["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","process","querystring","readline","stream","string_decoder","timers","tls","tty","url","util","v8","vm","worker_threads","zlib"]);function I1(e,t,n,r){let i=`${I4}/${e}`;if(t&&(i+=`@${t}`),n&&(i+=`/${n}`),r&&Object.keys(r).length>0){const o=Object.entries(r).map(([s,a])=>`${s}@${a}`).join(",");i+=`?deps=${o}`}return i}function B2(e){return!(e.startsWith(".")||e.startsWith("/")||e.startsWith("http://")||e.startsWith("https://"))}function If(e){if(e.startsWith("@")){const i=e.split("/");if(i.length>=2){const o=`${i[0]}/${i[1]}`,s=i.slice(2).join("/");return{packageName:o,subpath:s||void 0}}}const t=e.split("/"),n=t[0],r=t.slice(1).join("/");return{packageName:n,subpath:r||void 0}}function HU(e,t){for(const[n,r]of Object.entries(t)){if(n.endsWith("/*")){const i=n.slice(0,-2);if(e===i||e.startsWith(i+"/"))return r}if(e===n)return r}return null}function WU(e={}){const{packages:t={},external:n=[],bundle:r=!1,globals:i={},deps:o={},aliases:s={}}=e,a=new Set([...UU,...n]),u=new Set(Object.keys(i));return{name:"cdn-transform",setup(c){c.onResolve({filter:/.*/},f=>{const h=HU(f.path,s);if(h){const{packageName:m,subpath:g}=If(h);if(u.has(m))return{path:h,namespace:"global-inject"};const x=t[m];let b=I1(m,x,g,Object.keys(o).length>0?o:void 0);return r&&(b+=b.includes("?")?"&bundle":"?bundle"),{path:b,external:!0}}return null}),c.onResolve({filter:/.*/},f=>{if(!B2(f.path))return null;const{packageName:h}=If(f.path);return u.has(h)?{path:f.path,namespace:"global-inject"}:null}),c.onLoad({filter:/.*/,namespace:"global-inject"},f=>{const{packageName:h,subpath:m}=If(f.path),g=i[h];return g?m?{contents:`export * from '${h}'; export { default } from '${h}';`,loader:"js"}:{contents:`
951
- const mod = window.${g};
952
- export default mod;
953
- // Re-export all properties as named exports
954
- const { ${U2(h).join(", ")} } = mod;
955
- export { ${U2(h).join(", ")} };
956
- `,loader:"js"}:null}),c.onResolve({filter:/.*/},f=>{if(!B2(f.path))return null;if(VU.has(f.path))return{external:!0};const{packageName:h,subpath:m}=If(f.path);if(u.has(h))return null;if(a.has(h))return{external:!0};const g=t[h];let x=I1(h,g,m,Object.keys(o).length>0?o:void 0);return r&&(x+=x.includes("?")?"&bundle":"?bundle"),{path:x,external:!0}})}}}function U2(e){return{react:["useState","useEffect","useCallback","useMemo","useRef","useContext","useReducer","useLayoutEffect","useId","createContext","createElement","cloneElement","createRef","forwardRef","lazy","memo","Fragment","Suspense","StrictMode","Component","PureComponent","Children","isValidElement"],"react-dom":["createPortal","flushSync","render","hydrate","unmountComponentAtNode"]}[e]||[]}function qU(e){const t={};for(const[n,r]of Object.entries(e))t[n]=I1(n,r);return t}function ZU(e){const t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)||"."}function JU(e){const t=[];for(const n of e.split("/"))n===".."?t.pop():n&&n!=="."&&t.push(n);return t.join("/")}function KU(e,t){if(t)switch(t){case"typescript":case"ts":return"ts";case"tsx":return"tsx";case"javascript":case"js":return"js";case"jsx":return"jsx";case"json":return"json";case"css":return"css"}switch(e.split(".").pop()){case"ts":return"ts";case"tsx":return"tsx";case"js":return"js";case"jsx":return"jsx";case"json":return"json";case"css":return"css";default:return"tsx"}}function D4(e){return e.startsWith("@/")?e.slice(2):e}function GU(e,t){const n=ZU(D4(e)),r=n==="."?t:`${n}/${t}`;return JU(r)}function YU(e,t){if(!t)return null;for(const[n,r]of Object.entries(t)){if(n.endsWith("/*")){const i=n.slice(0,-2);if(e===i||e.startsWith(i+"/"))return r}if(e===n)return r}return null}function QU(e,t){if(e.files.has(t))return t;const n=[".tsx",".ts",".jsx",".js",".json"];for(const r of n)if(e.files.has(t+r))return t+r;for(const r of n){const i=`${t}/index${r}`;if(e.files.has(i))return i}return null}function XU(e,t={}){return{name:"patchwork-vfs",setup(n){n.onResolve({filter:/^@\//},r=>YU(r.path,t.aliases)?null:{path:r.path,namespace:"vfs"}),n.onResolve({filter:/^\./},r=>r.namespace!=="vfs"?null:{path:GU(r.importer,r.path),namespace:"vfs"}),n.onLoad({filter:/.*/,namespace:"vfs"},r=>{const i=D4(r.path),o=QU(e,i);if(!o)throw new Error(`File not found in VFS: ${r.path}`);const s=e.files.get(o);return{contents:s.content,loader:KU(o,s.language)}})}}}function eV(e){return{async call(t,n,r){const i=`${e}/${t}/${n}`,o=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({args:r[0]??{}})});if(!o.ok)throw new Error(`Service call failed: ${o.status} ${o.statusText}`);return await o.json()}}}function tV(e,t){function n(r){const i=(...o)=>t(e,r,...o);return new Proxy(i,{get(o,s){if(typeof s=="symbol")return;const a=r?`${r}.${s}`:s;return n(a)}})}return new Proxy({},{get(r,i){if(typeof i!="symbol")return n(i)}})}function nV(e,t){const n={},r=ax(e);for(const i of r)n[i]=tV(i,(o,s,...a)=>t.call(o,s,a));return n}function rV(e,t){for(const[n,r]of Object.entries(t))e[n]=r}function iV(e,t){for(const n of t)delete e[n]}function ax(e){const t=new Set;for(const n of e){const r=n.split(".");r[0]&&t.add(r[0])}return Array.from(t)}var oV=class{constructor(e){vn(this,"proxy");vn(this,"pendingCalls",new Map);vn(this,"iframes",new Set);vn(this,"messageHandler");this.proxy=e,this.messageHandler=this.handleMessage.bind(this),typeof window<"u"&&window.addEventListener("message",this.messageHandler)}registerIframe(e){this.iframes.add(e)}unregisterIframe(e){this.iframes.delete(e)}async handleMessage(e){var r,i;const t=Array.from(this.iframes).find(o=>o.contentWindow===e.source);if(!t)return;const n=e.data;if(!(!n||typeof n!="object")&&n.type==="service-call"){const o=n.payload;try{const s=await this.proxy.call(o.namespace,o.procedure,o.args),a={type:"service-result",id:n.id,payload:{result:s}};(r=t.contentWindow)==null||r.postMessage(a,"*")}catch(s){const a={type:"service-result",id:n.id,payload:{error:s instanceof Error?s.message:String(s)}};(i=t.contentWindow)==null||i.postMessage(a,"*")}}}dispose(){typeof window<"u"&&window.removeEventListener("message",this.messageHandler),this.iframes.clear(),this.pendingCalls.clear()}};function sV(e){return`
957
- (function() {
958
- const pendingCalls = new Map();
959
-
960
- window.addEventListener('message', function(event) {
961
- const message = event.data;
962
- if (!message || typeof message !== 'object') return;
963
-
964
- if (message.type === 'service-result') {
965
- const pending = pendingCalls.get(message.id);
966
- if (pending) {
967
- pendingCalls.delete(message.id);
968
- if (message.payload.error) {
969
- pending.reject(new Error(message.payload.error));
970
- } else {
971
- pending.resolve(message.payload.result);
972
- }
973
- }
974
- }
975
- });
976
-
977
- function proxyCall(namespace, procedure, args) {
978
- return new Promise(function(resolve, reject) {
979
- const id = Date.now() + '-' + Math.random().toString(36).slice(2, 11);
980
- pendingCalls.set(id, { resolve: resolve, reject: reject });
981
-
982
- window.parent.postMessage({
983
- type: 'service-call',
984
- id: id,
985
- payload: { namespace: namespace, procedure: procedure, args: args }
986
- }, '*');
987
-
988
- setTimeout(function() {
989
- if (pendingCalls.has(id)) {
990
- pendingCalls.delete(id);
991
- reject(new Error('Service call timeout: ' + namespace + '.' + procedure));
992
- }
993
- }, 30000);
994
- });
995
- }
996
-
997
- // Create a dynamic proxy for a namespace that supports arbitrary nested method calls
998
- function createNamespaceProxy(namespace) {
999
- function createNestedProxy(path) {
1000
- var fn = function() {
1001
- return proxyCall(namespace, path, Array.prototype.slice.call(arguments));
1002
- };
1003
-
1004
- return new Proxy(fn, {
1005
- get: function(_, nestedName) {
1006
- if (typeof nestedName === 'symbol') return undefined;
1007
- var newPath = path ? path + '.' + nestedName : nestedName;
1008
- return createNestedProxy(newPath);
1009
- }
1010
- });
1011
- }
1012
-
1013
- return new Proxy({}, {
1014
- get: function(_, fieldName) {
1015
- if (typeof fieldName === 'symbol') return undefined;
1016
- return createNestedProxy(fieldName);
1017
- }
1018
- });
1019
- }
1020
-
1021
- ${ax(e).map(r=>`window.${r} = createNamespaceProxy('${r}');`).join(`
1022
- `)}
1023
- })();
1024
- `}var aV=0,ug=!1;function lV(e,t,n){if(ug)return;if(document.querySelector('script[type="importmap"]')){ug=!0;return}const i={};Object.keys(e).forEach((a,u)=>{t[u]?i[a]=t[u]:n!=null&&n[a]?i[a]=`https://esm.sh/${a}@${n[a]}`:i[a]=`https://esm.sh/${a}`}),i["react-dom"]&&(i["react-dom/client"]=i["react-dom"]);const s=document.createElement("script");s.type="importmap",s.textContent=JSON.stringify({imports:i},null,2),document.head.insertBefore(s,document.head.firstChild),ug=!0}function uV(){return`pw-mount-${Date.now()}-${++aV}`}function cV(e){for(const t of e){const n=t==null?void 0:t.createElement;if(typeof n=="function")return n;const r=t==null?void 0:t.default;if(r&&typeof r.createElement=="function")return r.createElement}return null}function dV(e){for(const t of e){if(t&&typeof t.createRoot=="function")return{kind:"root",createRoot:t.createRoot};if(t&&typeof t.render=="function")return{kind:"render",render:t.render};const n=t==null?void 0:t.default;if(n&&typeof n.createRoot=="function")return{kind:"root",createRoot:n.createRoot};if(n&&typeof n.render=="function")return{kind:"render",render:n.render}}return null}async function O4(e,t,n,r){var j;const{target:i,inputs:o={}}=t,s=uV(),a=document.createElement("div");if(a.id=s,a.className="patchwork-widget patchwork-embedded",i.appendChild(a),n!=null&&n.setup&&await n.setup(a),n!=null&&n.css){const O=document.createElement("style");O.id=`${s}-style`,O.textContent=n.css,document.head.appendChild(O)}const u=e.manifest.services||[],c=ax(u),f=nV(u,r);rV(window,f);const h=((j=n==null?void 0:n.config)==null?void 0:j.framework)||{},m=h.preload||[],g=h.globals||{},x=h.deps||{};lV(g,m,x);const b=await Promise.all(m.map(O=>import(O))),k=window,C=Object.values(g);b.forEach((O,R)=>{if(C[R]){const F=C[R];k[F]=O}});const _=new Blob([e.code],{type:"application/javascript"}),E=URL.createObjectURL(_);let I;const N=C.map(O=>k[O]).filter(Boolean);try{const O=await import(E);if(n!=null&&n.mount){const R=await n.mount(O,a,o);typeof R=="function"&&(I=R)}else if(typeof O.mount=="function"){const R=await O.mount(a,o);typeof R=="function"&&(I=R)}else if(typeof O.render=="function"){const R=await O.render(a,o);typeof R=="function"&&(I=R)}else if(typeof O.default=="function"){const R=O.default,F=cV(N),ee=dV(N);if(F&&(ee==null?void 0:ee.kind)==="root"){const X=ee.createRoot(a);X.render(F(R,o)),typeof X.unmount=="function"&&(I=()=>X.unmount())}else if(F&&(ee==null?void 0:ee.kind)==="render")ee.render(F(R,o),a);else{const X=R(o);X instanceof HTMLElement?a.appendChild(X):typeof X=="string"&&(a.innerHTML=X)}}}finally{URL.revokeObjectURL(E)}return{id:s,widget:e,mode:"embedded",target:i,inputs:o,unmount:()=>{I&&I(),iV(window,c);const O=document.getElementById(`${s}-style`);O&&O.remove(),a.remove()}}}async function fV(e,t,n,r){return e.unmount(),O4(t,{target:e.target,inputs:e.inputs},n,r)}var hV=0,cg=null;function pV(e){return cg||(cg=new oV(e)),cg}function mV(){return`pw-iframe-${Date.now()}-${++hV}`}var gV=["allow-scripts"];function yV(e,t,n,r){var x;const i=sV(n),o={...(e==null?void 0:e.dependencies)||{}},s=qU(o),a=(e==null?void 0:e.css)||"",u=((x=e==null?void 0:e.config)==null?void 0:x.framework)||{},c=u.preload||[],f=u.globals||{},h=Object.values(f),m=(e==null?void 0:e.moduleUrl)||"",g=`
1025
- // Run image setup inside the iframe (styling/runtime)
1026
- const imageModuleUrl = ${JSON.stringify(m)};
1027
-
1028
- // Preload framework modules declared by the image (if any)
1029
- const preloadUrls = ${JSON.stringify(c)};
1030
- const globalNames = ${JSON.stringify(h)};
1031
- for (let i = 0; i < preloadUrls.length; i++) {
1032
- const url = preloadUrls[i];
1033
- const name = globalNames[i];
1034
- if (!url || !name) continue;
1035
- try {
1036
- const mod = await import(/* webpackIgnore: true */ url);
1037
- window[name] = mod;
1038
- } catch (e) {
1039
- console.error('[patchwork-iframe] Failed to preload:', url, e);
1040
- }
1041
- }
1042
-
1043
- const root = document.getElementById('root');
1044
- const inputs = window.__PATCHWORK_INPUTS__ || {};
1045
-
1046
- if (imageModuleUrl && root) {
1047
- try {
1048
- const img = await import(/* webpackIgnore: true */ imageModuleUrl);
1049
- if (typeof img?.setup === 'function') {
1050
- await img.setup(root);
1051
- }
1052
- } catch (e) {
1053
- console.error('[patchwork-iframe] Failed to run image setup:', e);
1054
- }
1055
- }
1056
-
1057
- function pickCreateElement(globals) {
1058
- for (const obj of globals) {
1059
- if (obj && typeof obj.createElement === 'function') return obj.createElement.bind(obj);
1060
- if (obj?.default && typeof obj.default.createElement === 'function') return obj.default.createElement.bind(obj.default);
1061
- }
1062
- return null;
1063
- }
1064
-
1065
- function pickRenderer(globals) {
1066
- for (const obj of globals) {
1067
- if (obj && typeof obj.createRoot === 'function') {
1068
- return {
1069
- kind: 'root',
1070
- createRoot: obj.createRoot.bind(obj),
1071
- };
1072
- }
1073
- if (obj && typeof obj.render === 'function') {
1074
- return {
1075
- kind: 'render',
1076
- render: obj.render.bind(obj),
1077
- };
1078
- }
1079
- if (obj?.default && typeof obj.default.createRoot === 'function') {
1080
- return {
1081
- kind: 'root',
1082
- createRoot: obj.default.createRoot.bind(obj.default),
1083
- };
1084
- }
1085
- if (obj?.default && typeof obj.default.render === 'function') {
1086
- return {
1087
- kind: 'render',
1088
- render: obj.default.render.bind(obj.default),
1089
- };
1090
- }
1091
- }
1092
- return null;
1093
- }
1094
-
1095
- function getGlobalsFromConfig() {
1096
- const names = ${JSON.stringify(h)};
1097
- return names.map((n) => window[n]).filter(Boolean);
1098
- }
1099
-
1100
- async function mountModule(mod) {
1101
- if (!root) throw new Error('No #root element');
1102
-
1103
- if (typeof mod?.mount === 'function') {
1104
- const cleanup = await mod.mount(root, inputs);
1105
- if (typeof cleanup === 'function') window.__PATCHWORK_CLEANUP__ = cleanup;
1106
- return;
1107
- }
1108
-
1109
- if (typeof mod?.render === 'function') {
1110
- const cleanup = await mod.render(root, inputs);
1111
- if (typeof cleanup === 'function') window.__PATCHWORK_CLEANUP__ = cleanup;
1112
- return;
1113
- }
1114
-
1115
- const Component = mod?.default;
1116
- if (typeof Component !== 'function') {
1117
- root.textContent = 'Widget did not export a default component.';
1118
- return;
1119
- }
1120
-
1121
- const globals = getGlobalsFromConfig();
1122
- const createElement = pickCreateElement(globals);
1123
- const renderer = pickRenderer(globals);
1124
-
1125
- if (createElement && renderer?.kind === 'root') {
1126
- const r = renderer.createRoot(root);
1127
- r.render(createElement(Component, inputs));
1128
- if (typeof r.unmount === 'function') window.__PATCHWORK_CLEANUP__ = () => r.unmount();
1129
- return;
1130
- }
1131
-
1132
- if (createElement && renderer?.kind === 'render') {
1133
- renderer.render(createElement(Component, inputs), root);
1134
- return;
1135
- }
1136
-
1137
- const result = Component(inputs);
1138
- if (result instanceof HTMLElement) {
1139
- root.appendChild(result);
1140
- return;
1141
- }
1142
- if (typeof result === 'string') {
1143
- root.innerHTML = result;
1144
- return;
1145
- }
1146
-
1147
- root.textContent = 'No framework renderer available for this widget.';
1148
- }
1149
-
1150
- // Wait for widget code via postMessage (more efficient than inline in srcdoc)
1151
- // We convert relative URLs to absolute so they work inside blob URL context
1152
- window.addEventListener('message', async function handleWidgetCode(event) {
1153
- if (!event.data || event.data.type !== 'widget-code') return;
1154
- window.removeEventListener('message', handleWidgetCode);
1155
-
1156
- const widgetCode = event.data.code;
1157
- const origin = event.data.origin || ''; // Parent sends the origin
1158
-
1159
- // Convert relative URLs (starting with /) to absolute URLs
1160
- // This is necessary because blob: URLs can't resolve relative imports
1161
- // and srcdoc iframes have null origin
1162
- const absoluteCode = widgetCode.replace(
1163
- /from\\s*["'](\\/[^"']+)["']/g,
1164
- (_, path) => 'from "' + origin + path + '"'
1165
- ).replace(
1166
- /import\\s*["'](\\/[^"']+)["']/g,
1167
- (_, path) => 'import "' + origin + path + '"'
1168
- );
1169
-
1170
- const blob = new Blob([absoluteCode], { type: 'application/javascript' });
1171
- const url = URL.createObjectURL(blob);
1172
-
1173
- try {
1174
- const mod = await import(/* webpackIgnore: true */ url);
1175
- await mountModule(mod);
1176
- window.parent.postMessage({ type: 'widget-mounted' }, '*');
1177
- } catch (e) {
1178
- console.error('[patchwork-iframe] Failed to mount widget:', e);
1179
- window.parent.postMessage({ type: 'widget-error', error: e.message }, '*');
1180
- } finally {
1181
- URL.revokeObjectURL(url);
1182
- }
1183
- });
1184
-
1185
- // Signal ready to receive widget code
1186
- window.parent.postMessage({ type: 'widget-ready' }, '*');
1187
-
1188
- // Set up ResizeObserver to report body size changes to parent
1189
- const resizeObserver = new ResizeObserver((entries) => {
1190
- for (const entry of entries) {
1191
- const { width, height } = entry.contentRect;
1192
- window.parent.postMessage({
1193
- type: 'widget-resize',
1194
- width: Math.ceil(width),
1195
- height: Math.ceil(height)
1196
- }, '*');
1197
- }
1198
- });
1199
- resizeObserver.observe(document.body);
1200
- `;return`<!DOCTYPE html>
1201
- <html>
1202
- <head>
1203
- <base href="${r}">
1204
- <meta charset="UTF-8">
1205
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
1206
- <style>
1207
- * { box-sizing: border-box; margin: 0; padding: 0; }
1208
- body { font-family: system-ui, -apple-system, sans-serif; }
1209
- ${a}
1210
- </style>
1211
- <script type="importmap">
1212
- ${JSON.stringify({imports:s},null,2)}
1213
- <\/script>
1214
- </head>
1215
- <body>
1216
- <div id="root"></div>
1217
-
1218
- <!-- Service Bridge -->
1219
- <script>
1220
- ${i}
1221
- <\/script>
1222
-
1223
- <!-- Widget Inputs -->
1224
- <script>
1225
- window.__PATCHWORK_INPUTS__ = ${JSON.stringify(t)};
1226
- <\/script>
1227
-
1228
- <script type="module">
1229
- ${g}
1230
- <\/script>
1231
- </body>
1232
- </html>`}async function R4(e,t,n,r){const{target:i,sandbox:o=gV,inputs:s={}}=t,a=mV(),u=document.createElement("iframe");u.id=a,u.className="patchwork-widget patchwork-iframe",u.style.cssText="width: 100%; border: none; overflow: hidden;",u.sandbox.add(...o);const c=pV(r);c.registerIframe(u);const f=e.manifest.services||[],h=typeof window<"u"?window.location.origin:"",m=yV(n,s,f,h);u.srcdoc=m,i.appendChild(u);const g=b=>{var k;if(b.source===u.contentWindow&&((k=b.data)==null?void 0:k.type)==="widget-resize"){const{height:C}=b.data;typeof C=="number"&&C>0&&(u.style.height=`${C}px`)}};return window.addEventListener("message",g),await new Promise((b,k)=>{const C=setTimeout(()=>{E(),k(new Error("Iframe mount timeout"))},3e4),_=I=>{var N,M,j,O;I.source===u.contentWindow&&(((N=I.data)==null?void 0:N.type)==="widget-ready"?(M=u.contentWindow)==null||M.postMessage({type:"widget-code",code:e.code,origin:h},"*"):((j=I.data)==null?void 0:j.type)==="widget-mounted"?(E(),b()):((O=I.data)==null?void 0:O.type)==="widget-error"&&(E(),k(new Error(I.data.error||"Widget mount failed"))))},E=()=>{clearTimeout(C),window.removeEventListener("message",_)};window.addEventListener("message",_)}),{id:a,widget:e,mode:"iframe",target:i,iframe:u,inputs:s,sandbox:o,unmount:()=>{window.removeEventListener("message",g),c.unregisterIframe(u),u.remove()}}}async function xV(e,t,n,r){return e.unmount(),R4(t,{target:e.target,sandbox:e.sandbox,inputs:e.inputs},n,r)}var dg=!1,Df=null;async function bV(){if(!dg)return Df||(Df=(async()=>{try{await T4.initialize({wasmURL:"https://unpkg.com/esbuild-wasm/esbuild.wasm"}),dg=!0}catch(e){if(e instanceof Error&&e.message.includes("initialized"))dg=!0;else throw e}})(),Df)}function vV(e){const n=new TextEncoder().encode(e);let r=0;for(let i=0;i<n.length;i++)r=(r<<5)-r+(n[i]??0)|0;return Math.abs(r).toString(16).padStart(8,"0")}async function kV(e){await bV();const{image:t,proxyUrl:n,cdnBaseUrl:r,widgetCdnBaseUrl:i}=e;r&&PU(r),i?$2(i):r&&$2(r);const o=$U();await o.preload(t);const s=eV(n);return new wV(s,o)}var wV=class{constructor(e,t){vn(this,"proxy");vn(this,"registry");this.proxy=e,this.registry=t}async preloadImage(e){await this.registry.preload(e)}isImageLoaded(e){return this.registry.has(e)}async compile(e,t,n={}){var I,N;const r=typeof e=="string"?Eh(e):e,i=r.entry.split(".").pop(),o=i==="ts"||i==="tsx"?"tsx":"jsx",s=this.registry.get(t.image)||null,a=(s==null?void 0:s.config.esbuild)||{},u=(s==null?void 0:s.config.framework)||{},c=a.target||"es2020",f=a.format||"esm",h=a.jsx??"automatic",m={...(s==null?void 0:s.dependencies)||{},...t.packages||{}},g=u.globals||{},x=u.deps||{},b=(s==null?void 0:s.config.aliases)||{},k=r.files.get(r.entry);if(!k)throw new Error(`Entry file not found: ${r.entry}`);const _=((N=(I=(await T4.build({stdin:{contents:k.content,loader:o,sourcefile:r.entry},bundle:!0,format:f,target:c,platform:t.platform==="cli"?"node":"browser",jsx:h,...a.jsxFactory?{jsxFactory:a.jsxFactory}:{},...a.jsxFragment?{jsxFragment:a.jsxFragment}:{},write:!1,sourcemap:"inline",plugins:[XU(r,{aliases:b}),WU({packages:m,globals:g,deps:x,aliases:b})]})).outputFiles)==null?void 0:I[0])==null?void 0:N.text)||"",E=vV(_);return{code:_,hash:E,manifest:t}}async mount(e,t){const n=this.registry.get(e.manifest.image)||null;return t.mode==="iframe"?R4(e,t,n,this.proxy):O4(e,t,n,this.proxy)}unmount(e){e.unmount()}async reload(e,t,n){const r=await this.compile(t,n),i=this.registry.get(r.manifest.image)||null;e.mode==="iframe"?await xV(e,r,i,this.proxy):await fV(e,r,i,this.proxy)}};function D1(e,t,n=!1){return{size:e,mtime:t,isFile:()=>!n,isDirectory:()=>n}}function P4(e,t){return{name:e,isFile:()=>!t,isDirectory:()=>t}}function kr(e){return e.replace(/\/+/g,"/").replace(/^\/|\/$/g,"")}function fg(e){const t=kr(e),n=t.lastIndexOf("/");return n===-1?"":t.slice(0,n)}function j4(...e){return kr(e.filter(Boolean).join("/"))}var CV=class{constructor(){vn(this,"files",new Map);vn(this,"dirs",new Set([""]));vn(this,"watchers",new Map)}async readFile(e){const t=this.files.get(kr(e));if(!t)throw new Error(`ENOENT: ${e}`);return t.content}async writeFile(e,t){const n=kr(e),r=fg(n);if(r&&!this.dirs.has(r))throw new Error(`ENOENT: ${r}`);const i=!this.files.has(n);this.files.set(n,{content:t,mtime:new Date}),this.emit(i?"create":"update",n)}async unlink(e){const t=kr(e);if(!this.files.delete(t))throw new Error(`ENOENT: ${e}`);this.emit("delete",t)}async stat(e){const t=kr(e),n=this.files.get(t);if(n)return D1(n.content.length,n.mtime,!1);if(this.dirs.has(t))return D1(0,new Date,!0);throw new Error(`ENOENT: ${e}`)}async mkdir(e,t){const n=kr(e);if(this.dirs.has(n))return;const r=fg(n);if(r&&!this.dirs.has(r))if(t!=null&&t.recursive)await this.mkdir(r,t);else throw new Error(`ENOENT: ${r}`);this.dirs.add(n)}async readdir(e){const t=kr(e);if(!this.dirs.has(t))throw new Error(`ENOENT: ${e}`);const n=t?`${t}/`:"",r=new Map;for(const i of this.files.keys())if(i.startsWith(n)){const s=i.slice(n.length).split("/")[0];s&&r.set(s,!1)}for(const i of this.dirs)if(i.startsWith(n)&&i!==t){const s=i.slice(n.length).split("/")[0];s&&r.set(s,!0)}return Array.from(r).map(([i,o])=>P4(i,o))}async rmdir(e,t){const n=kr(e);if(!this.dirs.has(n))throw new Error(`ENOENT: ${e}`);const r=`${n}/`;if(([...this.files.keys()].some(o=>o.startsWith(r))||[...this.dirs].some(o=>o.startsWith(r)))&&!(t!=null&&t.recursive))throw new Error(`ENOTEMPTY: ${e}`);if(t!=null&&t.recursive){for(const o of this.files.keys())o.startsWith(r)&&(this.files.delete(o),this.emit("delete",o));for(const o of this.dirs)o.startsWith(r)&&this.dirs.delete(o)}this.dirs.delete(n)}async exists(e){const t=kr(e);return this.files.has(t)||this.dirs.has(t)}watch(e,t){const n=kr(e);let r=this.watchers.get(n);return r||(r=new Set,this.watchers.set(n,r)),r.add(t),()=>r.delete(t)}emit(e,t){let n=t;for(;;){const r=this.watchers.get(n);if(r)for(const i of r)i(e,t);if(!n)break;n=fg(n)}}},SV=class{constructor(e){vn(this,"changes",new Map);vn(this,"listeners",new Set);vn(this,"backend");this.backend=e??new CV}async readFile(e,t){return this.backend.readFile(e,t)}async writeFile(e,t){const n=await this.backend.exists(e);await this.backend.writeFile(e,t),this.recordChange(e,n?"update":"create")}async applyRemoteFile(e,t){await this.backend.writeFile(e,t)}async applyRemoteDelete(e){try{await this.backend.exists(e)&&await this.backend.unlink(e)}catch{return}}async unlink(e){await this.backend.unlink(e),this.recordChange(e,"delete")}async stat(e){return this.backend.stat(e)}async mkdir(e,t){return this.backend.mkdir(e,t)}async readdir(e){return this.backend.readdir(e)}async rmdir(e,t){return this.backend.rmdir(e,t)}async exists(e){return this.backend.exists(e)}watch(e,t){return this.backend.watch?this.backend.watch(e,t):()=>{}}getChanges(){return Array.from(this.changes.values())}clearChanges(){this.changes.clear()}markSynced(e){for(const t of e)this.changes.delete(t)}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}recordChange(e,t){const n={path:e,type:t,mtime:new Date};this.changes.set(e,n);for(const r of this.listeners)r(n)}};function EV(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=t+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)>>>0;return t.toString(16).padStart(8,"0")}async function V2(e,t){try{const n=await e.readFile(t);return EV(n)}catch{return}}async function H2(e,t,n,r){const[i,o]=await Promise.all([V2(e,t),V2(n,r)]);return{local:i,remote:o}}function hg(e){if(e.remoteMtime<=e.changeMtime||e.localChecksum&&e.remoteChecksum&&e.localChecksum===e.remoteChecksum)return null;const t={path:e.path,localMtime:e.changeMtime,remoteMtime:e.remoteMtime};switch(e.strategy){case"local-wins":t.resolved="local";break;case"remote-wins":t.resolved="remote";break;case"newest-wins":t.resolved=e.remoteMtime>e.changeMtime?"remote":"local";break}return t}var _V=class{constructor(e,t,n={}){vn(this,"status","idle");vn(this,"intervalId");vn(this,"listeners",new Map);vn(this,"conflictStrategy");vn(this,"basePath");this.local=e,this.remote=t,this.conflictStrategy=n.conflictStrategy??"local-wins",this.basePath=n.basePath??"",this.startRemoteWatch()}async sync(){if(this.status==="syncing")return{pushed:0,pulled:0,conflicts:[]};this.setStatus("syncing");const e={pushed:0,pulled:0,conflicts:[]};try{const t=this.local.getChanges(),n=new Map(t.map(a=>[a.path,a])),r=[],i=await this.listFiles(this.remote,this.basePath),o=await this.listFiles(this.local,""),s=new Set(i.map(a=>this.localPath(a)));for(const a of i){const u=this.localPath(a),c=n.get(u);if(c){const f=await this.checkConflict(c,a);f&&(e.conflicts.push(f),this.emit("conflict",f),f.resolved==="remote"&&(await this.pullRemoteFile(u,a)&&(e.pulled++,this.emit("change",{path:u,type:"update",mtime:new Date})),r.push(u)));continue}await this.pullRemoteFile(u,a)&&(e.pulled++,this.emit("change",{path:u,type:"update",mtime:new Date}))}for(const a of o)s.has(a)||n.has(a)||(await this.local.applyRemoteDelete(a),e.pulled++,this.emit("change",{path:a,type:"delete",mtime:new Date}));for(const a of t){if(r.includes(a.path))continue;const u=this.remotePath(a.path);try{const c=await this.checkConflict(a,u);if(c&&(e.conflicts.push(c),this.emit("conflict",c),c.resolved==="remote"&&(await this.pullRemoteFile(a.path,u)&&(e.pulled++,this.emit("change",{path:a.path,type:"update",mtime:new Date})),r.push(a.path)),c.resolved!=="local"))continue;if(a.type==="delete"){await this.remote.exists(u)&&await this.remote.unlink(u),e.pushed++,r.push(a.path),this.emit("change",a);continue}const f=await this.local.readFile(a.path);await this.remote.writeFile(u,f),e.pushed++,r.push(a.path),this.emit("change",a)}catch(c){this.emit("error",c instanceof Error?c:new Error(String(c)))}}r.length>0&&this.local.markSynced(r),this.setStatus("idle")}catch(t){this.setStatus("error"),this.emit("error",t instanceof Error?t:new Error(String(t)))}return e}startAutoSync(e){this.stopAutoSync(),this.intervalId=setInterval(()=>this.sync(),e)}stopAutoSync(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>n.delete(t)}emit(e,t){const n=this.listeners.get(e);if(n)for(const r of n)r(t)}setStatus(e){this.status=e,this.emit("status",e)}remotePath(e){return this.basePath?j4(this.basePath,e):e}localPath(e){if(!this.basePath)return kr(e);const t=kr(e),n=kr(this.basePath);return t===n?"":t.startsWith(`${n}/`)?t.slice(n.length+1):t}async listFiles(e,t){const n=kr(t);let r=[];try{r=await e.readdir(n)}catch{return[]}const i=[];for(const o of r){const s=n?`${n}/${o.name}`:o.name;o.isDirectory()?i.push(...await this.listFiles(e,s)):i.push(s)}return i}async pullRemoteFile(e,t){let n=null;try{await this.local.exists(e)&&(n=await this.local.readFile(e))}catch{n=null}const r=await this.remote.readFile(t);return n===r?!1:(await this.local.applyRemoteFile(e,r),!0)}startRemoteWatch(){this.remote.watch&&this.remote.watch(this.basePath,(e,t)=>{this.handleRemoteEvent(e,t)})}async handleRemoteEvent(e,t){const n=this.localPath(t),r=this.local.getChanges().find(i=>i.path===n);if(r){const i=await this.checkRemoteEventConflict(r,t,e);if(i){this.emit("conflict",i),i.resolved==="remote"&&(await this.applyRemoteEvent(e,n,t),this.local.markSynced([n]),this.emit("change",{path:n,type:e,mtime:new Date}));return}return}try{await this.applyRemoteEvent(e,n,t),this.emit("change",{path:n,type:e,mtime:new Date})}catch(i){this.emit("error",i instanceof Error?i:new Error(String(i)))}}async checkConflict(e,t){try{const n=await this.remote.stat(t);if(n.mtime<=e.mtime)return null;const r=await H2(this.local,e.path,this.remote,t);return hg({path:e.path,changeMtime:e.mtime,remoteMtime:n.mtime,localChecksum:r.local,remoteChecksum:r.remote,strategy:this.conflictStrategy})}catch{return null}}async checkRemoteEventConflict(e,t,n){if(n==="delete")return e.type==="delete"?null:hg({path:e.path,changeMtime:e.mtime,remoteMtime:new Date,strategy:this.conflictStrategy});try{const r=await this.remote.stat(t);if(r.mtime<=e.mtime)return null;const i=await H2(this.local,e.path,this.remote,t);return hg({path:e.path,changeMtime:e.mtime,remoteMtime:r.mtime,localChecksum:i.local,remoteChecksum:i.remote,strategy:this.conflictStrategy})}catch{return null}}async applyRemoteEvent(e,t,n){if(e==="delete"){await this.local.applyRemoteDelete(t);return}const r=await this.remote.readFile(n);await this.local.applyRemoteFile(t,r)}},TV=class{constructor(e){this.config=e}async readFile(e){const t=await fetch(this.url(e));if(!t.ok)throw new Error(`ENOENT: ${e}`);return t.text()}async writeFile(e,t){if(!(await fetch(this.url(e),{method:"PUT",body:t,headers:{"Content-Type":"text/plain"}})).ok)throw new Error(`Failed to write: ${e}`)}async unlink(e){if(!(await fetch(this.url(e),{method:"DELETE"})).ok)throw new Error(`Failed to delete: ${e}`)}async stat(e){const t=await fetch(this.url(e,{stat:"true"}));if(!t.ok)throw new Error(`ENOENT: ${e}`);const n=await t.json();return D1(n.size,new Date(n.mtime),n.isDirectory)}async mkdir(e,t){const n={mkdir:"true"};if(t!=null&&t.recursive&&(n.recursive="true"),!(await fetch(this.url(e,n),{method:"POST"})).ok)throw new Error(`Failed to mkdir: ${e}`)}async readdir(e){const t=await fetch(this.url(e,{readdir:"true"}));if(!t.ok)throw new Error(`ENOENT: ${e}`);return(await t.json()).map(r=>P4(r.name,r.isDirectory))}async rmdir(e,t){const n={};if(t!=null&&t.recursive&&(n.recursive="true"),!(await fetch(this.url(e,n),{method:"DELETE"})).ok)throw new Error(`Failed to rmdir: ${e}`)}async exists(e){return(await fetch(this.url(e),{method:"HEAD"})).ok}watch(e,t){const n=new AbortController;return this.startWatch(e,t,n.signal),()=>n.abort()}async startWatch(e,t,n){var r;try{const i=await fetch(this.url("",{watch:e}),{signal:n});if(!i.ok)return;const o=(r=i.body)==null?void 0:r.getReader();if(!o)return;const s=new TextDecoder;let a="";for(;!n.aborted;){const{done:u,value:c}=await o.read();if(u)break;a+=s.decode(c,{stream:!0});const f=a.split(`
1233
- `);a=f.pop()??"";for(const h of f)if(h.startsWith("data: "))try{const m=JSON.parse(h.slice(6));t(m.type,m.path)}catch{}}}catch{}}url(e,t){const n=this.config.baseUrl.replace(/\/+$/,""),r=e.replace(/^\/+/,""),i=r?`${n}/${r}`:n;if(!t)return i;const o=new URLSearchParams(t).toString();return`${i}?${o}`}},AV=class{constructor(e,t={}){vn(this,"local");vn(this,"syncEngine");vn(this,"root");this.provider=e,this.root=t.root??"",t.sync&&(this.local=new SV,this.syncEngine=new _V(this.local,this.provider,{conflictStrategy:t.conflictStrategy,basePath:this.root}),t.autoSyncIntervalMs&&this.syncEngine.startAutoSync(t.autoSyncIntervalMs))}async readFile(e,t){if(this.local)try{return await this.local.readFile(e,t)}catch{const n=await this.provider.readFile(this.remotePath(e),t);return await this.local.applyRemoteFile(e,n),n}return this.provider.readFile(this.remotePath(e),t)}async writeFile(e,t){if(this.local){await this.local.writeFile(e,t);return}await this.provider.writeFile(this.remotePath(e),t)}async unlink(e){if(this.local){await this.local.unlink(e);return}await this.provider.unlink(this.remotePath(e))}async stat(e){if(this.local)try{return await this.local.stat(e)}catch{return this.provider.stat(this.remotePath(e))}return this.provider.stat(this.remotePath(e))}async mkdir(e,t){this.local&&await this.local.mkdir(e,t),await this.provider.mkdir(this.remotePath(e),t)}async readdir(e){if(this.local)try{return await this.local.readdir(e)}catch{return this.provider.readdir(this.remotePath(e))}return this.provider.readdir(this.remotePath(e))}async rmdir(e,t){this.local&&await this.local.rmdir(e,t),await this.provider.rmdir(this.remotePath(e),t)}async exists(e){return this.local?await this.local.exists(e)?!0:this.provider.exists(this.remotePath(e)):this.provider.exists(this.remotePath(e))}async listFiles(e=""){return this.walkFiles(e)}async loadProject(e){const t=await this.listFiles(e);if(t.length===0)return null;const n=new Map;return await Promise.all(t.map(async r=>{const i=await this.provider.readFile(this.remotePath(r)),o=r.slice(e.length+1);n.set(o,{path:o,content:i}),this.local&&await this.local.applyRemoteFile(r,i)})),{id:e,entry:_U(n),files:n}}async saveProject(e){if(this.local){await Promise.all(Array.from(e.files.values()).map(t=>this.local.writeFile(`${e.id}/${t.path}`,t.content))),await this.sync();return}await Promise.all(Array.from(e.files.values()).map(t=>this.provider.writeFile(this.remotePath(`${e.id}/${t.path}`),t.content)))}async sync(){return this.syncEngine?this.syncEngine.sync():{pushed:0,pulled:0,conflicts:[]}}on(e,t){return this.syncEngine?this.syncEngine.on(e,t):()=>{}}remotePath(e){return this.root?j4(this.root,e):e}async walkFiles(e){const t=[],n=e?e.replace(/^\/+/g,""):"";let r=[];try{r=await this.provider.readdir(this.remotePath(n))}catch{return t}for(const i of r){const o=n?`${n}/${i.name}`:i.name;i.isDirectory()?t.push(...await this.walkFiles(o)):t.push(o)}return t}};function tr(e){this.content=e}tr.prototype={constructor:tr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new tr(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new tr(n)},addToStart:function(e,t){return new tr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new tr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new tr(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=tr.from(e),e.size?new tr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=tr.from(e),e.size?new tr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=tr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};tr.from=function(e){if(e instanceof tr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tr(t)};function z4(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=z4(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function L4(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),u=s.nodeSize;if(s==a){n-=u,r-=u;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,f=Math.min(s.text.length,a.text.length);for(;c<f&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=L4(s.content,a.content,n-1,r-1);if(c)return c}n-=u,r-=u}}class me{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let u=this.content[s],c=a+u.nodeSize;if(c>t&&r(u,i+a,o||null,s)!==!1&&u.content.size){let f=a+1;u.nodesBetween(Math.max(0,t-f),Math.min(u.content.size,n-f),r,i+f)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,u)=>{let c=a.isText?a.text.slice(Math.max(t,u)-u,n-u):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new me(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],u=s+a.nodeSize;u>t&&((s<t||u>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=u}return new me(r,i)}cutByIndex(t,n){return t==n?me.empty:t==0&&n==this.content.length?this:new me(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new me(i,o)}addToStart(t){return new me([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new me(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return z4(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return L4(this,t,n,r)}findIndex(t){if(t==0)return Of(0,t);if(t==this.size)return Of(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?Of(n+1,o):Of(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return me.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new me(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return me.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new me(n||t,r)}static from(t){if(!t)return me.empty;if(t instanceof me)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new me([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}me.empty=new me([],0);const pg={index:0,offset:0};function Of(e,t){return pg.index=e,pg.offset=t,pg}function _h(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!_h(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!_h(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let qt=class O1{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&_h(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return O1.none;if(t instanceof O1)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};qt.none=[];class Th extends Error{}class qe{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=$4(this.content,t+this.openStart,n);return r&&new qe(r,this.openStart,this.openEnd)}removeBetween(t,n){return new qe(F4(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return qe.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new qe(me.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new qe(t,r,i)}}qe.empty=new qe(me.empty,0,0);function F4(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(F4(o.content,t-i-1,n-i-1)))}function $4(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=$4(s.content,t-o-1,n,s);return a&&e.replaceChild(i,s.copy(a))}function MV(e,t,n){if(n.openStart>e.depth)throw new Th("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Th("Inconsistent open depths");return B4(e,t,n,0)}function B4(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=B4(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return Ca(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=NV(n,e);return Ca(o,V4(e,s,a,t,r))}else return Ca(o,Ah(e,t,r))}function U4(e,t){if(!t.type.compatibleContent(e.type))throw new Th("Cannot join "+t.type.name+" onto "+e.type.name)}function R1(e,t,n){let r=e.node(n);return U4(r,t.node(n)),r}function wa(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function fc(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(wa(e.nodeAfter,r),o++));for(let a=o;a<s;a++)wa(i.child(a),r);t&&t.depth==n&&t.textOffset&&wa(t.nodeBefore,r)}function Ca(e,t){return e.type.checkContent(t),e.copy(t)}function V4(e,t,n,r,i){let o=e.depth>i&&R1(e,t,i+1),s=r.depth>i&&R1(n,r,i+1),a=[];return fc(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(U4(o,s),wa(Ca(o,V4(e,t,n,r,i+1)),a)):(o&&wa(Ca(o,Ah(e,t,i+1)),a),fc(t,n,i,a),s&&wa(Ca(s,Ah(n,r,i+1)),a)),fc(r,null,i,a),new me(a)}function Ah(e,t,n){let r=[];if(fc(null,e,n,r),e.depth>n){let i=R1(e,t,n+1);wa(Ca(i,Ah(e,t,n+1)),r)}return fc(t,null,n,r),new me(r)}function NV(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(me.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class jc{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return qt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Mh(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:u}=s.content.findIndex(o),c=o-u;if(r.push(s,a,i+u),!c||(s=s.child(a),s.isText))break;o=c-1,i+=u+1}return new jc(n,r,o)}static resolveCached(t,n){let r=W2.get(t);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else W2.set(t,r=new IV);let i=r.elts[r.i]=jc.resolve(t,n);return r.i=(r.i+1)%DV,i}}class IV{constructor(){this.elts=[],this.i=0}}const DV=12,W2=new WeakMap;class Mh{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const OV=Object.create(null);let Ds=class P1{constructor(t,n,r,i=qt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||me.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&_h(this.attrs,n||t.defaultAttrs||OV)&&qt.sameSet(this.marks,r||qt.none)}copy(t=null){return t==this.content?this:new P1(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new P1(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return qe.empty;let i=this.resolve(t),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new qe(c,i.depth-s,o.depth-s)}replace(t,n,r){return MV(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return jc.resolveCached(this,t)}resolveNoCache(t){return jc.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),H4(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=me.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=qt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!qt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=me.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Ds.prototype.text=void 0;class Nh extends Ds{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):H4(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Nh(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Nh(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function H4(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ia{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new RV(t,n);if(r.next==null)return Ia.empty;let i=W4(r);r.next&&r.err("Unexpected trailing text");let o=BV($V(i));return UV(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(s,a){let u=s.matchFragment(t,r);if(u&&(!n||u.validEnd))return me.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:f,next:h}=s.next[c];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let m=o(h,a.concat(f));if(m)return m}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:u}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||u.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return o}).join(`
1234
- `)}}Ia.empty=new Ia(!0);class RV{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function W4(e){let t=[];do t.push(PV(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function PV(e){let t=[];do t.push(jV(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function jV(e){let t=FV(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=zV(e,t);else break;return t}function q2(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function zV(e,t){let n=q2(e),r=n;return e.eat(",")&&(e.next!="}"?r=q2(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function LV(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function FV(e){if(e.eat("(")){let t=W4(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=LV(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function $V(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,u){let c={term:u,to:a};return t[s].push(c),c}function i(s,a){s.forEach(u=>u.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((u,c)=>u.concat(o(c,a)),[]);if(s.type=="seq")for(let u=0;;u++){let c=o(s.exprs[u],a);if(u==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let u=n();return r(a,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,a),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let u=a;for(let c=0;c<s.min;c++){let f=n();i(o(s.expr,u),f),u=f}if(s.max==-1)i(o(s.expr,u),u);else for(let c=s.min;c<s.max;c++){let f=n();r(u,f),i(o(s.expr,u),f),u=f}return[r(u)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function q4(e,t){return t-e}function Z2(e,t){let n=[];return r(t),n.sort(q4);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:u}=o[s];!a&&n.indexOf(u)==-1&&r(u)}}}function BV(e){let t=Object.create(null);return n(Z2(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:u})=>{if(!a)return;let c;for(let f=0;f<i.length;f++)i[f][0]==a&&(c=i[f][1]);Z2(e,u).forEach(f=>{c||i.push([a,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let o=t[r.join(",")]=new Ia(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(q4);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function UV(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:u,next:c}=i.next[a];s.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Z4(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function J4(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function K4(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function G4(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new HV(e,r,t[r]);return n}let J2=class Y4{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=G4(t,r.attrs),this.defaultAttrs=Z4(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ia.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:J4(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ds(this,this.computeAttrs(t),me.from(n),qt.setFrom(r))}createChecked(t=null,n,r){return n=me.from(n),this.checkContent(n),new Ds(this,this.computeAttrs(t),n,qt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=me.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(me.empty,!0);return o?new Ds(this,t,n.append(o),qt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){K4(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:qt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new Y4(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function VV(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class HV{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?VV(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Op{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=G4(t,i.attrs),this.excluded=null;let o=Z4(this.attrs);this.instance=o?new qt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new qt(this,J4(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Op(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){K4(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class lx{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=tr.from(t.nodes),n.marks=tr.from(t.marks||{}),this.nodes=J2.compile(this.spec.nodes,this),this.marks=Op.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ia.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?K2(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:K2(this,s.split(" "))}this.nodeFromJSON=i=>Ds.fromJSON(this,i),this.markFromJSON=i=>qt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof J2){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Nh(r,r.defaultAttrs,t,qt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function K2(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let a in e.marks){let u=e.marks[a];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function WV(e){return e.tag!=null}function qV(e){return e.style!=null}class Ro{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(WV(i))this.tags.push(i);else if(qV(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Y2(this,n,!1);return r.addAll(t,qt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Y2(this,n,!0);return r.addAll(t,qt.none,n.from,n.to),qe.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(KV(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(t);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Q2(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Q2(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ro(t,Ro.schemaRules(t)))}}const Q4={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ZV={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},X4={ol:!0,ul:!0},zc=1,j1=2,hc=4;function G2(e,t,n){return t!=null?(t?zc:0)|(t==="full"?j1:0):e&&e.whitespace=="pre"?zc|j1:n&~hc}class Rf{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=qt.none,this.match=o||(s&hc?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(me.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&zc)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=me.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(me.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Q4.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Y2{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=G2(null,n.preserveWhitespace,0)|(r?hc:0);i?o=new Rf(i.type,i.attrs,qt.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Rf(null,null,qt.none,!0,null,s):o=new Rf(t.schema.topNodeType,null,qt.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&j1?"full":this.localPreserveWS||(i.options&zc)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
1235
- `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let u=0;u<a.length;u++)u&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[u]&&this.insertNode(s.text(a[u]),n,!/\S/.test(a[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=t.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;X4.hasOwnProperty(s)&&this.parser.normalizeLists&&JV(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(u?u.ignore:ZV.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let c,f=this.needsBlock;if(Q4.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let h=u&&u.skip?n:this.readStyles(t,n);h&&this.addAll(t,h),c&&this.sync(o),this.needsBlock=f}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,u,c,u.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
1236
- `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let u=this.parser.matchStyle(o,s,this,a);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(c=>!u.clearMark(c)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)a=u;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let u=this.nodes[s],c=u.findWrapping(t);if(c&&(!i||i.length>c.length+a)&&(i=c,o=u,!c.length))break;if(u.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=qt.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):X2(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=G2(t,o,s.options);s.options&hc&&s.content.length==0&&(a|=hc);let u=qt.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):X2(c.type,t))?(u=c.addToSet(u),!1):!0),this.nodes.push(new Rf(t,n,u,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=zc)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,u)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;u>=o;u--)if(s(a-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=c&&!f.isInGroup(c))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function JV(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&X4.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function KV(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Q2(e){let t={};for(let n in e)t[n]=e[n];return t}function X2(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let u=0;u<a.edgeCount;u++){let{type:c,next:f}=a.edge(u);if(c==t||o.indexOf(f)<0&&s(f))return!0}};if(s(i.contentMatch))return!0}}class Ba{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=mg(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let a=0,u=0;for(;a<o.length&&u<s.marks.length;){let c=s.marks[u];if(!this.marks[c.type.name]){u++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,u++}for(;a<o.length;)i=o.pop()[1];for(;u<s.marks.length;){let c=s.marks[u++],f=this.serializeMark(c,s.isInline,n);f&&(o.push([c,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Qf(mg(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Qf(mg(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Qf(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ba(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=eC(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return eC(t.marks)}}function eC(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function mg(e){return e.document||window.document}const tC=new WeakMap;function GV(e){let t=tC.get(e);return t===void 0&&tC.set(e,t=YV(e)),t}function YV(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Qf(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=GV(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,u=n?e.createElementNS(n,i):e.createElement(i),c=t[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let h in c)if(c[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),c[h]):h=="style"&&u.style?u.style.cssText=c[h]:u.setAttribute(h,c[h])}}for(let h=f;h<t.length;h++){let m=t[h];if(m===0){if(h<t.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:x}=Qf(e,m,n,r);if(u.appendChild(g),x){if(a)throw new RangeError("Multiple content holes");a=x}}}return{dom:u,contentDOM:a}}const eT=65535,tT=Math.pow(2,16);function QV(e,t){return e+t*tT}function nC(e){return e&eT}function XV(e){return(e-(e&eT))/tT}const nT=1,rT=2,Xf=4,iT=8;class z1{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&iT)>0}get deletedBefore(){return(this.delInfo&(nT|Xf))>0}get deletedAfter(){return(this.delInfo&(rT|Xf))>0}get deletedAcross(){return(this.delInfo&Xf)>0}}class Xr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Xr.empty)return Xr.empty}recover(t){let n=0,r=nC(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+XV(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?i:0);if(u>t)break;let c=this.ranges[a+o],f=this.ranges[a+s],h=u+c;if(t<=h){let m=c?t==u?-1:t==h?1:n:n,g=u+i+(m<0?0:f);if(r)return g;let x=t==(n<0?u:h)?null:QV(a/3,t-u),b=t==u?rT:t==h?nT:Xf;return(n<0?t!=u:t!=h)&&(b|=iT),new z1(g,b,x)}i+=f-c}return r?t+i:new z1(t+i,0,null)}touches(t,n){let r=0,i=nC(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>t)break;let c=this.ranges[a+o],f=u+c;if(t<=f&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),u=s+(this.inverted?0:o),c=this.ranges[i+n],f=this.ranges[i+r];t(a,a+c,u,u+f),o+=f-c}}invert(){return new Xr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Xr.empty:new Xr(t<0?[0,-t,0]:[0,0,t])}}Xr.empty=new Xr([]);class Lc{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Lc(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Lc;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(t,n);if(a.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this._maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new z1(t,i,null)}}const gg=Object.create(null);class hr{getMap(){return Xr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=gg[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in gg)throw new RangeError("Duplicate use of step JSON ID "+t);return gg[t]=n,n.prototype.jsonID=t,n}}class On{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new On(t,null)}static fail(t){return new On(null,t)}static fromReplace(t,n,r,i){try{return On.ok(t.replace(n,r,i))}catch(o){if(o instanceof Th)return On.fail(o.message);throw o}}}function ux(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ux(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return me.fromArray(r)}class Es extends hr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new qe(ux(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return On.fromReplace(t,this.from,this.to,o)}invert(){return new $i(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Es(n.pos,r.pos,this.mark)}merge(t){return t instanceof Es&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Es(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Es(n.from,n.to,t.markFromJSON(n.mark))}}hr.jsonID("addMark",Es);class $i extends hr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new qe(ux(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return On.fromReplace(t,this.from,this.to,r)}invert(){return new Es(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new $i(n.pos,r.pos,this.mark)}merge(t){return t instanceof $i&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new $i(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $i(n.from,n.to,t.markFromJSON(n.mark))}}hr.jsonID("removeMark",$i);class _s extends hr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return On.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return On.fromReplace(t,this.pos,this.pos+1,new qe(me.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new _s(this.pos,n.marks[i]);return new _s(this.pos,this.mark)}}return new Da(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new _s(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new _s(n.pos,t.markFromJSON(n.mark))}}hr.jsonID("addNodeMark",_s);class Da extends hr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return On.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return On.fromReplace(t,this.pos,this.pos+1,new qe(me.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new _s(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Da(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Da(n.pos,t.markFromJSON(n.mark))}}hr.jsonID("removeNodeMark",Da);class Zn extends hr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&L1(t,this.from,this.to)?On.fail("Structure replace would overwrite content"):On.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Xr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Zn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Zn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Zn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?qe.empty:new qe(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Zn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?qe.empty:new qe(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Zn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Zn(n.from,n.to,qe.fromJSON(t,n.slice),!!n.structure)}}hr.jsonID("replace",Zn);class Kn extends hr{constructor(t,n,r,i,o,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(t){if(this.structure&&(L1(t,this.from,this.gapFrom)||L1(t,this.gapTo,this.to)))return On.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return On.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?On.fromReplace(t,this.from,this.to,r):On.fail("Content does not fit in gap")}getMap(){return new Xr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Kn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Kn(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Kn(n.from,n.to,n.gapFrom,n.gapTo,qe.fromJSON(t,n.slice),n.insert,!!n.structure)}}hr.jsonID("replaceAround",Kn);function L1(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function eH(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(u,c,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(c,t),g=Math.min(c+u.nodeSize,n),x=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(x)||(s&&s.to==m&&s.mark.eq(h[b])?s.to=g:i.push(s=new $i(m,g,h[b])));a&&a.to==m?a.to=g:o.push(a=new Es(m,g,r))}}),i.forEach(u=>e.step(u)),o.forEach(u=>e.step(u))}function tH(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Op){let c=s.marks,f;for(;f=r.isInSet(c);)(u||(u=[])).push(f),c=f.removeFromSet(c)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let c=Math.min(a+s.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let g=0;g<i.length;g++){let x=i[g];x.step==o-1&&h.eq(i[g].style)&&(m=x)}m?(m.to=c,m.step=o):i.push({style:h,from:Math.max(a,t),to:c,step:o})}}}),i.forEach(s=>e.step(new $i(s.from,s.to,s.style)))}function cx(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let u=0;u<o.childCount;u++){let c=o.child(u),f=a+c.nodeSize,h=r.matchType(c.type);if(!h)s.push(new Zn(a,f,qe.empty));else{r=h;for(let m=0;m<c.marks.length;m++)n.allowsMarkType(c.marks[m].type)||e.step(new $i(a,f,c.marks[m]));if(i&&c.isText&&n.whitespace!="pre"){let m,g=/\r?\n|\r/g,x;for(;m=g.exec(c.text);)x||(x=new qe(me.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Zn(a+m.index,a+m.index+m[0].length,x))}}a=f}if(!r.validEnd){let u=r.fillBefore(me.empty,!0);e.replace(a,a,new qe(u,0,0))}for(let u=s.length-1;u>=0;u--)e.step(s[u])}function nH(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function eu(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,u=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(a,u,n))return r;if(r==0||s.type.spec.isolating||!nH(s,a,u))break;a&&(i=1),u<s.childCount&&(o=1)}return null}function rH(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),u=s,c=a,f=me.empty,h=0;for(let x=o,b=!1;x>n;x--)b||r.index(x)>0?(b=!0,f=me.from(r.node(x).copy(f)),h++):u--;let m=me.empty,g=0;for(let x=o,b=!1;x>n;x--)b||i.after(x+1)<i.end(x)?(b=!0,m=me.from(i.node(x).copy(m)),g++):c++;e.step(new Kn(u,c,s,a,new qe(f.append(m),h,g),f.size-h,!0))}function dx(e,t,n=null,r=e){let i=iH(e,t),o=i&&oH(r,t);return o?i.map(rC).concat({type:t,attrs:n}).concat(o.map(rC)):null}function rC(e){return{type:e,attrs:null}}function iH(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}function oH(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let u=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;u&&c<i;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:s}function sH(e,t,n){let r=me.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=me.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Kn(i,o,i,o,new qe(r,0,0),n.length,!0))}function aH(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&lH(e.doc,e.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",x=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!x?c=!1:!g&&x&&(c=!0)}c===!1&&sT(e,s,a,o),cx(e,e.mapping.slice(o).map(a,1),r,void 0,c===null);let f=e.mapping.slice(o),h=f.map(a,1),m=f.map(a+s.nodeSize,1);return e.step(new Kn(h,m,h+1,m-1,new qe(me.from(r.create(u,null,s.marks)),0,0),1,!0)),c===!0&&oT(e,s,a,o),!1}})}function oT(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let u=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function sT(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(`
1237
- `))}})}function lH(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function uH(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Kn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new qe(me.from(s),0,0),1,!0))}function Po(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,f=n-2;c>o;c--,f--){let h=i.node(c),m=i.index(c);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),x=r&&r[f+1];x&&(g=g.replaceChild(0,x.type.create(x.attrs)));let b=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!b.type.validContent(g))return!1}let a=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(a,a,u?u.type:i.node(o+1).type)}function cH(e,t,n=1,r){let i=e.doc.resolve(t),o=me.empty,s=me.empty;for(let a=i.depth,u=i.depth-n,c=n-1;a>u;a--,c--){o=me.from(i.node(a).copy(o));let f=r&&r[c];s=me.from(f?f.type.create(f.attrs,s):i.node(a).copy(s))}e.step(new Zn(t,t,new qe(o.append(s),n,n),!0))}function Zs(e,t){let n=e.resolve(t),r=n.index();return aT(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dH(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function aT(e,t){return!!(e&&t&&!e.isLeaf&&dH(e,t))}function Rp(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&aT(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function fH(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let a=e.steps.length;if(r===!1){let f=e.doc.resolve(t+n);sT(e,f.node(),f.before(),a)}s.inlineContent&&cx(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=e.mapping.slice(a),c=u.map(t-n);if(e.step(new Zn(c,u.map(t+n,-1),qe.empty,!0)),r===!0){let f=e.doc.resolve(c);oT(e,f.node(),f.before(),e.steps.length)}return e}function hH(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function lT(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(a>0?1:0),c=r.node(s),f=!1;if(o==1)f=c.canReplace(u,u,i);else{let h=c.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&c.canReplaceWith(u,u,h[0])}if(f)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Pp(e,t,n=t,r=qe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return uT(i,o,r)?new Zn(t,n,r):new pH(i,o,r).fit()}function uT(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class pH{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=me.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=me.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let u=new qe(o,s,a);return t>-1?new Kn(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Zn(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=yg(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:c}=this.frontier[a],f,h=null;if(n==1&&(s?c.matchType(s.type)||(h=c.fillBefore(me.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:h};if(n==2&&s&&(f=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:f};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=yg(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new qe(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=yg(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new qe(Xu(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new qe(Xu(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let b=0;b<o.length;b++)this.openFrontierNode(o[b]);let s=this.unplaced,a=r?r.content:s.content,u=s.openStart-t,c=0,f=[],{match:h,type:m}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)f.push(i.child(b));h=h.matchFragment(i)}let g=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let b=a.child(c),k=h.matchType(b.type);if(!k)break;c++,(c>1||u==0||b.content.size)&&(h=k,f.push(cT(b.mark(m.allowedMarks(b.marks)),c==1?u:0,c==a.childCount?g:-1)))}let x=c==a.childCount;x||(g=-1),this.placed=ec(this.placed,n,me.from(f)),this.frontier[n].match=h,x&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,k=a;b<g;b++){let C=k.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),k=C.content}this.unplaced=x?t==0?qe.empty:new qe(Xu(s.content,t-1,1),t-1,g<0?s.openEnd:t-1):new qe(Xu(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!xg(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=xg(t,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:u,type:c}=this.frontier[a],f=xg(t,a,c,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ec(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=ec(this.placed,this.depth,me.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(me.empty,!0);n.childCount&&(this.placed=ec(this.placed,this.frontier.length,n))}}function Xu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Xu(e.firstChild.content,t-1,n)))}function ec(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ec(e.lastChild.content,t-1,n)))}function yg(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function cT(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,cT(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(me.empty,!0)))),e.copy(r)}function xg(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!mH(n,o.content,s)?a:null}function mH(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function gH(e){return e.spec.defining||e.spec.definingForContent}function yH(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(uT(i,o,r))return e.step(new Zn(t,n,r));let s=fT(i,o);s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let m=i.depth,g=i.pos-1;m>0;m--,g--){let x=i.node(m).type.spec;if(x.defining||x.definingAsContext||x.isolating)break;s.indexOf(m)>-1?a=m:i.before(m)==g&&s.splice(1,0,-m)}let u=s.indexOf(a),c=[],f=r.openStart;for(let m=r.content,g=0;;g++){let x=m.firstChild;if(c.push(x),g==r.openStart)break;m=x.content}for(let m=f-1;m>=0;m--){let g=c[m],x=gH(g.type);if(x&&!g.sameMarkup(i.node(Math.abs(a)-1)))f=m;else if(x||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),x=c[g];if(x)for(let b=0;b<s.length;b++){let k=s[(b+u)%s.length],C=!0;k<0&&(C=!1,k=-k);let _=i.node(k-1),E=i.index(k-1);if(_.canReplaceWith(E,E,x.type,x.marks))return e.replace(i.before(k),C?o.after(k):n,new qe(dT(r.content,0,r.openStart,g),g,r.openEnd))}}let h=e.steps.length;for(let m=s.length-1;m>=0&&(e.replace(t,n,r),!(e.steps.length>h));m--){let g=s[m];g<0||(t=i.before(g),n=o.after(g))}}function dT(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(dT(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(me.empty,!0))}return e}function xH(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=hH(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new qe(me.from(r),0,0))}function bH(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=fT(r,i);for(let s=0;s<o.length;s++){let a=o[s],u=s==o.length-1;if(u&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(u||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function fT(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Ml extends hr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return On.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return On.fromReplace(t,this.pos,this.pos+1,new qe(me.from(i),0,n.isLeaf?0:1))}getMap(){return Xr.empty}invert(t){return new Ml(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ml(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ml(n.pos,n.attr,n.value)}}hr.jsonID("attr",Ml);class Fc extends hr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return On.ok(r)}getMap(){return Xr.empty}invert(t){return new Fc(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Fc(n.attr,n.value)}}hr.jsonID("docAttr",Fc);let $l=class extends Error{};$l=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};$l.prototype=Object.create(Error.prototype);$l.prototype.constructor=$l;$l.prototype.name="TransformError";class hT{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Lc}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new $l(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((o,s,a,u)=>{t=Math.min(t,a),n=Math.max(n,u)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=qe.empty){let i=Pp(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new qe(me.from(r),0,0))}delete(t,n){return this.replace(t,n,qe.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return yH(this,t,n,r),this}replaceRangeWith(t,n,r){return xH(this,t,n,r),this}deleteRange(t,n){return bH(this,t,n),this}lift(t,n){return rH(this,t,n),this}join(t,n=1){return fH(this,t,n),this}wrap(t,n){return sH(this,t,n),this}setBlockType(t,n=t,r,i=null){return aH(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return uH(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Ml(t,n,r)),this}setDocAttribute(t,n){return this.step(new Fc(t,n)),this}addNodeMark(t,n){return this.step(new _s(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof qt)n.isInSet(r.marks)&&this.step(new Da(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new Da(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return cH(this,t,n,r),this}addMark(t,n,r){return eH(this,t,n,r),this}removeMark(t,n,r){return tH(this,t,n,r),this}clearIncompatible(t,n,r){return cx(this,t,n,r),this}}const bg=Object.create(null);class Mt{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new vH(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=qe.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:u,$to:c}=s[a],f=t.mapping.slice(o);t.replaceRange(f.map(u.pos),f.map(c.pos),a?qe.empty:n),a==0&&sC(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],u=t.mapping.slice(r),c=u.map(s.pos),f=u.map(a.pos);o?t.deleteRange(c,f):(t.replaceRangeWith(c,f,n),sC(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new yt(t):Sl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let s=n<0?Sl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Sl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new ni(t.node(0))}static atStart(t){return Sl(t,t,0,0,1)||new ni(t)}static atEnd(t){return Sl(t,t,t.content.size,t.childCount,-1)||new ni(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=bg[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in bg)throw new RangeError("Duplicate use of selection JSON ID "+t);return bg[t]=n,n.prototype.jsonID=t,n}getBookmark(){return yt.between(this.$anchor,this.$head).getBookmark()}}Mt.prototype.visible=!0;class vH{constructor(t,n){this.$from=t,this.$to=n}}let iC=!1;function oC(e){!iC&&!e.parent.inlineContent&&(iC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class yt extends Mt{constructor(t,n=t){oC(t),oC(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Mt.near(r);let i=t.resolve(n.map(this.anchor));return new yt(i.parent.inlineContent?i:r,r)}replace(t,n=qe.empty){if(super.replace(t,n),n==qe.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof yt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new jp(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new yt(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Mt.findFrom(n,r,!0)||Mt.findFrom(n,-r,!0);if(o)n=o.$head;else return Mt.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Mt.findFrom(t,-r,!0)||Mt.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new yt(t,n)}}Mt.jsonID("text",yt);class jp{constructor(t,n){this.anchor=t,this.head=n}map(t){return new jp(t.map(this.anchor),t.map(this.head))}resolve(t){return yt.between(t.resolve(this.anchor),t.resolve(this.head))}}class ut extends Mt{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Mt.near(o):new ut(o)}content(){return new qe(me.from(this.node),0,0)}eq(t){return t instanceof ut&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new fx(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ut(t.resolve(n.anchor))}static create(t,n){return new ut(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ut.prototype.visible=!1;Mt.jsonID("node",ut);class fx{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new jp(r,r):new fx(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ut.isSelectable(r)?new ut(n):Mt.near(n)}}class ni extends Mt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=qe.empty){if(n==qe.empty){t.delete(0,t.doc.content.size);let r=Mt.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new ni(t)}map(t){return new ni(t)}eq(t){return t instanceof ni}getBookmark(){return kH}}Mt.jsonID("all",ni);const kH={map(){return this},resolve(e){return new ni(e)}};function Sl(e,t,n,r,i,o=!1){if(t.inlineContent)return yt.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&ut.isSelectable(a))return ut.create(e,n-(i<0?a.nodeSize:0))}else{let u=Sl(e,a,n+i,i<0?a.childCount:0,i,o);if(u)return u}n+=a.nodeSize*i}return null}function sC(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Zn||i instanceof Kn))return;let o=e.mapping.maps[r],s;o.forEach((a,u,c,f)=>{s==null&&(s=f)}),e.setSelection(Mt.near(e.doc.resolve(s),n))}const aC=1,Pf=2,lC=4;class wH extends hT{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|aC)&~Pf,this.storedMarks=null,this}get selectionSet(){return(this.updated&aC)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Pf,this}ensureMarks(t){return qt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Pf)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Pf,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||qt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Mt.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=lC,this}get scrolledIntoView(){return(this.updated&lC)>0}}function uC(e,t){return!t||!e?e:e.bind(t)}class tc{constructor(t,n,r){this.name=t,this.init=uC(n.init,r),this.apply=uC(n.apply,r)}}const CH=[new tc("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new tc("selection",{init(e,t){return e.selection||Mt.atStart(t.doc)},apply(e){return e.selection}}),new tc("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new tc("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class vg{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=CH.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new tc(r.key,r.spec.state,r))})}}class Tl{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let u=i?i[s].n:0,c=i?i[s].state:this,f=u<n.length&&a.spec.appendTransaction.call(a,u?n.slice(u):n,c,r);if(f&&r.filterTransaction(f,s)){if(f.setMeta("appendedTransaction",t),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<s?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Tl(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new wH(this)}static create(t){let n=new vg(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Tl(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new vg(this.schema,t.plugins),r=n.fields,i=new Tl(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new vg(t.schema,t.plugins),o=new Tl(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Ds.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Mt.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],c=u.spec.state;if(u.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(u,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}}function pT(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=pT(i,t,{})),n[r]=i}return n}class yn{constructor(t){this.spec=t,this.props={},t.props&&pT(t.props,this,this.props),this.key=t.key?t.key.key:mT("plugin")}getState(t){return t[this.key]}}const kg=Object.create(null);function mT(e){return e in kg?e+"$"+ ++kg[e]:(kg[e]=0,e+"$")}class jn{constructor(t="key"){this.key=mT(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const hx=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function gT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const yT=(e,t,n)=>{let r=gT(e,n);if(!r)return!1;let i=px(r);if(!i){let s=r.blockRange(),a=s&&eu(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(_T(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Bl(o,"end")||ut.isSelectable(o)))for(let s=r.depth;;s--){let a=Pp(e.doc,r.before(s),r.after(s),qe.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Bl(o,"end")?Mt.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ut.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},SH=(e,t,n)=>{let r=gT(e,n);if(!r)return!1;let i=px(r);return i?xT(e,i,t):!1},EH=(e,t,n)=>{let r=vT(e,n);if(!r)return!1;let i=mx(r);return i?xT(e,i,t):!1};function xT(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=t.nodeAfter,a=s,u=t.pos+1;for(;!a.isTextblock;u++){if(a.type.spec.isolating)return!1;let f=a.firstChild;if(!f)return!1;a=f}let c=Pp(e.doc,o,u,qe.empty);if(!c||c.from!=o||c instanceof Zn&&c.slice.size>=u-o)return!1;if(n){let f=e.tr.step(c);f.setSelection(yt.create(f.doc,o)),n(f.scrollIntoView())}return!0}function Bl(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const bT=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=px(r)}let s=o&&o.nodeBefore;return!s||!ut.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ut.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function px(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function vT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const kT=(e,t,n)=>{let r=vT(e,n);if(!r)return!1;let i=mx(r);if(!i)return!1;let o=i.nodeAfter;if(_T(e,i,t,1))return!0;if(r.parent.content.size==0&&(Bl(o,"start")||ut.isSelectable(o))){let s=Pp(e.doc,r.before(),r.after(),qe.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Bl(o,"start")?Mt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ut.create(a.doc,a.mapping.map(i.pos))),t(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},wT=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=mx(r)}let s=o&&o.nodeAfter;return!s||!ut.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ut.create(e.doc,o.pos)).scrollIntoView()),!0)};function mx(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const _H=(e,t)=>{let n=e.selection,r=n instanceof ut,i;if(r){if(n.node.isTextblock||!Zs(e.doc,n.from))return!1;i=n.from}else if(i=Rp(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ut.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},TH=(e,t)=>{let n=e.selection,r;if(n instanceof ut){if(n.node.isTextblock||!Zs(e.doc,n.to))return!1;r=n.to}else if(r=Rp(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},AH=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&eu(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},CT=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
1238
- `).scrollIntoView()),!0)};function gx(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const MH=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=gx(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),u=e.tr.replaceWith(a,a,s.createAndFill());u.setSelection(Mt.near(u.doc.resolve(a),1)),t(u.scrollIntoView())}return!0},ST=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ni||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=gx(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(yt.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},ET=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Po(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eu(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function NH(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof ut&&t.selection.node.isBlock)return!r.parentOffset||!Po(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,u=!1,c=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),c=r.start(g)==r.pos-(r.depth-g),a=gx(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),o.unshift(u&&a?{type:a}:null),s=g;break}else{if(g==1)return!1;o.unshift(null)}let f=t.tr;(t.selection instanceof yt||t.selection instanceof ni)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=Po(f.doc,h,o.length,o);if(m||(o[0]=a?{type:a}:null,m=Po(f.doc,h,o.length,o)),!m)return!1;if(f.split(h,o.length,o),!u&&c&&r.node(s).type!=a){let g=f.mapping.map(r.before(s)),x=f.doc.resolve(g);a&&r.node(s-1).canReplaceWith(x.index(),x.index()+1,a)&&f.setNodeMarkup(f.mapping.map(r.before(s)),a)}return n&&n(f.scrollIntoView()),!0}}const IH=NH(),DH=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ut.create(e.doc,i))),!0)};function OH(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||Zs(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function _T(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&OH(e,t,n))return!0;let c=!u&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let g=t.pos+o.nodeSize,x=me.empty;for(let C=s.length-1;C>=0;C--)x=me.from(s[C].create(null,x));x=me.from(i.copy(x));let b=e.tr.step(new Kn(t.pos-1,g,t.pos,g,new qe(x,1,0),s.length,!0)),k=b.doc.resolve(g+2*s.length);k.nodeAfter&&k.nodeAfter.type==i.type&&Zs(b.doc,k.pos)&&b.join(k.pos),n(b.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:Mt.findFrom(t,1),h=f&&f.$from.blockRange(f.$to),m=h&&eu(h);if(m!=null&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(c&&Bl(o,"start",!0)&&Bl(i,"end")){let g=i,x=[];for(;x.push(g),!g.isTextblock;)g=g.lastChild;let b=o,k=1;for(;!b.isTextblock;b=b.firstChild)k++;if(g.canReplace(g.childCount,g.childCount,b.content)){if(n){let C=me.empty;for(let E=x.length-1;E>=0;E--)C=me.from(x[E].copy(C));let _=e.tr.step(new Kn(t.pos-x.length,t.pos+o.nodeSize,t.pos+k,t.pos+o.nodeSize-k,new qe(C,x.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function TT(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(yt.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const RH=TT(-1),PH=TT(1);function jH(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&dx(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function cC(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(u,c)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)i=!0;else{let f=n.doc.resolve(c),h=f.index();i=f.parent.canReplaceWith(h,h+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[s];o.setBlockType(a,u,e,t)}r(o.scrollIntoView())}return!0}}function yx(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}yx(hx,yT,bT);yx(hx,kT,wT);yx(CT,ST,ET,IH);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function zH(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return LH(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function LH(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=s.resolve(t.start-2);o=new Mh(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new Mh(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=dx(o,n,r,t);return a?(e&&FH(e,t,a,i,n),!0):!1}function FH(e,t,n,r,i){let o=me.empty;for(let f=n.length-1;f>=0;f--)o=me.from(n[f].type.create(n[f].attrs,o));e.step(new Kn(t.start-(r?2:0),t.end,t.start,t.end,new qe(o,0,0),n.length,!0));let s=0;for(let f=0;f<n.length;f++)n[f].type==i&&(s=f+1);let a=n.length-s,u=t.start+n.length-(r?2:0),c=t.parent;for(let f=t.startIndex,h=t.endIndex,m=!0;f<h;f++,m=!1)!m&&Po(e.doc,u,a)&&(e.split(u,a),u+=2*a),u+=c.child(f).nodeSize;return e}function $H(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?BH(t,n,e,o):UH(t,n,o):!0:!1}}function BH(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Kn(o-1,s,o,s,new qe(me.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Mh(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=eu(r);if(a==null)return!1;i.lift(r,a);let u=i.doc.resolve(i.mapping.map(o,-1)-1);return Zs(i.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&i.join(u.pos),t(i.scrollIntoView()),!0}function UH(e,t,n){let r=e.tr,i=n.parent;for(let g=n.end,x=n.endIndex-1,b=n.startIndex;x>b;x--)g-=i.child(x).nodeSize,r.delete(g-1,g+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,u=n.endIndex==i.childCount,c=o.node(-1),f=o.index(-1);if(!c.canReplace(f+(a?0:1),f+1,s.content.append(u?me.empty:me.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Kn(h-(a?1:0),m+(u?1:0),h+1,m-1,new qe((a?me.empty:me.from(i.copy(me.empty))).append(u?me.empty:me.from(i.copy(me.empty))),a?0:1,u?0:1),a?0:1)),t(r.scrollIntoView()),!0}function VH(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,u=a.child(s-1);if(u.type!=e)return!1;if(n){let c=u.lastChild&&u.lastChild.type==a.type,f=me.from(c?e.create():null),h=new qe(me.from(e.create(null,me.from(a.type.create(null,f)))),c?3:1,0),m=o.start,g=o.end;n(t.tr.step(new Kn(m-(c?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}const nr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ul=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let F1=null;const Io=function(e,t,n){let r=F1||(F1=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},HH=function(){F1=null},Oa=function(e,t,n,r){return n&&(dC(e,t,n,r,-1)||dC(e,t,n,r,1))},WH=/^(img|br|input|textarea|hr)$/i;function dC(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:vi(e))){let s=e.parentNode;if(!s||s.nodeType!=1||od(e)||WH.test(e.nodeName)||e.contentEditable=="false")return!1;t=nr(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?vi(e):0}else return!1}}function vi(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function qH(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=vi(e)}else if(e.parentNode&&!od(e))t=nr(e),e=e.parentNode;else return null}}function ZH(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!od(e))t=nr(e)+1,e=e.parentNode;else return null}}function JH(e,t,n){for(let r=t==0,i=t==vi(e);r||i;){if(e==n)return!0;let o=nr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==vi(e)}}function od(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const zp=function(e){return e.focusNode&&Oa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ga(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function KH(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function GH(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(vi(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(vi(r.startContainer),r.startOffset)}}}const oo=typeof navigator<"u"?navigator:null,fC=typeof document<"u"?document:null,Js=oo&&oo.userAgent||"",$1=/Edge\/(\d+)/.exec(Js),AT=/MSIE \d/.exec(Js),B1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Js),Ur=!!(AT||B1||$1),Os=AT?document.documentMode:B1?+B1[1]:$1?+$1[1]:0,ki=!Ur&&/gecko\/(\d+)/i.test(Js);ki&&+(/Firefox\/(\d+)/.exec(Js)||[0,0])[1];const U1=!Ur&&/Chrome\/(\d+)/.exec(Js),ir=!!U1,MT=U1?+U1[1]:0,dr=!Ur&&!!oo&&/Apple Computer/.test(oo.vendor),Vl=dr&&(/Mobile\/\w+/.test(Js)||!!oo&&oo.maxTouchPoints>2),xi=Vl||(oo?/Mac/.test(oo.platform):!1),NT=oo?/Win/.test(oo.platform):!1,Oo=/Android \d/.test(Js),sd=!!fC&&"webkitFontSmoothing"in fC.documentElement.style,YH=sd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function QH(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function To(e,t){return typeof e=="number"?e:e[t]}function XH(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function hC(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=Ul(s);continue}let a=s,u=a==o.body,c=u?QH(o):XH(a),f=0,h=0;if(t.top<c.top+To(r,"top")?h=-(c.top-t.top+To(i,"top")):t.bottom>c.bottom-To(r,"bottom")&&(h=t.bottom-t.top>c.bottom-c.top?t.top+To(i,"top")-c.top:t.bottom-c.bottom+To(i,"bottom")),t.left<c.left+To(r,"left")?f=-(c.left-t.left+To(i,"left")):t.right>c.right-To(r,"right")&&(f=t.right-c.right+To(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let g=a.scrollLeft,x=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let b=a.scrollLeft-g,k=a.scrollTop-x;t={left:t.left-b,top:t.top-k,right:t.right-b,bottom:t.bottom-k}}let m=u?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(m))break;s=m=="absolute"?s.offsetParent:Ul(s)}}function eW(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(o,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let u=a.getBoundingClientRect();if(u.top>=n-20){r=a,i=u.top;break}}return{refDOM:r,refTop:i,stack:IT(e.dom)}}function IT(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ul(r));return t}function tW({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;DT(n,r==0?0:r-t)}function DT(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ml=null;function nW(e){if(e.setActive)return e.setActive();if(ml)return e.focus(ml);let t=IT(e);e.focus(ml==null?{get preventScroll(){return ml={preventScroll:!0},!0}}:void 0),ml||(ml=!1,DT(t,0))}function OT(e,t){let n,r=2e8,i,o=0,s=t.top,a=t.top,u,c;for(let f=e.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=Io(f).getClientRects();else continue;for(let g=0;g<m.length;g++){let x=m[g];if(x.top<=s&&x.bottom>=a){s=Math.max(x.bottom,s),a=Math.min(x.top,a);let b=x.left>t.left?x.left-t.left:x.right<t.left?t.left-x.right:0;if(b<r){n=f,r=b,i=b&&n.nodeType==3?{left:x.right<t.left?x.right:x.left,top:t.top}:t,f.nodeType==1&&b&&(o=h+(t.left>=(x.left+x.right)/2?1:0));continue}}else x.top>t.top&&!u&&x.left<=t.left&&x.right>=t.left&&(u=f,c={left:Math.max(x.left,Math.min(x.right,t.left)),top:x.top});!n&&(t.left>=x.right&&t.top>=x.top||t.left>=x.left&&t.top>=x.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=c,r=0),n&&n.nodeType==3?rW(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:OT(n,i)}function rW(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let s=ps(r,1);if(s.top!=s.bottom&&xx(t,s)){i={node:e,offset:o+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function xx(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function iW(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function oW(e,t,n){let{node:r,offset:i}=OT(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function sW(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),u;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((u=a.dom.getBoundingClientRect()).width||u.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&u.left>r.left||u.top>r.top?i=a.posBefore:(!s&&u.right<r.left||u.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function RT(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=e.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let u=0;u<a.length;u++){let c=a[u];if(xx(t,c))return RT(s,t,c)}}if((o=(o+1)%r)==i)break}return e}function aW(e,t){let n=e.dom.ownerDocument,r,i=0,o=GH(n,t.left,t.top);o&&({node:r,offset:i}=o);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=e.dom.getBoundingClientRect();if(!xx(t,c)||(s=RT(e.dom,t,c),!s))return null}if(dr)for(let c=s;r&&c;c=Ul(c))c.draggable&&(r=void 0);if(s=iW(s,t),r){if(ki&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let f=r.childNodes[i],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&i++}let c;sd&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=sW(e,r,i,t))}a==null&&(a=oW(e,s,t));let u=e.docView.nearestDesc(s,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function pC(e){return e.top<e.bottom||e.left<e.right}function ps(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(pC(r))return r}return Array.prototype.find.call(n,pC)||e.getBoundingClientRect()}const lW=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function PT(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=sd||ki;if(r.nodeType==3)if(s&&(lW.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=ps(Io(r,i,i),n);if(ki&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=ps(Io(r,i-1,i-1),-1);if(c.top==u.top){let f=ps(Io(r,i,i+1),-1);if(f.top!=u.top)return Uu(f,f.left<c.left)}}return u}else{let u=i,c=i,f=n<0?1:-1;return n<0&&!i?(c++,f=-1):n>=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:c++,Uu(ps(Io(r,u,c),f),f<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==vi(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return wg(u.getBoundingClientRect(),!1)}if(o==null&&i<vi(r)){let u=r.childNodes[i];if(u.nodeType==1)return wg(u.getBoundingClientRect(),!0)}return wg(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==vi(r))){let u=r.childNodes[i-1],c=u.nodeType==3?Io(u,vi(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(c)return Uu(ps(c,1),!1)}if(o==null&&i<vi(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let c=u?u.nodeType==3?Io(u,0,s?0:1):u.nodeType==1?u:null:null;if(c)return Uu(ps(c,-1),!0)}return Uu(ps(r.nodeType==3?Io(r):r,-n),n>=0)}function Uu(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function wg(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function jT(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function uW(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return jT(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=PT(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let u;if(a.nodeType==1)u=a.getClientRects();else if(a.nodeType==3)u=Io(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<u.length;c++){let f=u[c];if(f.bottom>f.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const cW=/[\u0590-\u08ac]/;function dW(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!cW.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:jT(e,t,()=>{let{focusNode:u,focusOffset:c,anchorNode:f,anchorOffset:h}=e.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let g=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:x,focusOffset:b}=e.domSelectionRange(),k=x&&!g.contains(x.nodeType==1?x:x.parentNode)||u==x&&c==b;try{a.collapse(f,h),u&&(u!=f||c!=h)&&a.extend&&a.extend(u,c)}catch{}return m!=null&&(a.caretBidiLevel=m),k}):r.pos==r.start()||r.pos==r.end()}let mC=null,gC=null,yC=!1;function fW(e,t,n){return mC==t&&gC==n?yC:(mC=t,gC=n,yC=n=="up"||n=="down"?uW(e,t,n):dW(e,t,n))}const wi=0,xC=1,xa=2,so=3;class ad{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=wi,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,s;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>nr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>t||s instanceof LT){i=t-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof zT&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?nr(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?nr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let u=this.children[a],c=s+u.size;if(i==-1&&t<=c){let f=s+u.border;if(t>=f&&n<=c-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(t,n,f);t=s;for(let h=a;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=nr(m.dom)+1;break}t-=m.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let f=a+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=nr(h.dom);break}n+=h.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),s=Math.max(t,n);for(let g=0,x=0;g<this.children.length;g++){let b=this.children[g],k=x+b.size;if(o>x&&s<k)return b.setSelection(t-x-b.border,n-x-b.border,r,i);x=k}let a=this.domFromPos(t,t?-1:1),u=n==t?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),f=r.domSelectionRange(),h=!1;if((ki||dr)&&t==n){let{node:g,offset:x}=a;if(g.nodeType==3){if(h=!!(x&&g.nodeValue[x-1]==`
1239
- `),h&&x==g.nodeValue.length)for(let b=g,k;b;b=b.parentNode){if(k=b.nextSibling){k.nodeName=="BR"&&(a=u={node:k.parentNode,offset:nr(k)+1});break}let C=b.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let b=g.childNodes[x-1];h=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(ki&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let g=f.focusNode.childNodes[f.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||h&&dr)&&Oa(a.node,a.offset,f.anchorNode,f.anchorOffset)&&Oa(u.node,u.offset,f.focusNode,f.focusOffset))return;let m=!1;if((c.extend||t==n)&&!(h&&ki)){c.collapse(a.node,a.offset);try{t!=n&&c.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(t>n){let x=a;a=u,u=x}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(g)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,u=s-o.border;if(t>=a&&n<=u){this.dirty=t==r||n==s?xa:xC,t==a&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=so:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?xa:so}r=s}this.dirty=xa}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?xa:xC;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class zT extends ad{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==wi&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class hW extends ad{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ra extends ad{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ba.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ra(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&so||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=so&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=wi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=wi}}slice(t,n,r){let i=Ra.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=H1(o,n,s,r)),t>0&&(o=H1(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Rs extends ad{constructor(t,n,r,i,o,s,a,u,c){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],u,c=a&&a(n,o,()=>{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ba.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=BT(f,r,n),c?u=new pW(t,n,r,i,f,h||null,m,c,o,s+1):n.isText?new Lp(t,n,r,i,f,m,o):new Rs(t,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>me.empty)}return t}matchesNode(t,n,r){return this.dirty==wi&&t.eq(this.node)&&Ih(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,u=new gW(this,s&&s.node,t);bW(this.node,this.innerDeco,(c,f,h)=>{c.spec.marks?u.syncToMarks(c.spec.marks,r,t,f):c.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?qt.none:this.node.child(f).marks,r,t,f),u.placeWidget(c,t,i)},(c,f,h,m)=>{u.syncToMarks(c.marks,r,t,m);let g;u.findNodeMatch(c,f,h,m)||a&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(g=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(c,f,h,g,t)||u.updateNextNode(c,f,h,t,m,i)||u.addNode(c,f,h,t,i),i+=c.nodeSize}),u.syncToMarks([],r,t,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==xa)&&(s&&this.protectLocalComposition(t,s),FT(this.contentDOM,this.children,t),Vl&&vW(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof yt)||r<n||i>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=kW(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new hW(this,o,n,i);t.input.compositionNodes.push(s),this.children=H1(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==so||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=wi}updateOuterDeco(t){if(Ih(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$T(this.dom,this.nodeDOM,V1(this.outerDeco,this.node,n),V1(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function bC(e,t,n,r,i){BT(r,t,e);let o=new Rs(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Lp extends Rs{constructor(t,n,r,i,o,s,a){super(t,n,r,i,o,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==so||this.dirty!=wi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=wi||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=wi,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Lp(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=so)}get domAtom(){return!1}isText(t){return this.node.text==t}}class LT extends ad{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==wi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class pW extends Rs{constructor(t,n,r,i,o,s,a,u,c,f){super(t,n,r,i,o,s,a,c,f),this.spec=u}update(t,n,r,i){if(this.dirty==so)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function FT(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=vC(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Ra){let u=r?r.previousSibling:e.lastChild;FT(s.contentDOM,s.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=vC(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const pc=function(e){e&&(this.nodeName=e)};pc.prototype=Object.create(null);const ba=[new pc];function V1(e,t,n){if(e.length==0)return ba;let r=n?ba[0]:new pc,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new pc(s.nodeName));for(let a in s){let u=s[a];u!=null&&(n&&i.length==1&&i.push(r=new pc(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+u:a=="style"?r.style=(r.style?r.style+";":"")+u:a!="nodeName"&&(r[a]=u))}}}return i}function $T(e,t,n,r){if(n==ba&&r==ba)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let u;a&&a.nodeName==s.nodeName&&i!=e&&(u=i.parentNode)&&u.nodeName.toLowerCase()==s.nodeName||(u=document.createElement(s.nodeName),u.pmIsDeco=!0,u.appendChild(i),a=ba[0]),i=u}mW(i,a||ba[0],s)}return i}function mW(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function BT(e,t,n){return $T(e,e,ba,V1(t,n,e.nodeType!=1))}function Ih(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function vC(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class gW{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=yW(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let o=0,s=this.stack.length>>1,a=Math.min(s,t.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=wi,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let u=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let f=this.index;f<c;f++){let h=this.top.children[f];if(h.matchesMark(t[s])&&!this.isLocked(h.dom)){u=f;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let f=Ra.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,u=Math.min(this.top.children.length,a+5);a<u;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let s=this.top.children[i];return s.dirty==so&&s.dom==s.contentDOM&&(s.dirty=xa),s.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof Rs){let c=this.preMatch.matched.get(u);if(c!=null&&c!=o)return!1;let f=u.dom,h,m=this.isLocked(f)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=so&&Ih(n,u.outerDeco));if(!m&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(u,t,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=xa,h.updateChildren(i,s+1),h.dirty=wi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Ih(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let a=Rs.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let u of a.children)u.parent=a}return t.destroy(),a}addNode(t,n,r,i,o){let s=Rs.create(this.top,t,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new zT(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Ra;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Lp)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((dr||ir)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new LT(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function yW(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ra)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function xW(e,t){return e.type.side-t.type.side}function bW(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let f=e.child(c);r(f,i,t.forChild(o,f),c),o+=f.nodeSize}return}let s=0,a=[],u=null;for(let c=0;;){let f,h;for(;s<i.length&&i[s].to==o;){let k=i[s++];k.widget&&(f?(h||(h=[f])).push(k):f=k)}if(f)if(h){h.sort(xW);for(let k=0;k<h.length;k++)n(h[k],c,!!u)}else n(f,c,!!u);let m,g;if(u)g=-1,m=u,u=null;else if(c<e.childCount)g=c,m=e.child(c++);else break;for(let k=0;k<a.length;k++)a[k].to<=o&&a.splice(k--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let x=o+m.nodeSize;if(m.isText){let k=x;s<i.length&&i[s].from<k&&(k=i[s].from);for(let C=0;C<a.length;C++)a[C].to<k&&(k=a[C].to);k<x&&(u=m.cut(k-o),m=m.cut(0,k-o),x=k,g=-1)}else for(;s<i.length&&i[s].to<x;)s++;let b=m.isInline&&!m.isLeaf?a.filter(k=>!k.inline):a.slice();r(m,b,t.forChild(o,m),g),o=x}}function vW(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function kW(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let u=s.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;u+=c.text}if(o>=n){if(o>=r&&u.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?u.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&u.length>=r+t.length-a&&u.slice(r-a,r-a+t.length)==t)return r}}return-1}function H1(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let u=e[s],c=a,f=a+=u.size;c>=n||f<=t?o.push(u):(c<t&&o.push(u.slice(0,t-c,r)),i&&(o.push(i),i=void 0),f>n&&o.push(u.slice(n-c,u.size,r)))}return o}function bx(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),u,c;if(zp(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&ut.isSelectable(h)&&i.parent&&!(h.isInline&&JH(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;c=new ut(s==m?a:r.resolve(m))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let g=0;g<n.rangeCount;g++){let x=n.getRangeAt(g);h=Math.min(h,e.docView.posFromDOM(x.startContainer,x.startOffset,1)),m=Math.max(m,e.docView.posFromDOM(x.endContainer,x.endOffset,-1))}if(h<0)return null;[u,s]=m==e.state.selection.anchor?[m,h]:[h,m],a=r.resolve(s)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!c){let h=t=="pointer"||e.state.selection.head<a.pos&&!o?1:-1;c=vx(e,f,a,h)}return c}function UT(e){return e.editable?e.hasFocus():HT(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function jo(e,t=!1){let n=e.state.selection;if(VT(e,n),!!UT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ir){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Oa(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)CW(e);else{let{anchor:r,head:i}=n,o,s;kC&&!(n instanceof yt)&&(n.$from.parent.inlineContent||(o=wC(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=wC(e,n.to))),e.docView.setSelection(r,i,e,t),kC&&(o&&CC(o),s&&CC(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&wW(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const kC=dr||ir&&MT<63;function wC(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(dr&&i&&i.contentEditable=="false")return Cg(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Cg(i);if(o)return Cg(o)}}function Cg(e){return e.contentEditable="true",dr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function CC(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function wW(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!UT(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function CW(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,nr(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Ur&&Os<=11&&(n.disabled=!0,n.disabled=!1)}function VT(e,t){if(t instanceof ut){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(SC(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else SC(e)}function SC(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function vx(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||yt.between(t,n,r)}function EC(e){return e.editable&&!e.hasFocus()?!1:HT(e)}function HT(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function SW(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Oa(t.node,t.offset,n.anchorNode,n.anchorOffset)}function W1(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Mt.findFrom(o,t)}function ys(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function _C(e,t,n){let r=e.state.selection;if(r instanceof yt)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return ys(e,new yt(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=W1(e.state,t);return i&&i instanceof ut?ys(e,i):!1}else if(!(xi&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ut.isSelectable(o)?ys(e,new ut(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):sd?ys(e,new yt(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ut&&r.node.isInline)return ys(e,new yt(t>0?r.$to:r.$from));{let i=W1(e.state,t);return i?ys(e,i):!1}}}function Dh(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function mc(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function gl(e,t){return t<0?EW(e):_W(e)}function EW(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(ki&&n.nodeType==1&&r<Dh(n)&&mc(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(mc(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(WT(n))break;{let a=n.previousSibling;for(;a&&mc(a,-1);)i=n.parentNode,o=nr(a),a=a.previousSibling;if(a)n=a,r=Dh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?q1(e,n,r):i&&q1(e,i,o)}function _W(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Dh(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(mc(a,1))o=n,s=++r;else break}else{if(WT(n))break;{let a=n.nextSibling;for(;a&&mc(a,1);)o=a.parentNode,s=nr(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Dh(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&q1(e,o,s)}function WT(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function TW(e,t){for(;e&&t==e.childNodes.length&&!od(e);)t=nr(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function AW(e,t){for(;e&&!t&&!od(e);)t=nr(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function q1(e,t,n){if(t.nodeType!=3){let o,s;(s=TW(t,n))?(t=s,n=0):(o=AW(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(zp(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&jo(e)},50)}function TC(e,t){let n=e.state.doc.resolve(t);if(!(ir||NT)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function AC(e,t,n){let r=e.state.selection;if(r instanceof yt&&!r.empty||n.indexOf("s")>-1||xi&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=W1(e.state,t);if(s&&s instanceof ut)return ys(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof ni?Mt.near(s,t):Mt.findFrom(s,t);return a?ys(e,a):!1}return!1}function MC(e,t){if(!(e.state.selection instanceof yt))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function NC(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function MW(e){if(!dr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;NC(e,r,"true"),setTimeout(()=>NC(e,r,"false"),20)}return!1}function NW(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function IW(e,t){let n=t.keyCode,r=NW(t);if(n==8||xi&&n==72&&r=="c")return MC(e,-1)||gl(e,-1);if(n==46&&!t.shiftKey||xi&&n==68&&r=="c")return MC(e,1)||gl(e,1);if(n==13||n==27)return!0;if(n==37||xi&&n==66&&r=="c"){let i=n==37?TC(e,e.state.selection.from)=="ltr"?-1:1:-1;return _C(e,i,r)||gl(e,i)}else if(n==39||xi&&n==70&&r=="c"){let i=n==39?TC(e,e.state.selection.from)=="ltr"?1:-1:1;return _C(e,i,r)||gl(e,i)}else{if(n==38||xi&&n==80&&r=="c")return AC(e,-1,r)||gl(e,-1);if(n==40||xi&&n==78&&r=="c")return MW(e)||AC(e,1,r)||gl(e,1);if(r==(xi?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function kx(e,t){e.someProp("transformCopied",g=>{t=g(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let s=e.someProp("clipboardSerializer")||Ba.fromSchema(e.state.schema),a=YT(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let c=u.firstChild,f,h=0;for(;c&&c.nodeType==1&&(f=GT[c.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let x=a.createElement(f[g]);for(;u.firstChild;)x.appendChild(u.firstChild);u.appendChild(x),h++}c=u.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=e.someProp("clipboardTextSerializer",g=>g(t,e))||t.content.textBetween(0,t.content.size,`
1240
-
1241
- `);return{dom:u,text:m,slice:t}}function qT(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let u=!!t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",m=>{t=m(t,o||r,e)}),o)return a=new qe(me.from(e.state.schema.text(t.replace(/\r\n?/g,`
1242
- `))),0,0),e.someProp("transformPasted",m=>{a=m(a,e,!0)}),a;let h=e.someProp("clipboardTextParser",m=>m(t,i,r,e));if(h)a=h;else{let m=i.marks(),{schema:g}=e.state,x=Ba.fromSchema(g);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let k=s.appendChild(document.createElement("p"));b&&k.appendChild(x.serializeNode(g.text(b,m)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),s=PW(n),sd&&jW(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Ro.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!DW.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)a=zW(IC(a,+f[1],+f[2]),f[4]);else if(a=qe.maxOpen(OW(a.content,i),!0),a.openStart||a.openEnd){let h=0,m=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;m<a.openEnd&&!g.type.spec.isolating;m++,g=g.lastChild);a=IC(a,h,m)}return e.someProp("transformPasted",h=>{a=h(a,e,u)}),a}const DW=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function OW(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let u=i.findWrapping(a.type),c;if(!u)return s=null;if(c=s.length&&o.length&&JT(u,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=KT(s[s.length-1],o.length));let f=ZT(a,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return me.from(s)}return e}function ZT(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,me.from(e));return e}function JT(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=JT(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(me.from(ZT(n,e,i+1))))}}function KT(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,KT(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(me.empty,!0);return e.copy(n.append(r))}function Z1(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=Z1(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(me.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function IC(e,t,n){return t<e.openStart&&(e=new qe(Z1(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new qe(Z1(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const GT={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let DC=null;function YT(){return DC||(DC=document.implementation.createHTMLDocument("title"))}let Sg=null;function RW(e){let t=window.trustedTypes;return t?(Sg||(Sg=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Sg.createHTML(e)):e}function PW(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=YT().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&GT[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=RW(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function jW(e){let t=e.querySelectorAll(ir?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function zW(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let u=n.nodes[r[a]];if(!u||u.hasRequiredAttrs())break;i=me.from(u.create(r[a+1],i)),o++,s++}return new qe(i,o,s)}const _r={},Tr={},LW={touchstart:!0,touchmove:!0};class FW{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function $W(e){for(let t in _r){let n=_r[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{UW(e,r)&&!wx(e,r)&&(e.editable||!(r.type in Tr))&&n(e,r)},LW[t]?{passive:!0}:void 0)}dr&&e.dom.addEventListener("input",()=>null),J1(e)}function Ts(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function BW(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function J1(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>wx(e,r))})}function wx(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function UW(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function VW(e,t){!wx(e,t)&&_r[t.type]&&(e.editable||!(t.type in Tr))&&_r[t.type](e,t)}Tr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!XT(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Oo&&ir&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Vl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ga(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||IW(e,n)?n.preventDefault():Ts(e,"key")};Tr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Tr.keypress=(e,t)=>{let n=t;if(XT(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||xi&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof yt)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function Fp(e){return{left:e.clientX,top:e.clientY}}function HW(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Cx(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Nl(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function WW(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ut.isSelectable(r)?(Nl(e,new ut(n)),!0):!1}function qW(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ut&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ut.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Nl(e,ut.create(e.state.doc,i)),!0):!1}function ZW(e,t,n,r,i){return Cx(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?qW(e,n):WW(e,n))}function JW(e,t,n,r){return Cx(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function KW(e,t,n,r){return Cx(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||GW(e,n,r)}function GW(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Nl(e,yt.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Nl(e,yt.create(r,a+1,a+1+s.content.size));else if(ut.isSelectable(s))Nl(e,ut.create(r,a));else continue;return!0}}function Sx(e){return Oh(e)}const QT=xi?"metaKey":"ctrlKey";_r.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Sx(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&HW(n,e.input.lastClick)&&!n[QT]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(Fp(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new YW(e,s,n,!!r)):(o=="doubleClick"?JW:KW)(e,s.pos,s.inside,n)?n.preventDefault():Ts(e,"pointer"))};class YW{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[QT],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let f=t.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}const a=i?null:r.target,u=a?t.docView.nearestDesc(a,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ut&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ki&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ts(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>jo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Fp(t))),this.updateAllowDefault(t),this.allowDefault||!n?Ts(this.view,"pointer"):ZW(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||dr&&this.mightDrag&&!this.mightDrag.node.isAtom||ir&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Nl(this.view,Mt.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Ts(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ts(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}_r.touchstart=e=>{e.input.lastTouch=Date.now(),Sx(e),Ts(e,"pointer")};_r.touchmove=e=>{e.input.lastTouch=Date.now(),Ts(e,"pointer")};_r.contextmenu=e=>Sx(e);function XT(e,t){return e.composing?!0:dr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const QW=Oo?5e3:-1;Tr.compositionstart=Tr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof yt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ir&&NT&&XW(e)))e.markCursor=e.state.storedMarks||n.marks(),Oh(e,!0),e.markCursor=null;else if(Oh(e,!t.selection.empty),ki&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}e6(e,QW)};function XW(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Tr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,e6(e,20))};function e6(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Oh(e),t))}function t6(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=tq());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function eq(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=qH(t.focusNode,t.focusOffset),r=ZH(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function tq(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Oh(e,t=!1){if(!(Oo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),t6(e),t||e.docView&&e.docView.dirty){let n=bx(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function nq(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const $c=Ur&&Os<15||Vl&&YH<604;_r.copy=Tr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=$c?null:n.clipboardData,s=r.content(),{dom:a,text:u}=kx(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):nq(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function rq(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function iq(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Bc(e,r.value,null,i,t):Bc(e,r.textContent,r.innerHTML,i,t)},50)}function Bc(e,t,n,r,i){let o=qT(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||qe.empty)))return!0;if(!o)return!1;let s=rq(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function n6(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Tr.paste=(e,t)=>{let n=t;if(e.composing&&!Oo)return;let r=$c?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Bc(e,n6(r),r.getData("text/html"),i,n)?n.preventDefault():iq(e,n)};class r6{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const oq=xi?"altKey":"ctrlKey";function i6(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[oq]}_r.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Fp(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ut?i.to-1:i.to))){if(r&&r.mightDrag)s=ut.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=e.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=e.docView&&(s=ut.create(e.state.doc,h.posBefore))}}let a=(s||e.state.selection).content(),{dom:u,text:c,slice:f}=kx(e,a);(!n.dataTransfer.files.length||!ir||MT>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData($c?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",$c||n.dataTransfer.setData("text/plain",c),e.dragging=new r6(f,i6(e,n),s)};_r.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Tr.dragover=Tr.dragenter=(e,t)=>t.preventDefault();Tr.drop=(e,t)=>{try{sq(e,t,e.dragging)}finally{e.dragging=null}};function sq(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Fp(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",g=>{o=g(o,e,!1)}):o=qT(e,n6(t.dataTransfer),$c?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&i6(e,t));if(e.someProp("handleDrop",g=>g(e,t,o||qe.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?lT(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let u=e.state.tr;if(s){let{node:g}=n;g?g.replace(u):u.deleteSelection()}let c=u.mapping.map(a),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,h=u.doc;if(f?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),u.doc.eq(h))return;let m=u.doc.resolve(c);if(f&&ut.isSelectable(o.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ut(m));else{let g=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((x,b,k,C)=>g=C),u.setSelection(vx(e,m,u.doc.resolve(g)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}_r.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&jo(e)},20))};_r.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};_r.beforeinput=(e,t)=>{if(ir&&Oo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ga(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Tr)_r[e]=Tr[e];function Uc(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Rh{constructor(t,n){this.toDOM=t,this.spec=n||Sa,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Cr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Rh&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Uc(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ps{constructor(t,n){this.attrs=t,this.spec=n||Sa}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Cr(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ps&&Uc(this.attrs,t.attrs)&&Uc(this.spec,t.spec)}static is(t){return t.type instanceof Ps}destroy(){}}class Ex{constructor(t,n){this.attrs=t,this.spec=n||Sa}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let s=t.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Cr(o.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof Ex&&Uc(this.attrs,t.attrs)&&Uc(this.spec,t.spec)}destroy(){}}class Cr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Cr(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Cr(t,t,new Rh(n,r))}static inline(t,n,r,i){return new Cr(t,n,new Ps(r,i))}static node(t,n,r,i){return new Cr(t,n,new Ex(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ps}get widget(){return this.type instanceof Rh}}const El=[],Sa={};class wn{constructor(t,n){this.local=t.length?t:El,this.children=n.length?n:El}static create(t,n){return n.length?Ph(n,t,0,Sa):ur}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==ur||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Sa)}mapInner(t,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let u=this.local[a].map(t,r,i);u&&u.type.valid(n,u)?(s||(s=[])).push(u):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?aq(this.children,s||[],t,n,r,i,o):s?new wn(s.sort(Ea),El):ur}add(t,n){return n.length?this==ur?wn.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((a,u)=>{let c=u+r,f;if(f=s6(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(a,f,c+1):i.splice(o,0,u,u+a.nodeSize,Ph(f,a,c+1,Sa)),o+=3}});let s=o6(o?a6(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new wn(s.length?this.local.concat(s).sort(Ea):this.local,i||this.children)}remove(t){return t.length==0||this==ur?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,u=r[o+1]+n;for(let f=0,h;f<t.length;f++)(h=t[f])&&h.from>a&&h.to<u&&(t[f]=null,(s||(s=[])).push(h));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=ur?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<t.length;o++)if(s=t[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new wn(i,r):ur}forChild(t,n){if(this==ur)return this;if(n.isLeaf)return wn.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let u=this.local[a];if(u.from<s&&u.to>o&&u.type instanceof Ps){let c=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;c<f&&(i||(i=[])).push(u.copy(c,f))}}if(i){let a=new wn(i.sort(Ea),El);return r?new ws([a,r]):a}return r||ur}eq(t){if(this==t)return!0;if(!(t instanceof wn)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return _x(this.localsInner(t))}localsInner(t){if(this==ur)return El;if(t.inlineContent||!this.local.some(Ps.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ps||n.push(this.local[r]);return n}forEachSet(t){t(this)}}wn.empty=new wn([],[]);wn.removeOverlap=_x;const ur=wn.empty;class ws{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Sa));return ws.from(r)}forChild(t,n){if(n.isLeaf)return wn.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=ur&&(o instanceof ws?r=r.concat(o.members):r.push(o))}return ws.from(r)}eq(t){if(!(t instanceof ws)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?_x(r?n:n.sort(Ea)):El}static from(t){switch(t.length){case 0:return ur;case 1:return t[0];default:return new ws(t.every(n=>n instanceof wn)?t:t.reduce((n,r)=>n.concat(r instanceof wn?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function aq(e,t,n,r,i,o,s){let a=e.slice();for(let c=0,f=o;c<n.maps.length;c++){let h=0;n.maps[c].forEach((m,g,x,b)=>{let k=b-x-(g-m);for(let C=0;C<a.length;C+=3){let _=a[C+1];if(_<0||m>_+f-h)continue;let E=a[C]+f-h;g>=E?a[C+1]=m<=E?-2:-1:m>=f&&k&&(a[C]+=k,a[C+1]+=k)}h+=k}),f=n.maps[c].map(f,-1)}let u=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){u=!0,a[c+1]=-1;continue}let f=n.map(e[c]+o),h=f-i;if(h<0||h>=r.content.size){u=!0;continue}let m=n.map(e[c+1]+o,-1),g=m-i,{index:x,offset:b}=r.content.findIndex(h),k=r.maybeChild(x);if(k&&b==h&&b+k.nodeSize==g){let C=a[c+2].mapInner(n,k,f+1,e[c]+o+1,s);C!=ur?(a[c]=h,a[c+1]=g,a[c+2]=C):(a[c+1]=-2,u=!0)}else u=!0}if(u){let c=lq(a,e,t,n,i,o,s),f=Ph(c,r,0,s);t=f.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,m=0;h<f.children.length;h+=3){let g=f.children[h];for(;m<a.length&&a[m]<g;)m+=3;a.splice(m,0,f.children[h],f.children[h+1],f.children[h+2])}}return new wn(t.sort(Ea),a)}function o6(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Cr(i.from+t,i.to+t,i.type))}return n}function lq(e,t,n,r,i,o,s){function a(u,c){for(let f=0;f<u.local.length;f++){let h=u.local[f].map(r,i,c);h?n.push(h):s.onRemove&&s.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)a(u.children[f+2],u.children[f]+c+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&a(e[u+2],t[u]+o+1);return n}function s6(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,s;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function a6(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Ph(e,t,n,r){let i=[],o=!1;t.forEach((a,u)=>{let c=s6(e,a,u+n);if(c){o=!0;let f=Ph(c,a,n+u+1,r);f!=ur&&i.push(u,u+a.nodeSize,f)}});let s=o6(o?a6(e):e,-n).sort(Ea);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new wn(s,i):ur}function Ea(e,t){return e.from-t.from||e.to-t.to}function _x(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),OC(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),OC(t,i,r.copy(o.from,r.to)));break}}}return t}function OC(e,t,n){for(;t<e.length&&Ea(n,e[t])>0;)t++;e.splice(t,0,n)}function Eg(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=ur&&t.push(r)}),e.cursorWrapper&&t.push(wn.create(e.state.doc,[e.cursorWrapper.deco])),ws.from(t)}const uq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},cq=Ur&&Os<=11;class dq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class fq{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new dq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ur&&Os<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():dr&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),cq&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,uq)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(EC(this.view)){if(this.suppressingSelectionUpdates)return jo(this.view);if(Ur&&Os<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Oa(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Ul(o))n.add(o);for(let o=t.anchorNode;o;o=Ul(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&EC(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,u=[];if(t.editable)for(let f=0;f<n.length;f++){let h=this.registerMutation(n[f],u);h&&(o=o<0?h.from:Math.min(h.from,o),s=s<0?h.to:Math.max(h.to,s),h.typeOver&&(a=!0))}if(u.some(f=>f.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let f of u)if(f.nodeName=="BR"&&f.parentNode){let h=f.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&f.parentNode.removeChild(f)}}else if(ki&&u.length){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||mq(t,h)!=g)&&m.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&zp(r)&&(c=bx(t))&&c.eq(Mt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,jo(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),hq(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,gq(t,u)),this.handleDOMChange(o,s,a,u),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||jo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let f=0;f<t.addedNodes.length;f++){let h=t.addedNodes[f];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(Ur&&Os<=11&&t.addedNodes.length)for(let f=0;f<t.addedNodes.length;f++){let{previousSibling:h,nextSibling:m}=t.addedNodes[f];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!m||Array.prototype.indexOf.call(t.addedNodes,m)<0)&&(o=m)}let s=i&&i.parentNode==t.target?nr(i)+1:0,a=r.localPosFromDOM(t.target,s,-1),u=o&&o.parentNode==t.target?nr(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,u,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let RC=new WeakMap,PC=!1;function hq(e){if(!RC.has(e)&&(RC.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=ki,PC)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),PC=!0}}function jC(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Oa(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function pq(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return jC(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?jC(e,n):null}function mq(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function gq(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=o.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let a=s;for(;;){let u=a.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;a=u}a.insertBefore(o,a.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function yq(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=e.docView.parseRange(t,n),u=e.domSelectionRange(),c,f=u.anchorNode;if(f&&e.dom.contains(f.nodeType==1?f:f.parentNode)&&(c=[{node:f,offset:u.anchorOffset}],zp(u)||c.push({node:u.focusNode,offset:u.focusOffset})),ir&&e.input.lastKeyCode===8)for(let k=o;k>i;k--){let C=r.childNodes[k-1],_=C.pmViewDesc;if(C.nodeName=="BR"&&!_){o=k;break}if(!_||_.size)break}let h=e.state.doc,m=e.someProp("domParser")||Ro.fromSchema(e.state.schema),g=h.resolve(s),x=null,b=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:xq,context:g});if(c&&c[0].pos!=null){let k=c[0].pos,C=c[1]&&c[1].pos;C==null&&(C=k),x={anchor:k+s,head:C+s}}return{doc:b,sel:x,from:s,to:a}}function xq(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(dr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||dr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const bq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vq(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let j=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=bx(e,j);if(O&&!e.state.selection.eq(O)){if(ir&&Oo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",F=>F(e,ga(13,"Enter"))))return;let R=e.state.tr.setSelection(O);j=="pointer"?R.setMeta("pointer",!0):j=="key"&&R.scrollIntoView(),o&&R.setMeta("composition",o),e.dispatch(R)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,c=yq(e,t,n),f=e.state.doc,h=f.slice(c.from,c.to),m,g;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(m=e.state.selection.to,g="end"):(m=e.state.selection.from,g="start"),e.input.lastKeyCode=null;let x=Cq(h.content,c.doc.content,c.from,m,g);if(x&&e.input.domChangeCount++,(Vl&&e.input.lastIOSEnter>Date.now()-225||Oo)&&i.some(j=>j.nodeType==1&&!bq.test(j.nodeName))&&(!x||x.endA>=x.endB)&&e.someProp("handleKeyDown",j=>j(e,ga(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!x)if(r&&u instanceof yt&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))x={start:u.from,endA:u.to,endB:u.to};else{if(c.sel){let j=zC(e,e.state.doc,c.sel);if(j&&!j.eq(e.state.selection)){let O=e.state.tr.setSelection(j);o&&O.setMeta("composition",o),e.dispatch(O)}}return}e.state.selection.from<e.state.selection.to&&x.start==x.endB&&e.state.selection instanceof yt&&(x.start>e.state.selection.from&&x.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?x.start=e.state.selection.from:x.endA<e.state.selection.to&&x.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(x.endB+=e.state.selection.to-x.endA,x.endA=e.state.selection.to)),Ur&&Os<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>c.from&&c.doc.textBetween(x.start-c.from-1,x.start-c.from+1)=="  "&&(x.start--,x.endA--,x.endB--);let b=c.doc.resolveNoCache(x.start-c.from),k=c.doc.resolveNoCache(x.endB-c.from),C=f.resolve(x.start),_=b.sameParent(k)&&b.parent.inlineContent&&C.end()>=x.endA;if((Vl&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(j=>j.nodeName=="DIV"||j.nodeName=="P"))||!_&&b.pos<c.doc.content.size&&(!b.sameParent(k)||!b.parent.inlineContent)&&b.pos<k.pos&&!/\S/.test(c.doc.textBetween(b.pos,k.pos,"","")))&&e.someProp("handleKeyDown",j=>j(e,ga(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>x.start&&wq(f,x.start,x.endA,b,k)&&e.someProp("handleKeyDown",j=>j(e,ga(8,"Backspace")))){Oo&&ir&&e.domObserver.suppressSelectionUpdates();return}ir&&x.endB==x.start&&(e.input.lastChromeDelete=Date.now()),Oo&&!_&&b.start()!=k.start()&&k.parentOffset==0&&b.depth==k.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==x.endA&&(x.endB-=2,k=c.doc.resolveNoCache(x.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(j){return j(e,ga(13,"Enter"))})},20));let E=x.start,I=x.endA,N=j=>{let O=j||e.state.tr.replace(E,I,c.doc.slice(x.start-c.from,x.endB-c.from));if(c.sel){let R=zC(e,O.doc,c.sel);R&&!(ir&&e.composing&&R.empty&&(x.start!=x.endB||e.input.lastChromeDelete<Date.now()-100)&&(R.head==E||R.head==O.mapping.map(I)-1)||Ur&&R.empty&&R.head==E)&&O.setSelection(R)}return o&&O.setMeta("composition",o),O.scrollIntoView()},M;if(_)if(b.pos==k.pos){Ur&&Os<=11&&b.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>jo(e),20));let j=N(e.state.tr.delete(E,I)),O=f.resolve(x.start).marksAcross(f.resolve(x.endA));O&&j.ensureMarks(O),e.dispatch(j)}else if(x.endA==x.endB&&(M=kq(b.parent.content.cut(b.parentOffset,k.parentOffset),C.parent.content.cut(C.parentOffset,x.endA-C.start())))){let j=N(e.state.tr);M.type=="add"?j.addMark(E,I,M.mark):j.removeMark(E,I,M.mark),e.dispatch(j)}else if(b.parent.child(b.index()).isText&&b.index()==k.index()-(k.textOffset?0:1)){let j=b.parent.textBetween(b.parentOffset,k.parentOffset),O=()=>N(e.state.tr.insertText(j,E,I));e.someProp("handleTextInput",R=>R(e,E,I,j,O))||e.dispatch(O())}else e.dispatch(N());else e.dispatch(N())}function zC(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:vx(e,t.resolve(n.anchor),t.resolve(n.head))}function kq(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,u;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",u=f=>f.mark(a.addToSet(f.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",u=f=>f.mark(a.removeFromSet(f.marks));else return null;let c=[];for(let f=0;f<t.childCount;f++)c.push(u(t.child(f)));if(me.from(c).eq(e))return{mark:a,type:s}}function wq(e,t,n,r,i){if(n-t<=i.pos-r.pos||_g(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==t+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(_g(o,!0,!0));return!s.parent.isTextblock||s.pos>n||_g(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function _g(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Cq(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,a));r-=s+u-o}if(s<o&&e.size<t.size){let u=r<=o&&r>=s?o-r:0;o-=u,o&&o<t.size&&LC(t.textBetween(o-1,o+1))&&(o+=u?1:-1),a=o+(a-s),s=o}else if(a<o){let u=r<=o&&r>=a?o-r:0;o-=u,o&&o<e.size&&LC(e.textBetween(o-1,o+1))&&(o+=u?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function LC(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class l6{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new FW,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(VC),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=BC(this),$C(this),this.nodeViews=UC(this),this.docView=bC(this.state.doc,FC(this),Eg(this),this.dom,this),this.domObserver=new fq(this,(r,i,o,s)=>vq(this,r,i,o,s)),this.domObserver.start(),$W(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&J1(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(VC),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(t6(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=UC(this);Eq(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&J1(this),this.editable=BC(this),$C(this);let u=Eg(this),c=FC(this),f=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(t.doc,c,u);(h||!t.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&eW(this);if(s){this.domObserver.stop();let g=h&&(Ur||ir)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&Sq(i.selection,t.selection);if(h){let x=ir?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=eq(this)),(o||!this.docView.update(t.doc,c,u,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=bC(t.doc,c,u,this.dom,this)),x&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&SW(this))?jo(this,g):(VT(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&tW(m)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ut){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&hC(this,n.getBoundingClientRect(),t)}else hC(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new r6(t.slice,t.move,i<0?void 0:ut.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[t];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Ur){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&nW(this.dom),jo(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return aW(this,t)}coordsAtPos(t,n=1){return PT(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return fW(this,n||this.state,t)}pasteHTML(t,n){return Bc(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Bc(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return kx(this,t)}destroy(){this.docView&&(BW(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Eg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,HH())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return VW(this,t)}domSelectionRange(){let t=this.domSelection();return t?dr&&this.root.nodeType===11&&KH(this.dom.ownerDocument)==this.dom&&pq(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}l6.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function FC(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Cr.node(0,e.state.doc.content.size,t)]}function $C(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Cr.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function BC(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Sq(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function UC(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Eq(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function VC(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var $s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},jh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_q=typeof navigator<"u"&&/Mac/.test(navigator.platform),Tq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rr=0;rr<10;rr++)$s[48+rr]=$s[96+rr]=String(rr);for(var rr=1;rr<=24;rr++)$s[rr+111]="F"+rr;for(var rr=65;rr<=90;rr++)$s[rr]=String.fromCharCode(rr+32),jh[rr]=String.fromCharCode(rr);for(var Tg in $s)jh.hasOwnProperty(Tg)||(jh[Tg]=$s[Tg]);function Aq(e){var t=_q&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Tq&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?jh:$s)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Mq=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Nq=typeof navigator<"u"&&/Win/.test(navigator.platform);function Iq(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a++){let u=t[a];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))Mq?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Dq(e){let t=Object.create(null);for(let n in e)t[Iq(n)]=e[n];return t}function Ag(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Oq(e){return new yn({props:{handleKeyDown:u6(e)}})}function u6(e){let t=Dq(e);return function(n,r){let i=Aq(r),o,s=t[Ag(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=t[Ag(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Nq&&r.ctrlKey&&r.altKey)&&(o=$s[r.keyCode])&&o!=i){let a=t[Ag(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var Rq=Object.defineProperty,Tx=(e,t)=>{for(var n in t)Rq(e,n,{get:t[n],enumerable:!0})};function $p(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Bp=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,(...c)=>{const f=a(...c)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,u=e||i.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),s.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(n).map(([h,m])=>[h,(...x)=>{const b=this.buildProps(u,t),k=m(...x)(b);return s.push(k),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:$p({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(s)]))}};return s}},c6={};Tx(c6,{blur:()=>Pq,clearContent:()=>jq,clearNodes:()=>zq,command:()=>Lq,createParagraphNear:()=>Fq,cut:()=>$q,deleteCurrentNode:()=>Bq,deleteNode:()=>Uq,deleteRange:()=>Vq,deleteSelection:()=>Hq,enter:()=>Wq,exitCode:()=>qq,extendMarkRange:()=>Zq,first:()=>Jq,focus:()=>Gq,forEach:()=>Yq,insertContent:()=>Qq,insertContentAt:()=>tZ,joinBackward:()=>iZ,joinDown:()=>rZ,joinForward:()=>oZ,joinItemBackward:()=>sZ,joinItemForward:()=>aZ,joinTextblockBackward:()=>lZ,joinTextblockForward:()=>uZ,joinUp:()=>nZ,keyboardShortcut:()=>dZ,lift:()=>fZ,liftEmptyBlock:()=>hZ,liftListItem:()=>pZ,newlineInCode:()=>mZ,resetAttributes:()=>gZ,scrollIntoView:()=>yZ,selectAll:()=>xZ,selectNodeBackward:()=>bZ,selectNodeForward:()=>vZ,selectParentNode:()=>kZ,selectTextblockEnd:()=>wZ,selectTextblockStart:()=>CZ,setContent:()=>SZ,setMark:()=>HZ,setMeta:()=>WZ,setNode:()=>qZ,setNodeSelection:()=>ZZ,setTextDirection:()=>JZ,setTextSelection:()=>KZ,sinkListItem:()=>GZ,splitBlock:()=>YZ,splitListItem:()=>QZ,toggleList:()=>XZ,toggleMark:()=>eJ,toggleNode:()=>tJ,toggleWrap:()=>nJ,undoInputRule:()=>rJ,unsetAllMarks:()=>iJ,unsetMark:()=>oJ,unsetTextDirection:()=>sJ,updateAttributes:()=>aJ,wrapIn:()=>lJ,wrapInList:()=>uJ});var Pq=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),jq=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),zq=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,u)=>{if(a.type.isText)return;const{doc:c,mapping:f}=t,h=c.resolve(f.map(u)),m=c.resolve(f.map(u+a.nodeSize)),g=h.blockRange(m);if(!g)return;const x=eu(g);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(g.start,b)}(x||x===0)&&t.lift(g,x)})}),!0},Lq=e=>t=>e(t),Fq=()=>({state:e,dispatch:t})=>ST(e,t),$q=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new yt(r.doc.resolve(Math.max(s-1,0)))),!0},Bq=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),u=i.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1};function Rn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Uq=e=>({tr:t,state:n,dispatch:r})=>{const i=Rn(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const u=o.before(s),c=o.after(s);t.delete(u,c).scrollIntoView()}return!0}return!1},Vq=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Hq=()=>({state:e,dispatch:t})=>hx(e,t),Wq=()=>({commands:e})=>e.keyboardShortcut("Enter"),qq=()=>({state:e,dispatch:t})=>MH(e,t);function Ax(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function zh(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:Ax(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function d6(e,t,n={}){return e.find(r=>r.type===t&&zh(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function HC(e,t,n={}){return!!d6(e,t,n)}function Mx(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===t)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!d6([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,u=s+1,c=a+i.node.nodeSize;for(;s>0&&HC([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;u<e.parent.childCount&&HC([...e.parent.child(u).marks],t,n);)c+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:c}}function Bo(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Zq=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Bo(e,r.schema),{doc:s,selection:a}=n,{$from:u,from:c,to:f}=a;if(i){const h=Mx(u,o,t);if(h&&h.from<=c&&h.to>=f){const m=yt.create(s,h.from,h.to);n.setSelection(m)}}return!0},Jq=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function f6(e){return e instanceof yt}function va(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function h6(e,t=null){if(!t)return null;const n=Mt.atStart(e),r=Mt.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?yt.create(e,va(0,i,o),va(e.content.size,i,o)):yt.create(e,va(t,i,o),va(t,i,o))}function K1(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Vc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Kq(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Gq=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{(Vc()||K1())&&r.dom.focus(),Kq()&&!Vc()&&!K1()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!f6(n.state.selection))return s(),!0;const a=h6(i.doc,e)||n.state.selection,u=n.state.selection.eq(a);return o&&(u||i.setSelection(a),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Yq=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Qq=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),p6=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&p6(r)}return e};function jf(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return p6(n)}function Hc(e,t,n){if(e instanceof Ds||e instanceof me)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return me.fromArray(e.map(a=>t.nodeFromJSON(a)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Hc("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const u=new lx({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Ro.fromSchema(u).parseSlice(jf(e),n.parseOptions):Ro.fromSchema(u).parse(jf(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Ro.fromSchema(t);return n.slice?o.parseSlice(jf(e),n.parseOptions).content:o.parse(jf(e),n.parseOptions)}return Hc("",t,n)}function Xq(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Zn||i instanceof Kn))return;const o=e.mapping.maps[r];let s=0;o.forEach((a,u,c,f)=>{s===0&&(s=f)}),e.setSelection(Mt.near(e.doc.resolve(s),n))}var eZ=e=>!("type"in e),tZ=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const u=k=>{o.emit("contentError",{editor:o,error:k,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Hc(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(k){u(k)}try{a=Hc(t,o.schema,{parseOptions:c,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(k){return u(k),!1}let{from:f,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},m=!0,g=!0;if((eZ(a)?a:[a]).forEach(k=>{k.check(),m=m?k.isText&&k.marks.length===0:!1,g=g?k.isBlock:!1}),f===h&&g){const{parent:k}=r.doc.resolve(f);k.isTextblock&&!k.type.spec.code&&!k.childCount&&(f-=1,h+=1)}let b;if(m){if(Array.isArray(t))b=t.map(k=>k.text||"").join("");else if(t instanceof me){let k="";t.forEach(C=>{C.text&&(k+=C.text)}),b=k}else typeof t=="object"&&t&&t.text?b=t.text:b=t;r.insertText(b,f,h)}else{b=a;const k=r.doc.resolve(f),C=k.node(),_=k.parentOffset===0,E=C.isText||C.isTextblock,I=C.content.size>0;_&&E&&I&&(f=Math.max(0,f-1)),r.replaceWith(f,h,b)}n.updateSelection&&Xq(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0},nZ=()=>({state:e,dispatch:t})=>_H(e,t),rZ=()=>({state:e,dispatch:t})=>TH(e,t),iZ=()=>({state:e,dispatch:t})=>yT(e,t),oZ=()=>({state:e,dispatch:t})=>kT(e,t),sZ=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Rp(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},aZ=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Rp(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},lZ=()=>({state:e,dispatch:t})=>SH(e,t),uZ=()=>({state:e,dispatch:t})=>EH(e,t);function m6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function cZ(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a+=1){const u=t[a];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))Vc()||m6()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var dZ=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=cZ(e).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return u==null||u.steps.forEach(c=>{const f=c.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function Bs(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?Rn(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;const g=Math.max(r,m),x=Math.min(i,m+h.nodeSize);a.push({node:h,from:g,to:x})});const u=i-r,c=a.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>zh(h.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((h,m)=>h+m.to-m.from,0)>=u}var fZ=(e,t={})=>({state:n,dispatch:r})=>{const i=Rn(e,n.schema);return Bs(n,i,t)?AH(n,r):!1},hZ=()=>({state:e,dispatch:t})=>ET(e,t),pZ=e=>({state:t,dispatch:n})=>{const r=Rn(e,t.schema);return $H(r)(t,n)},mZ=()=>({state:e,dispatch:t})=>CT(e,t);function Up(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function WC(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var gZ=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Up(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=Rn(e,r.schema)),a==="mark"&&(s=Bo(e,r.schema));let u=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(f,h)=>{o&&o===f.type&&(u=!0,i&&n.setNodeMarkup(h,void 0,WC(f.attrs,t))),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&(u=!0,i&&n.addMark(h,h+f.nodeSize,s.create(WC(m.attrs,t))))})})}),u},yZ=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),xZ=()=>({tr:e,dispatch:t})=>{if(t){const n=new ni(e.doc);e.setSelection(n)}return!0},bZ=()=>({state:e,dispatch:t})=>bT(e,t),vZ=()=>({state:e,dispatch:t})=>wT(e,t),kZ=()=>({state:e,dispatch:t})=>DH(e,t),wZ=()=>({state:e,dispatch:t})=>PH(e,t),CZ=()=>({state:e,dispatch:t})=>RH(e,t);function G1(e,t,n={},r={}){return Hc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var SZ=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{const{doc:u}=o;if(r.preserveWhitespace!=="full"){const c=G1(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,c).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:u.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function g6(e,t){const n=Bo(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});const a=s.find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function y6(e,t){const n=new hT(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function EZ(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function _Z(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function TZ(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Vp(e){return t=>TZ(t.$from,e)}function lt(e,t,n){return e.config[t]===void 0&&e.parent?lt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?lt(e.parent,t,n):null}):e.config[t]}function Nx(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=lt(t,"addExtensions",n);return r?[t,...Nx(r())]:t}).flat(10)}function ld(e,t){const n=Ba.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function x6(e){return typeof e=="function"}function Zt(e,t=void 0,...n){return x6(e)?t?e.bind(t)(...n):e(...n):e}function AZ(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Hl(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function b6(e){const t=[],{nodeExtensions:n,markExtensions:r}=Hl(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(c=>c.name!=="text").map(c=>c.name),a=r.map(c=>c.name),u=[...s,...a];return e.forEach(c=>{const f={name:c.name,options:c.options,storage:c.storage,extensions:i},h=lt(c,"addGlobalAttributes",f);if(!h)return;h().forEach(g=>{let x;Array.isArray(g.types)?x=g.types:g.types==="*"?x=u:g.types==="nodes"?x=s:g.types==="marks"?x=a:x=[],x.forEach(b=>{Object.entries(g.attributes).forEach(([k,C])=>{t.push({type:b,name:k,attribute:{...o,...C}})})})})}),i.forEach(c=>{const f={name:c.name,options:c.options,storage:c.storage},h=lt(c,"addAttributes",f);if(!h)return;const m=h();Object.entries(m).forEach(([g,x])=>{const b={...o,...x};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,t.push({type:c.name,name:g,attribute:b})})}),t}function Pn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],c=a.filter(f=>!u.includes(f));r[i]=[...u,...c].join(" ")}else if(i==="style"){const a=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],c=new Map;u.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),a.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),r[i]=Array.from(c.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Wl(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Pn(n,r),{})}function MZ(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function qC(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):MZ(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function ZC(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&AZ(n)?!1:n!=null))}function JC(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function NZ(e,t){var n;const r=b6(e),{nodeExtensions:i,markExtensions:o}=Hl(e),s=(n=i.find(c=>lt(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(c=>{const f=r.filter(C=>C.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:t},m=e.reduce((C,_)=>{const E=lt(_,"extendNodeSchema",h);return{...C,...E?E(c):{}}},{}),g=ZC({...m,content:Zt(lt(c,"content",h)),marks:Zt(lt(c,"marks",h)),group:Zt(lt(c,"group",h)),inline:Zt(lt(c,"inline",h)),atom:Zt(lt(c,"atom",h)),selectable:Zt(lt(c,"selectable",h)),draggable:Zt(lt(c,"draggable",h)),code:Zt(lt(c,"code",h)),whitespace:Zt(lt(c,"whitespace",h)),linebreakReplacement:Zt(lt(c,"linebreakReplacement",h)),defining:Zt(lt(c,"defining",h)),isolating:Zt(lt(c,"isolating",h)),attrs:Object.fromEntries(f.map(JC))}),x=Zt(lt(c,"parseHTML",h));x&&(g.parseDOM=x.map(C=>qC(C,f)));const b=lt(c,"renderHTML",h);b&&(g.toDOM=C=>b({node:C,HTMLAttributes:Wl(C,f)}));const k=lt(c,"renderText",h);return k&&(g.toText=k),[c.name,g]})),u=Object.fromEntries(o.map(c=>{const f=r.filter(k=>k.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:t},m=e.reduce((k,C)=>{const _=lt(C,"extendMarkSchema",h);return{...k,..._?_(c):{}}},{}),g=ZC({...m,inclusive:Zt(lt(c,"inclusive",h)),excludes:Zt(lt(c,"excludes",h)),group:Zt(lt(c,"group",h)),spanning:Zt(lt(c,"spanning",h)),code:Zt(lt(c,"code",h)),attrs:Object.fromEntries(f.map(JC))}),x=Zt(lt(c,"parseHTML",h));x&&(g.parseDOM=x.map(k=>qC(k,f)));const b=lt(c,"renderHTML",h);return b&&(g.toDOM=k=>b({mark:k,HTMLAttributes:Wl(k,f)})),[c.name,g]}));return new lx({topNode:s,nodes:a,marks:u})}function IZ(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function gc(e){return e.sort((n,r)=>{const i=lt(n,"priority")||100,o=lt(r,"priority")||100;return i>o?-1:i<o?1:0})}function v6(e){const t=gc(Nx(e)),n=IZ(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function k6(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
1243
-
1244
- `,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(u,c,f,h)=>{var m;u.isBlock&&c>r&&(a+=o);const g=s==null?void 0:s[u.type.name];if(g)return f&&(a+=g({node:u,pos:c,parent:f,index:h,range:t})),!1;u.isText&&(a+=(m=u==null?void 0:u.text)==null?void 0:m.slice(Math.max(r,c)-c,i-c))}),a}function DZ(e,t){const n={from:0,to:e.content.size};return k6(e,n,t)}function w6(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function OZ(e,t){const n=Rn(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function C6(e,t){const n=Up(typeof t=="string"?t:t.name,e.schema);return n==="node"?OZ(e,t):n==="mark"?g6(e,t):{}}function RZ(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function PZ(e){const t=RZ(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function S6(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,u)=>{s.push({from:a,to:u})});else{const{from:a,to:u}=n[o];if(a===void 0||u===void 0)return;s.push({from:a,to:u})}s.forEach(({from:a,to:u})=>{const c=t.slice(o).map(a,-1),f=t.slice(o).map(u),h=t.invert().map(c,-1),m=t.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:c,to:f}})})}),PZ(r)}function Ix(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=Mx(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var jZ=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const a=i.node(o);(a==null?void 0:a.type.name)===t?s=a:o-=1}return[s,o]};function Vu(e,t){return t.nodes[e]||t.marks[e]||null}function eh(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var zZ=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var u,c;const f=((c=(u=i.type.spec).toText)==null?void 0:c.call(u,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function Y1(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Bo(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>zh(h.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:h,$to:m})=>{const g=h.pos,x=m.pos;e.doc.nodesBetween(g,x,(b,k)=>{if(o&&b.inlineContent&&!b.type.allowsMarkType(o))return!1;if(!b.isText&&!b.marks.length)return;const C=Math.max(g,k),_=Math.min(x,k+b.nodeSize),E=_-C;s+=E,a.push(...b.marks.map(I=>({mark:I,from:C,to:_})))})}),s===0)return!1;const u=a.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>zh(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),c=a.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+c:u)>=s}function LZ(e,t,n={}){if(!t)return Bs(e,null,n)||Y1(e,null,n);const r=Up(t,e.schema);return r==="node"?Bs(e,t,n):r==="mark"?Y1(e,t,n):!1}var FZ=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=Vp(a=>a.type.name===t)(e.selection);if(!o)return!1;const s=e.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},$Z=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function KC(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function GC(e,t){const{nodeExtensions:n}=Hl(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Zt(lt(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Hp(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(Hp(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function E6(e){return e instanceof ut}var _6=class T6{constructor(t){this.position=t}static fromJSON(t){return new T6(t.position)}toJSON(){return{position:this.position}}};function BZ(e,t){const n=t.mapping.mapResult(e.position);return{position:new _6(n.pos),mapResult:n}}function UZ(e){return new _6(e)}function VZ(e,t,n){var r;const{selection:i}=t;let o=null;if(f6(i)&&(o=i.$cursor),o){const a=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(c=>c.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:a,$to:u})=>{let c=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,u.pos,(f,h,m)=>{if(c)return!1;if(f.isInline){const g=!m||m.type.allowsMarkType(n),x=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));c=g&&x}return!c}),c})}var HZ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,u=Bo(e,r.schema);if(i)if(s){const c=g6(r,u);n.addStoredMark(u.create({...c,...t}))}else a.forEach(c=>{const f=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{const x=Math.max(g,f),b=Math.min(g+m.nodeSize,h);m.marks.find(C=>C.type===u)?m.marks.forEach(C=>{u===C.type&&n.addMark(x,b,u.create({...C.attrs,...t}))}):n.addMark(x,b,u.create(t))})});return VZ(r,n,u)},WZ=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),qZ=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Rn(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>cC(o,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>cC(o,{...s,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ZZ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=va(e,0,r.content.size),o=ut.create(r,i);t.setSelection(o)}return!0},JZ=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=r;let s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),i&&n.doc.nodesBetween(s,a,(u,c)=>{u.isText||n.setNodeMarkup(c,void 0,{...u.attrs,dir:e})}),!0},KZ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=yt.atStart(r).from,a=yt.atEnd(r).to,u=va(i,s,a),c=va(o,s,a),f=yt.create(r,u,c);t.setSelection(f)}return!0},GZ=e=>({state:t,dispatch:n})=>{const r=Rn(e,t.schema);return VH(r)(t,n)};function YC(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var YZ=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:u}=o,c=i.extensionManager.attributes,f=eh(c,a.node().type.name,a.node().attrs);if(o instanceof ut&&o.node.isBlock)return!a.parentOffset||!Po(s,a.pos)?!1:(r&&(e&&YC(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=u.parentOffset===u.parent.content.size,m=a.depth===0?void 0:EZ(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&m?[{type:m,attrs:f}]:void 0,x=Po(t.doc,t.mapping.map(a.pos),1,g);if(!g&&!x&&Po(t.doc,t.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(x=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(x&&(o instanceof yt&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,g),m&&!h&&!a.parentOffset&&a.parent.type!==m)){const b=t.mapping.map(a.before()),k=t.doc.resolve(b);a.node(-1).canReplaceWith(k.index(),k.index()+1,m)&&t.setNodeMarkup(t.mapping.map(a.before()),m)}e&&YC(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return x},QZ=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Rn(e,r.schema),{$from:u,$to:c}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(c))return!1;const h=u.node(-1);if(h.type!==a)return!1;const m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=me.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let O=u.depth-_;O>=u.depth-3;O-=1)C=me.from(u.node(O).copy(C));const E=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,I={...eh(m,u.node().type.name,u.node().attrs),...t},N=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill(I))||void 0;C=C.append(me.from(a.createAndFill(null,N)||void 0));const M=u.before(u.depth-(_-1));n.replace(M,u.after(-E),new qe(C,4-_,0));let j=-1;n.doc.nodesBetween(M,n.doc.content.size,(O,R)=>{if(j>-1)return!1;O.isTextblock&&O.content.size===0&&(j=R+1)}),j>-1&&n.setSelection(yt.near(n.doc.resolve(j))),n.scrollIntoView()}return!0}const g=c.pos===u.end()?h.contentMatchAt(0).defaultType:null,x={...eh(m,h.type.name,h.attrs),...t},b={...eh(m,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,c.pos);const k=g?[{type:a,attrs:x},{type:g,attrs:b}]:[{type:a,attrs:x}];if(!Po(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:_}=r,{splittableMarks:E}=o.extensionManager,I=_||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,k).scrollIntoView(),!I||!i)return!0;const N=I.filter(M=>E.includes(M.type.name));n.ensureMarks(N)}return!0},Mg=(e,t)=>{const n=Vp(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Zs(e.doc,n.pos)&&e.join(n.pos),!0},Ng=(e,t)=>{const n=Vp(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Zs(e.doc,r)&&e.join(r),!0},XZ=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:u,commands:c,can:f})=>{const{extensions:h,splittableMarks:m}=i.extensionManager,g=Rn(e,s.schema),x=Rn(t,s.schema),{selection:b,storedMarks:k}=s,{$from:C,$to:_}=b,E=C.blockRange(_),I=k||b.$to.parentOffset&&b.$from.marks();if(!E)return!1;const N=Vp(M=>GC(M.type.name,h))(b);if(E.depth>=1&&N&&E.depth-N.depth<=1){if(N.node.type===g)return c.liftListItem(x);if(GC(N.node.type.name,h)&&g.validContent(N.node.content)&&a)return u().command(()=>(o.setNodeMarkup(N.pos,g),!0)).command(()=>Mg(o,g)).command(()=>Ng(o,g)).run()}return!n||!I||!a?u().command(()=>f().wrapInList(g,r)?!0:c.clearNodes()).wrapInList(g,r).command(()=>Mg(o,g)).command(()=>Ng(o,g)).run():u().command(()=>{const M=f().wrapInList(g,r),j=I.filter(O=>m.includes(O.type.name));return o.ensureMarks(j),M?!0:c.clearNodes()}).wrapInList(g,r).command(()=>Mg(o,g)).command(()=>Ng(o,g)).run()},eJ=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Bo(e,r.schema);return Y1(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},tJ=(e,t,n={})=>({state:r,commands:i})=>{const o=Rn(e,r.schema),s=Rn(t,r.schema),a=Bs(r,o,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),a?i.setNode(s,u):i.setNode(o,{...u,...n})},nJ=(e,t={})=>({state:n,commands:r})=>{const i=Rn(e,n.schema);return Bs(n,i,t)?r.lift(i):r.wrapIn(i,t)},rJ=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const s=e.tr,a=o.transform;for(let u=a.steps.length-1;u>=0;u-=1)s.step(a.steps[u].invert(a.docs[u]));if(o.text){const u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},iJ=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},oJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,u=Bo(e,r.schema),{$from:c,empty:f,ranges:h}=a;if(!i)return!0;if(f&&s){let{from:m,to:g}=a;const x=(o=c.marks().find(k=>k.type===u))==null?void 0:o.attrs,b=Mx(c,u,x);b&&(m=b.from,g=b.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},sJ=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let o,s;return typeof e=="number"?(o=e,s=e):e&&"from"in e&&"to"in e?(o=e.from,s=e.to):(o=i.from,s=i.to),r&&t.doc.nodesBetween(o,s,(a,u)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,t.setNodeMarkup(u,void 0,c)}),!0},aJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Up(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=Rn(e,r.schema)),a==="mark"&&(s=Bo(e,r.schema));let u=!1;return n.selection.ranges.forEach(c=>{const f=c.$from.pos,h=c.$to.pos;let m,g,x,b;n.selection.empty?r.doc.nodesBetween(f,h,(k,C)=>{o&&o===k.type&&(u=!0,x=Math.max(C,f),b=Math.min(C+k.nodeSize,h),m=C,g=k)}):r.doc.nodesBetween(f,h,(k,C)=>{C<f&&o&&o===k.type&&(u=!0,x=Math.max(C,f),b=Math.min(C+k.nodeSize,h),m=C,g=k),C>=f&&C<=h&&(o&&o===k.type&&(u=!0,i&&n.setNodeMarkup(C,void 0,{...k.attrs,...t})),s&&k.marks.length&&k.marks.forEach(_=>{if(s===_.type&&(u=!0,i)){const E=Math.max(C,f),I=Math.min(C+k.nodeSize,h);n.addMark(E,I,s.create({..._.attrs,...t}))}}))}),g&&(m!==void 0&&i&&n.setNodeMarkup(m,void 0,{...g.attrs,...t}),s&&g.marks.length&&g.marks.forEach(k=>{s===k.type&&i&&n.addMark(x,b,s.create({...k.attrs,...t}))}))}),u},lJ=(e,t={})=>({state:n,dispatch:r})=>{const i=Rn(e,n.schema);return jH(i,t)(n,r)},uJ=(e,t={})=>({state:n,dispatch:r})=>{const i=Rn(e,n.schema);return zH(i,t)(n,r)},cJ=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},ud=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},dJ=(e,t)=>{if(Ax(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function zf(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:u}=n;if(u.composing)return!1;const c=u.state.doc.resolve(r);if(c.parent.type.spec.code||(t=c.nodeBefore||c.nodeAfter)!=null&&t.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=zZ(c)+o;return s.forEach(m=>{if(f)return;const g=dJ(h,m.find);if(!g)return;const x=u.state.tr,b=$p({state:u.state,transaction:x}),k={from:r-(g[0].length-o.length),to:i},{commands:C,chain:_,can:E}=new Bp({editor:n,state:b});m.handler({state:b,range:k,match:g,commands:C,chain:_,can:E})===null||!x.steps.length||(m.undoable&&x.setMeta(a,{transform:x,from:r,to:i,text:o}),u.dispatch(x),f=!0)}),f}function fJ(e){const{editor:t,rules:n}=e,r=new yn({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=ld(me.from(f),s.schema);const{from:h}=u,m=h+f.length;zf({editor:t,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return zf({editor:t,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&zf({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?zf({editor:t,from:s.pos,to:s.pos,text:`
1245
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function hJ(e){return Object.prototype.toString.call(e).slice(8,-1)}function Lf(e){return hJ(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function A6(e,t){const n={...e};return Lf(e)&&Lf(t)&&Object.keys(t).forEach(r=>{Lf(t[r])&&Lf(e[r])?n[r]=A6(e[r],t[r]):n[r]=t[r]}),n}var Dx=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Zt(lt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Zt(lt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>A6(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},si=class M6 extends Dx{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new M6(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const u=s.find(c=>(c==null?void 0:c.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function pJ(e){return typeof e=="number"}var mJ=class{constructor(e){this.find=e.find,this.handler=e.handler}},gJ=(e,t,n)=>{if(Ax(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function yJ(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:u,chain:c,can:f}=new Bp({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,x)=>{var b,k,C,_,E;if((k=(b=g.type)==null?void 0:b.spec)!=null&&k.code||!(g.isText||g.isTextblock||g.isInline))return;const I=(E=(_=(C=g.content)==null?void 0:C.size)!=null?_:g.nodeSize)!=null?E:0,N=Math.max(r,x),M=Math.min(i,x+I);if(N>=M)return;const j=g.isText?g.text||"":g.textBetween(N-x,M-x,void 0,"");gJ(j,o.find,s).forEach(R=>{if(R.index===void 0)return;const F=N+R.index+1,ee=F+R[0].length,X={from:n.tr.mapping.map(F),to:n.tr.mapping.map(ee)},Se=o.handler({state:n,range:X,match:R,commands:u,chain:c,can:f,pasteEvent:s,dropEvent:a});h.push(Se)})}),h.every(g=>g!==null)}var Ff=null,xJ=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function bJ(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const u=({state:f,from:h,to:m,rule:g,pasteEvt:x})=>{const b=f.tr,k=$p({state:f,transaction:b});if(!(!yJ({editor:t,state:k,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:x,dropEvent:a})||!b.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(f=>new yn({view(h){const m=x=>{var b;r=(b=h.dom.parentElement)!=null&&b.contains(x.target)?h.dom.parentElement:null,r&&(Ff=t)},g=()=>{Ff&&(Ff=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,a=m,!o){const g=Ff;g!=null&&g.isEditable&&setTimeout(()=>{const x=g.state.selection;x&&g.commands.deleteRange({from:x.from,to:x.to})},10)}return!1},paste:(h,m)=>{var g;const x=(g=m.clipboardData)==null?void 0:g.getData("text/html");return s=m,i=!!(x!=null&&x.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,g)=>{const x=h[0],b=x.getMeta("uiEvent")==="paste"&&!i,k=x.getMeta("uiEvent")==="drop"&&!o,C=x.getMeta("applyPasteRules"),_=!!C;if(!b&&!k&&!_)return;if(_){let{text:N}=C;typeof N=="string"?N=N:N=ld(me.from(N),g.schema);const{from:M}=C,j=M+N.length,O=xJ(N);return u({rule:f,state:g,from:M,to:{b:j},pasteEvt:O})}const E=m.doc.content.findDiffStart(g.doc.content),I=m.doc.content.findDiffEnd(g.doc.content);if(!(!pJ(E)||!I||E===I.b))return u({rule:f,state:g,from:E,to:I,pasteEvt:s})}}))}var Wp=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=v6(e),this.schema=NZ(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Vu(t.name,this.schema)},r=lt(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return gc([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Vu(r.name,this.schema)},o=[],s=lt(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&lt(r,"exitable",i)&&(a.ArrowRight=()=>si.handleExit({editor:e,mark:r})),s){const m=Object.fromEntries(Object.entries(s()).map(([g,x])=>[g,()=>x({editor:e})]));a={...a,...m}}const u=Oq(a);o.push(u);const c=lt(r,"addInputRules",i);if(KC(r,e.options.enableInputRules)&&c){const m=c();if(m&&m.length){const g=fJ({editor:e,rules:m}),x=Array.isArray(g)?g:[g];o.push(...x)}}const f=lt(r,"addPasteRules",i);if(KC(r,e.options.enablePasteRules)&&f){const m=f();if(m&&m.length){const g=bJ({editor:e,rules:m});o.push(...g)}}const h=lt(r,"addProseMirrorPlugins",i);if(h){const m=h();o.push(...m)}return o})}get attributes(){return b6(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Hl(this.extensions);return Object.fromEntries(t.filter(n=>!!lt(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Rn(n.name,this.schema)},o=lt(n,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const a=(u,c,f,h,m)=>{const g=Wl(u,r);return s({node:u,view:c,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:n,HTMLAttributes:g})};return[n.name,a]}))}dispatchTransaction(e){const{editor:t}=this;return gc([...this.extensions].reverse()).reduceRight((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Vu(i.name,this.schema)},s=lt(i,"dispatchTransaction",o);return s?a=>{s.call(o,{transaction:a,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return gc([...this.extensions]).reduce((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Vu(i.name,this.schema)},s=lt(i,"transformPastedHTML",o);return s?(a,u)=>{const c=r(a,u);return s.call(o,c)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Hl(this.extensions);return Object.fromEntries(t.filter(n=>!!lt(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Bo(n.name,this.schema)},o=lt(n,"addMarkView",i);if(!o)return[];const s=(a,u,c)=>{const f=Wl(a,r);return o()({mark:a,view:u,inline:c,editor:e,extension:n,HTMLAttributes:f,updateAttributes:h=>{DJ(a,e,h)}})};return[n.name,s]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Vu(t.name,this.schema)};t.type==="mark"&&((n=Zt(lt(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=lt(t,"onBeforeCreate",r),o=lt(t,"onCreate",r),s=lt(t,"onUpdate",r),a=lt(t,"onSelectionUpdate",r),u=lt(t,"onTransaction",r),c=lt(t,"onFocus",r),f=lt(t,"onBlur",r),h=lt(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};Wp.resolve=v6;Wp.sort=gc;Wp.flatten=Nx;var N6={};Tx(N6,{ClipboardTextSerializer:()=>D6,Commands:()=>O6,Delete:()=>R6,Drop:()=>P6,Editable:()=>j6,FocusEvents:()=>L6,Keymap:()=>F6,Paste:()=>$6,Tabindex:()=>B6,TextDirection:()=>U6,focusEventsPluginKey:()=>z6});var fn=class I6 extends Dx{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new I6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},D6=fn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new yn({key:new jn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),a=Math.max(...o.map(f=>f.$to.pos)),u=w6(n);return k6(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),O6=fn.create({name:"commands",addCommands(){return{...c6}}}),R6=fn.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const o=()=>{var s,a,u,c;if((c=(u=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:u.call(a,e))!=null?c:e.getMeta("y-sync$"))return;const f=y6(e.before,[e,...t]);S6(f).forEach(g=>{f.mapping.mapResult(g.oldRange.from).deletedAfter&&f.mapping.mapResult(g.oldRange.to).deletedBefore&&f.before.nodesBetween(g.oldRange.from,g.oldRange.to,(x,b)=>{const k=b+x.nodeSize-2,C=g.oldRange.from<=b&&k<=g.oldRange.to;this.editor.emit("delete",{type:"node",node:x,from:b,to:k,newFrom:f.mapping.map(b),newTo:f.mapping.map(k),deletedRange:g.oldRange,newRange:g.newRange,partial:!C,editor:this.editor,transaction:e,combinedTransform:f})})});const m=f.mapping;f.steps.forEach((g,x)=>{var b,k;if(g instanceof $i){const C=m.slice(x).map(g.from,-1),_=m.slice(x).map(g.to),E=m.invert().map(C,-1),I=m.invert().map(_),N=(b=f.doc.nodeAt(C-1))==null?void 0:b.marks.some(j=>j.eq(g.mark)),M=(k=f.doc.nodeAt(_))==null?void 0:k.marks.some(j=>j.eq(g.mark));this.editor.emit("delete",{type:"mark",mark:g.mark,from:g.from,to:g.to,deletedRange:{from:E,to:I},newRange:{from:C,to:_},partial:!!(M||N),editor:this.editor,transaction:e,combinedTransform:f})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),P6=fn.create({name:"drop",addProseMirrorPlugins(){return[new yn({key:new jn("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),j6=fn.create({name:"editable",addProseMirrorPlugins(){return[new yn({key:new jn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),z6=new jn("focusEvents"),L6=fn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new yn({key:z6,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),F6=fn.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:u,doc:c}=a,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,x=h.parent.isTextblock&&m>0?a.doc.resolve(m-1):h,b=x.parent.type.spec.isolating,k=h.pos-h.parentOffset,C=b&&x.parent.childCount===1?k===h.pos:Mt.atStart(c).from===m;return!f||!g.type.isTextblock||g.textContent.length||!C||C&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Vc()||m6()?o:i},addProseMirrorPlugins(){return[new yn({key:new jn("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const r=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),i=e.some(b=>b.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=t.selection,u=Mt.atStart(t.doc).from,c=Mt.atEnd(t.doc).to;if(o||!(s===u&&a===c)||!Hp(n.doc))return;const m=n.tr,g=$p({state:n,transaction:m}),{commands:x}=new Bp({editor:this.editor,state:g});if(x.clearNodes(),!!m.steps.length)return m}})]}}),$6=fn.create({name:"paste",addProseMirrorPlugins(){return[new yn({key:new jn("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),B6=fn.create({name:"tabindex",addProseMirrorPlugins(){return[new yn({key:new jn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),U6=fn.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Hl(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new yn({key:new jn("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),vJ=class nc{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new nc(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new nc(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new nc(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(o?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(a);if(!i&&!s&&u.depth<=this.depth)return;const c=new nc(u,this.editor,i,i||s?n:null);i&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const u=s[a];if(o[u]!==n[u])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===t&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},kJ=`.ProseMirror {
1246
- position: relative;
1247
- }
1248
-
1249
- .ProseMirror {
1250
- word-wrap: break-word;
1251
- white-space: pre-wrap;
1252
- white-space: break-spaces;
1253
- -webkit-font-variant-ligatures: none;
1254
- font-variant-ligatures: none;
1255
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
1256
- }
1257
-
1258
- .ProseMirror [contenteditable="false"] {
1259
- white-space: normal;
1260
- }
1261
-
1262
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
1263
- white-space: pre-wrap;
1264
- }
1265
-
1266
- .ProseMirror pre {
1267
- white-space: pre-wrap;
1268
- }
1269
-
1270
- img.ProseMirror-separator {
1271
- display: inline !important;
1272
- border: none !important;
1273
- margin: 0 !important;
1274
- width: 0 !important;
1275
- height: 0 !important;
1276
- }
1277
-
1278
- .ProseMirror-gapcursor {
1279
- display: none;
1280
- pointer-events: none;
1281
- position: absolute;
1282
- margin: 0;
1283
- }
1284
-
1285
- .ProseMirror-gapcursor:after {
1286
- content: "";
1287
- display: block;
1288
- position: absolute;
1289
- top: -2px;
1290
- width: 20px;
1291
- border-top: 1px solid black;
1292
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
1293
- }
1294
-
1295
- @keyframes ProseMirror-cursor-blink {
1296
- to {
1297
- visibility: hidden;
1298
- }
1299
- }
1300
-
1301
- .ProseMirror-hideselection *::selection {
1302
- background: transparent;
1303
- }
1304
-
1305
- .ProseMirror-hideselection *::-moz-selection {
1306
- background: transparent;
1307
- }
1308
-
1309
- .ProseMirror-hideselection * {
1310
- caret-color: transparent;
1311
- }
1312
-
1313
- .ProseMirror-focused .ProseMirror-gapcursor {
1314
- display: block;
1315
- }`;function wJ(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var CJ=class extends cJ{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:BZ,createMappablePosition:UZ},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=h6(t,this.options.autofocus);this.editorState=Tl.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=wJ(kJ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=x6(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[j6,D6.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),O6,L6,F6,B6,P6,$6,R6,U6.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Wp(r,this)}createCommandManager(){this.commandManager=new Bp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=G1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=G1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new l6(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(c=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(c)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=s==null?void 0:s.getMeta("focus"),u=s==null?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),u&&this.emit("blur",{editor:this,event:u.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return C6(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return LZ(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ld(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
1316
-
1317
- `,textSerializers:n={}}=e||{};return DZ(this.state.doc,{blockSeparator:t,textSerializers:{...w6(this.schema),...n}})}get isEmpty(){return Hp(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new vJ(t,this)}get $doc(){return this.$pos(0)}};function ql(e){return new ud({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Zt(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const u=a.search(/\S/),c=n.from+a.indexOf(s),f=c+s.length;if(Ix(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(b=>b===e.type&&b!==g.mark.type)).filter(g=>g.to>c).length)return null;f<n.to&&o.delete(f,n.to),c>n.from&&o.delete(n.from+u,c);const m=n.from+u+s.length;o.addMark(n.from+u,m,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function SJ(e){return new ud({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Zt(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const u=e.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let f=s+c;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,a,u)}else if(r[0]){const c=e.type.isInline?s:s-1;o.insert(c,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})}function Lh(e){return new ud({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Zt(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function Tn(e){return new ud({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const u=o-s;u>0&&(i=r[0].slice(a-u,a)+i,o=s)}t.tr.insertText(i,o,s)},undoable:e.undoable})}function Zl(e){return new ud({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Zt(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),c=u&&dx(u,e.type,o);if(!c)return null;if(s.wrap(u,c),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:g}=e.editor.extensionManager,x=m||h.$to.parentOffset&&h.$from.marks();if(x){const b=x.filter(k=>g.includes(k.type.name));s.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}const f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Zs(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,f))&&s.join(n.from-1)},undoable:e.undoable})}function EJ(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof ut){const o=r.index();return r.parent.canReplaceWith(o,o+1,t)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(t))return!0;i-=1}return!1}var _J={};Tx(_J,{createAtomBlockMarkdownSpec:()=>TJ,createBlockMarkdownSpec:()=>AJ,createInlineMarkdownSpec:()=>IJ,parseAttributes:()=>Ox,parseIndentedBlocks:()=>Q1,renderNestedMarkdownContent:()=>Px,serializeAttributes:()=>Rx});function Ox(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const c=i.map(f=>f.trim().slice(1));t.class=c.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,c,f])=>{var h;const m=parseInt(((h=f.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),g=n[m];g&&(t[c]=g.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(t[f]=!0)}),t}function Rx(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function TJ(e){const{nodeName:t,name:n,parseAttributes:r=Ox,serializeAttributes:i=Rx,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,u=n||t,c=f=>{if(!a)return f;const h={};return a.forEach(m=>{m in f&&(h[m]=f[m])}),h};return{parseMarkdown:(f,h)=>{const m={...o,...f.attributes};return h.createNode(t,m,[])},markdownTokenizer:{name:t,level:"block",start(f){var h;const m=new RegExp(`^:::${u}(?:\\s|$)`,"m"),g=(h=f.match(m))==null?void 0:h.index;return g!==void 0?g:-1},tokenize(f,h,m){const g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),x=f.match(g);if(!x)return;const b=x[1]||"",k=r(b);if(!s.find(_=>!(_ in k)))return{type:t,raw:x[0],attributes:k}}},renderMarkdown:f=>{const h=c(f.attrs||{}),m=i(h),g=m?` {${m}}`:"";return`:::${u}${g} :::`}}}function AJ(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Ox,serializeAttributes:o=Rx,defaultAttributes:s={},content:a="block",allowedAttributes:u}=e,c=n||t,f=h=>{if(!u)return h;const m={};return u.forEach(g=>{g in h&&(m[g]=h[g])}),m};return{parseMarkdown:(h,m)=>{let g;if(r){const b=r(h);g=typeof b=="string"?[{type:"text",text:b}]:b}else a==="block"?g=m.parseChildren(h.tokens||[]):g=m.parseInline(h.tokens||[]);const x={...s,...h.attributes};return m.createNode(t,x,g)},markdownTokenizer:{name:t,level:"block",start(h){var m;const g=new RegExp(`^:::${c}`,"m"),x=(m=h.match(g))==null?void 0:m.index;return x!==void 0?x:-1},tokenize(h,m,g){var x;const b=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),k=h.match(b);if(!k)return;const[C,_=""]=k,E=i(_);let I=1;const N=C.length;let M="";const j=/^:::([\w-]*)(\s.*)?/gm,O=h.slice(N);for(j.lastIndex=0;;){const R=j.exec(O);if(R===null)break;const F=R.index,ee=R[1];if(!((x=R[2])!=null&&x.endsWith(":::"))){if(ee)I+=1;else if(I-=1,I===0){const X=O.slice(0,F);M=X.trim();const Se=h.slice(0,N+F+R[0].length);let ue=[];if(M)if(a==="block")for(ue=g.blockTokens(X),ue.forEach($=>{$.text&&(!$.tokens||$.tokens.length===0)&&($.tokens=g.inlineTokens($.text))});ue.length>0;){const $=ue[ue.length-1];if($.type==="paragraph"&&(!$.text||$.text.trim()===""))ue.pop();else break}else ue=g.inlineTokens(M);return{type:t,raw:Se,attributes:E,content:M,tokens:ue}}}}}},renderMarkdown:(h,m)=>{const g=f(h.attrs||{}),x=o(g),b=x?` {${x}}`:"",k=m.renderChildren(h.content||[],`
1318
-
1319
- `);return`:::${c}${b}
1320
-
1321
- ${k}
1322
-
1323
- :::`}}}function MJ(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function NJ(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function IJ(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=MJ,serializeAttributes:o=NJ,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:u}=e,c=n||t,f=m=>{if(!u)return m;const g={};return u.forEach(x=>{const b=typeof x=="string"?x:x.name,k=typeof x=="string"?void 0:x.skipIfDefault;if(b in m){const C=m[b];if(k!==void 0&&C===k)return;g[b]=C}}),g},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,g)=>{const x={...s,...m.attributes};if(a)return g.createNode(t,x);const b=r?r(m):m.content||"";return b?g.createNode(t,x,[g.createTextNode(b)]):g.createNode(t,x,[])},markdownTokenizer:{name:t,level:"inline",start(m){const g=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),x=m.match(g),b=x==null?void 0:x.index;return b!==void 0?b:-1},tokenize(m,g,x){const b=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),k=m.match(b);if(!k)return;let C="",_="";if(a){const[,I]=k;_=I}else{const[,I,N]=k;_=I,C=N||""}const E=i(_.trim());return{type:t,raw:k[0],content:C.trim(),attributes:E}}},renderMarkdown:m=>{let g="";r?g=r(m):m.content&&m.content.length>0&&(g=m.content.filter(C=>C.type==="text").map(C=>C.text).join(""));const x=f(m.attrs||{}),b=o(x),k=b?` ${b}`:"";return a?`[${c}${k}]`:`[${c}${k}]${g}[/${c}]`}}}function Q1(e,t,n){var r,i,o,s;const a=e.split(`
1324
- `),u=[];let c="",f=0;const h=t.baseIndentSize||2;for(;f<a.length;){const m=a[f],g=m.match(t.itemPattern);if(!g){if(u.length>0)break;if(m.trim()===""){f+=1,c=`${c}${m}
1325
- `;continue}else return}const x=t.extractItemData(g),{indentLevel:b,mainContent:k}=x;c=`${c}${m}
1326
- `;const C=[k];for(f+=1;f<a.length;){const N=a[f];if(N.trim()===""){const j=a.slice(f+1).findIndex(F=>F.trim()!=="");if(j===-1)break;if((((i=(r=a[f+1+j].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>b){C.push(N),c=`${c}${N}
1327
- `,f+=1;continue}else break}if((((s=(o=N.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>b)C.push(N),c=`${c}${N}
1328
- `,f+=1;else break}let _;const E=C.slice(1);if(E.length>0){const N=E.map(M=>M.slice(b+h)).join(`
1329
- `);N.trim()&&(t.customNestedParser?_=t.customNestedParser(N):_=n.blockTokens(N))}const I=t.createToken(x,_);u.push(I)}if(u.length!==0)return{items:u,raw:c}}function Px(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),u=[`${i}${a}`];return s&&s.length>0&&s.forEach(c=>{const f=t.renderChildren([c]);if(f){const h=f.split(`
1330
- `).map(m=>m?t.indent(m):"").join(`
1331
- `);u.push(h)}}),u.join(`
1332
- `)}function DJ(e,t,n={}){const{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((a,u)=>{const c=o.mapping.map(u),f=o.mapping.map(u)+a.nodeSize;let h=null;if(a.marks.forEach(g=>{if(g!==s)return!1;h=g}),!h)return;let m=!1;if(Object.keys(n).forEach(g=>{n[g]!==h.attrs[g]&&(m=!0)}),m){const g=e.type.create({...e.attrs,...n});o.removeMark(c,f,e.type),o.addMark(c,f,g)}}),o.docChanged&&t.view.dispatch(o)}var Kt=class V6 extends Dx{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new V6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},OJ=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:u}=this.editor,c=e.target,f=c.nodeType===3?(t=c.parentElement)==null?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(c)||!f)return;let h=0,m=0;if(this.dom!==f){const _=this.dom.getBoundingClientRect(),E=f.getBoundingClientRect(),I=(i=e.offsetX)!=null?i:(r=e.nativeEvent)==null?void 0:r.offsetX,N=(s=e.offsetY)!=null?s:(o=e.nativeEvent)==null?void 0:o.offsetY;h=E.x-_.x+I,m=E.y-_.y+N}const g=this.dom.cloneNode(!0);try{const _=this.dom.getBoundingClientRect();g.style.width=`${Math.round(_.width)}px`,g.style.height=`${Math.round(_.height)}px`,g.style.boxSizing="border-box",g.style.pointerEvents="none"}catch{}let x=null;try{x=document.createElement("div"),x.style.position="absolute",x.style.top="-9999px",x.style.left="-9999px",x.style.pointerEvents="none",x.appendChild(g),document.body.appendChild(x),(a=e.dataTransfer)==null||a.setDragImage(g,h,m)}finally{x&&setTimeout(()=>{try{x==null||x.remove()}catch{}},0)}const b=this.getPos();if(typeof b!="number")return;const k=ut.create(u.state.doc,b),C=u.state.tr.setSelection(k);u.dispatch(C)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const i=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=ut.isSelectable(this.node),h=e.type==="copy",m=e.type==="paste",g=e.type==="cut",x=e.type==="mousedown";if(!c&&f&&i&&e.target===this.dom&&e.preventDefault(),c&&i&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(c&&a&&!u&&x){const b=n.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||h||m||g||x&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Vc()||K1())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Pa(e){return new mJ({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Zt(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,a=r[r.length-1],u=r[0];let c=n.to;if(a){const f=u.search(/\S/),h=n.from+u.indexOf(a),m=h+a.length;if(Ix(n.from,n.to,t.doc).filter(x=>x.mark.type.excluded.find(k=>k===e.type&&k!==x.mark.type)).filter(x=>x.to>h).length)return null;m<n.to&&s.delete(m,n.to),h>n.from&&s.delete(n.from+f,h),c=n.from+f+a.length,s.addMark(n.from+f,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:RJ,getOwnPropertySymbols:PJ}=Object,{hasOwnProperty:jJ}=Object.prototype;function Ig(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function $f(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);const u=e(n,r,i);return o.delete(n),o.delete(r),u}}function zJ(e){return e!=null?e[Symbol.toStringTag]:void 0}function QC(e){return RJ(e).concat(PJ(e))}const LJ=Object.hasOwn||((e,t)=>jJ.call(e,t));function Ua(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const FJ="__v",$J="__o",BJ="_owner",{getOwnPropertyDescriptor:XC,keys:eS}=Object;function UJ(e,t){return e.byteLength===t.byteLength&&Fh(new Uint8Array(e),new Uint8Array(t))}function VJ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function HJ(e,t){return e.byteLength===t.byteLength&&Fh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function WJ(e,t){return Ua(e.getTime(),t.getTime())}function qJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function ZJ(e,t){return e===t}function tS(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,a,u=0;for(;(s=o.next())&&!s.done;){const c=t.entries();let f=!1,h=0;for(;(a=c.next())&&!a.done;){if(i[h]){h++;continue}const m=s.value,g=a.value;if(n.equals(m[0],g[0],u,h,e,t,n)&&n.equals(m[1],g[1],m[0],g[0],e,t,n)){f=i[h]=!0;break}h++}if(!f)return!1;u++}return!0}const JJ=Ua;function KJ(e,t,n){const r=eS(e);let i=r.length;if(eS(t).length!==i)return!1;for(;i-- >0;)if(!H6(e,t,n,r[i]))return!1;return!0}function Hu(e,t,n){const r=QC(e);let i=r.length;if(QC(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!H6(e,t,n,o)||(s=XC(e,o),a=XC(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function GJ(e,t){return Ua(e.valueOf(),t.valueOf())}function YJ(e,t){return e.source===t.source&&e.flags===t.flags}function nS(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,a;for(;(s=o.next())&&!s.done;){const u=t.values();let c=!1,f=0;for(;(a=u.next())&&!a.done;){if(!i[f]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){c=i[f]=!0;break}f++}if(!c)return!1}return!0}function Fh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function QJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function H6(e,t,n,r){return(r===BJ||r===$J||r===FJ)&&(e.$$typeof||t.$$typeof)?!0:LJ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const XJ="[object ArrayBuffer]",eK="[object Arguments]",tK="[object Boolean]",nK="[object DataView]",rK="[object Date]",iK="[object Error]",oK="[object Map]",sK="[object Number]",aK="[object Object]",lK="[object RegExp]",uK="[object Set]",cK="[object String]",dK={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},fK="[object URL]",hK=Object.prototype.toString;function pK({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:u,arePrimitiveWrappersEqual:c,areRegExpsEqual:f,areSetsEqual:h,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:x}){return function(k,C,_){if(k===C)return!0;if(k==null||C==null)return!1;const E=typeof k;if(E!==typeof C)return!1;if(E!=="object")return E==="number"?a(k,C,_):E==="function"?o(k,C,_):!1;const I=k.constructor;if(I!==C.constructor)return!1;if(I===Object)return u(k,C,_);if(Array.isArray(k))return t(k,C,_);if(I===Date)return r(k,C,_);if(I===RegExp)return f(k,C,_);if(I===Map)return s(k,C,_);if(I===Set)return h(k,C,_);const N=hK.call(k);if(N===rK)return r(k,C,_);if(N===lK)return f(k,C,_);if(N===oK)return s(k,C,_);if(N===uK)return h(k,C,_);if(N===aK)return typeof k.then!="function"&&typeof C.then!="function"&&u(k,C,_);if(N===fK)return g(k,C,_);if(N===iK)return i(k,C,_);if(N===eK)return u(k,C,_);if(dK[N])return m(k,C,_);if(N===XJ)return e(k,C,_);if(N===nK)return n(k,C,_);if(N===tK||N===sK||N===cK)return c(k,C,_);if(x){let M=x[N];if(!M){const j=zJ(k);j&&(M=x[j])}if(M)return M(k,C,_)}return!1}}function mK({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:UJ,areArraysEqual:n?Hu:VJ,areDataViewsEqual:HJ,areDatesEqual:WJ,areErrorsEqual:qJ,areFunctionsEqual:ZJ,areMapsEqual:n?Ig(tS,Hu):tS,areNumbersEqual:JJ,areObjectsEqual:n?Hu:KJ,arePrimitiveWrappersEqual:GJ,areRegExpsEqual:YJ,areSetsEqual:n?Ig(nS,Hu):nS,areTypedArraysEqual:n?Ig(Fh,Hu):Fh,areUrlsEqual:QJ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=$f(r.areArraysEqual),o=$f(r.areMapsEqual),s=$f(r.areObjectsEqual),a=$f(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function gK(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function yK({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,u){const{cache:c=e?new WeakMap:void 0,meta:f}=n();return t(a,u,{cache:c,equals:r,meta:f,strict:i})};if(e)return function(a,u){return t(a,u,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,u){return t(a,u,o)}}const xK=Ks();Ks({strict:!0});Ks({circular:!0});Ks({circular:!0,strict:!0});Ks({createInternalComparator:()=>Ua});Ks({strict:!0,createInternalComparator:()=>Ua});Ks({circular:!0,createInternalComparator:()=>Ua});Ks({circular:!0,createInternalComparator:()=>Ua,strict:!0});function Ks(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=mK(e),s=pK(o),a=n?n(s):gK(s);return yK({circular:t,comparator:s,createState:r,equals:a,strict:i})}var Dg={exports:{}},Og={};/**
1333
- * @license React
1334
- * use-sync-external-store-shim/with-selector.production.js
1335
- *
1336
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1337
- *
1338
- * This source code is licensed under the MIT license found in the
1339
- * LICENSE file in the root directory of this source tree.
1340
- */var rS;function bK(){if(rS)return Og;rS=1;var e=Yc(),t=p_();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Og.useSyncExternalStoreWithSelector=function(c,f,h,m,g){var x=o(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=a(function(){function C(M){if(!_){if(_=!0,E=M,M=m(M),g!==void 0&&b.hasValue){var j=b.value;if(g(j,M))return I=j}return I=M}if(j=I,r(E,M))return j;var O=m(M);return g!==void 0&&g(j,O)?(E=M,j):(E=M,I=O)}var _=!1,E,I,N=h===void 0?null:h;return[function(){return C(f())},N===null?void 0:function(){return C(N())}]},[f,h,m,g]);var k=i(c,x[0],x[1]);return s(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},Og}var iS;function vK(){return iS||(iS=1,Dg.exports=bK()),Dg.exports}var kK=vK(),wK=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},CK=({contentComponent:e})=>{const t=Ay.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return v.jsx(v.Fragment,{children:Object.values(t)})};function SK(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:rj.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var EK=class extends zo.Component{constructor(e){var t;super(e),this.editorContentRef=zo.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=SK(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:wK(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&v.jsx(CK,{contentComponent:e.contentComponent})]})}},_K=T.forwardRef((e,t)=>{const n=zo.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return zo.createElement(EK,{key:n,innerRef:t,...e})}),W6=zo.memo(_K),TK=typeof window<"u"?T.useLayoutEffect:T.useEffect,AK=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function MK(e){var t;const[n]=T.useState(()=>new AK(e.editor)),r=kK.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:xK);return TK(()=>n.watch(e.editor),[e.editor,n]),T.useDebugValue(r),r}var NK=!1,X1=typeof window>"u",IK=X1||!!(typeof window<"u"&&window.next),DK=class q6{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?X1||IK?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return(o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new CJ(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?q6.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function OK(e={},t=[]){const n=T.useRef(e);n.current=e;const[r]=T.useState(()=>new DK(n)),i=Ay.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return T.useDebugValue(i),T.useEffect(r.onRender(t)),MK({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var Z6=T.createContext({editor:null});Z6.Consumer;var J6=T.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),K6=()=>T.useContext(J6);function RK({as:e="div",...t}){const{nodeViewContentRef:n,nodeViewContentChildren:r}=K6();return v.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})}var PK=zo.forwardRef((e,t)=>{const{onDragStart:n}=K6(),r=e.as||"div";return v.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function oS(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function sS(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function jK(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function zK(e){if(oS(e)||sS(e))return!0;if(jK(e)){const t=e.type;if(t)return oS(t)||sS(t)}return!1}function LK(){try{if(T.version)return parseInt(T.version.split(".")[0],10)>=19}catch{}return!1}var FK=class{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Dy.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,n=this.props,r=this.editor,i=LK(),o=zK(t),s={...n};s.ref&&!(i||o)&&delete s.ref,!s.ref&&(i||o)&&(s.ref=a=>{this.ref=a}),this.reactElement=v.jsx(t,{...s}),(e=r==null?void 0:r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;(e=t==null?void 0:t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};zo.createContext({markViewContentRef:()=>{}});var $K=class extends OJ{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){var o;return r==="storage"?(o=e.storage[t.name])!=null?o:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(u={})=>this.updateAttributes(u),deleteNode:()=>this.deleteNode(),ref:T.createRef()};if(!this.component.displayName){const u=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=u(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&(u.hasAttribute("data-node-view-wrapper")&&u.removeAttribute("data-node-view-wrapper"),u.appendChild(this.contentDOMElement))}},i=this.component,o=T.memo(u=>v.jsx(J6.Provider,{value:r,children:T.createElement(i,u)}));o.displayName="ReactNodeView";let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new FK(o,{editor:this.editor,props:e,as:s,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)!=null&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n=="number")if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){const r=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}return e===this.node&&this.decorations===t&&this.innerDecorations===n||(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,n=Wl(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function BK(e,t){return n=>n.editor.contentComponent?new $K(e,n,t):{}}var jx=T.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});jx.displayName="TiptapContext";var UK=()=>T.useContext(jx);function G6({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=T.useMemo(()=>({editor:r}),[r]),o=T.useMemo(()=>({editor:r}),[r]);return v.jsx(Z6.Provider,{value:o,children:v.jsx(jx.Provider,{value:i,children:n})})}G6.displayName="Tiptap";function Y6({...e}){const{editor:t}=UK();return v.jsx(W6,{editor:t,...e})}Y6.displayName="Tiptap.Content";Object.assign(G6,{Content:Y6});var $h=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},VK=/^\s*>\s$/,HK=Kt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return $h("blockquote",{...Pn(this.options.HTMLAttributes,e),children:$h("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach(i=>{const a=t.renderChildren([i]).split(`
1341
- `).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(a.join(`
1342
- `))}),r.join(`
1343
- ${n}
1344
- `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Zl({find:VK,type:this.type})]}}),WK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,qK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ZK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,JK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,KK=si.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return $h("strong",{...Pn(this.options.HTMLAttributes,e),children:$h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ql({find:WK,type:this.type}),ql({find:ZK,type:this.type})]},addPasteRules(){return[Pa({find:qK,type:this.type}),Pa({find:JK,type:this.type})]}}),GK=/(^|[^`])`([^`]+)`(?!`)$/,YK=/(^|[^`])`([^`]+)`(?!`)/g,QK=si.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Pn(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ql({find:GK,type:this.type})]},addPasteRules(){return[Pa({find:YK,type:this.type})]}}),Rg=4,XK=/^```([a-z]+)?[\s\n]$/,eG=/^~~~([a-z]+)?[\s\n]$/,tG=Kt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Rg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Pn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
1345
- `):r=`\`\`\`${i}
1346
-
1347
- \`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:Rg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:u})=>{const{from:c,to:f}=i,g=r.doc.textBetween(c,f,`
1348
- `,`
1349
- `).split(`
1350
- `).map(x=>a+x).join(`
1351
- `);return u.replaceWith(c,f,r.schema.text(g)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:Rg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?e.commands.command(({tr:a})=>{var u;const{pos:c}=o,f=o.start(),h=o.end(),g=r.doc.textBetween(f,h,`
1352
- `,`
1353
- `).split(`
1354
- `);let x=0,b=0;const k=c-f;for(let M=0;M<g.length;M+=1){if(b+g[M].length>=k){x=M;break}b+=g[M].length+1}const _=((u=g[x].match(/^ */))==null?void 0:u[0])||"",E=Math.min(_.length,n);if(E===0)return!0;let I=f;for(let M=0;M<x;M+=1)I+=g[M].length+1;return a.delete(I,I+E),c-I<=E&&a.setSelection(yt.create(a.doc,I)),!0}):e.commands.command(({tr:a})=>{const{from:u,to:c}=i,m=r.doc.textBetween(u,c,`
1355
- `,`
1356
- `).split(`
1357
- `).map(g=>{var x;const b=((x=g.match(/^ */))==null?void 0:x[0])||"",k=Math.min(b.length,n);return g.slice(k)}).join(`
1358
- `);return a.replaceWith(u,c,r.schema.text(m)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
1359
-
1360
- `);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:c})=>(c.setSelection(Mt.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[Lh({find:XK,type:this.type,getAttributes:e=>({language:e[1]})}),Lh({find:eG,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new yn({key:new jn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,u=a.text(n.replace(/\r\n?/g,`
1361
- `));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(yt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),nG=Kt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1362
-
1363
- `):""}),rG=Kt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Pn(this.options.HTMLAttributes,e)]},renderText(){return`
1364
- `},renderMarkdown:()=>`
1365
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&s){const h=u.filter(m=>a.includes(m.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iG=Kt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Pn(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Lh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),oG=Kt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Pn(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!EJ(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return E6(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:a})=>{if(a){const{$to:u}=s.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(yt.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(ut.create(s.doc,u.pos)):s.setSelection(yt.create(s.doc,u.pos));else{const f=o.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,h=f==null?void 0:f.create();h&&(s.insert(c,h),s.setSelection(yt.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[SJ({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sG=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aG=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lG=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uG=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,cG=si.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Pn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ql({find:sG,type:this.type}),ql({find:lG,type:this.type})]},addPasteRules(){return[Pa({find:aG,type:this.type}),Pa({find:uG,type:this.type})]}});const dG="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",fG="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ey="numeric",ty="ascii",ny="alpha",yc="asciinumeric",rc="alphanumeric",ry="domain",Q6="emoji",hG="scheme",pG="slashscheme",Pg="whitespace";function mG(e,t){return e in t||(t[e]=[]),t[e]}function ka(e,t,n){t[ey]&&(t[yc]=!0,t[rc]=!0),t[ty]&&(t[yc]=!0,t[ny]=!0),t[yc]&&(t[rc]=!0),t[ny]&&(t[rc]=!0),t[rc]&&(t[ry]=!0),t[Q6]&&(t[ry]=!0);for(const r in t){const i=mG(r,n);i.indexOf(e)<0&&i.push(e)}}function gG(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Br(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Br.groups={};Br.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],o=t.jr[r][1];if(o&&i.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||Br.groups;let i;return t&&t.j?i=t:(i=new Br(t),n&&r&&ka(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const o=e.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(e[s]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){r=r||Br.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let s,a=i.go(e);if(a?(s=new Br,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Br,o){if(r)if(s.t&&typeof s.t=="string"){const u=Object.assign(gG(s.t,r),n);ka(o,u,r)}else n&&ka(o,n,r);s.t=o}return i.j[e]=s,s}};const At=(e,t,n,r,i)=>e.ta(t,n,r,i),En=(e,t,n,r,i)=>e.tr(t,n,r,i),aS=(e,t,n,r,i)=>e.ts(t,n,r,i),ve=(e,t,n,r,i)=>e.tt(t,n,r,i),No="WORD",iy="UWORD",X6="ASCIINUMERICAL",eA="ALPHANUMERICAL",Wc="LOCALHOST",oy="TLD",sy="UTLD",th="SCHEME",_l="SLASH_SCHEME",zx="NUM",ay="WS",Lx="NL",xc="OPENBRACE",bc="CLOSEBRACE",Bh="OPENBRACKET",Uh="CLOSEBRACKET",Vh="OPENPAREN",Hh="CLOSEPAREN",Wh="OPENANGLEBRACKET",qh="CLOSEANGLEBRACKET",Zh="FULLWIDTHLEFTPAREN",Jh="FULLWIDTHRIGHTPAREN",Kh="LEFTCORNERBRACKET",Gh="RIGHTCORNERBRACKET",Yh="LEFTWHITECORNERBRACKET",Qh="RIGHTWHITECORNERBRACKET",Xh="FULLWIDTHLESSTHAN",ep="FULLWIDTHGREATERTHAN",tp="AMPERSAND",np="APOSTROPHE",rp="ASTERISK",xs="AT",ip="BACKSLASH",op="BACKTICK",sp="CARET",Cs="COLON",Fx="COMMA",ap="DOLLAR",Gi="DOT",lp="EQUALS",$x="EXCLAMATION",yi="HYPHEN",vc="PERCENT",up="PIPE",cp="PLUS",dp="POUND",kc="QUERY",Bx="QUOTE",tA="FULLWIDTHMIDDLEDOT",Ux="SEMI",Yi="SLASH",wc="TILDE",fp="UNDERSCORE",nA="EMOJI",hp="SYM";var rA=Object.freeze({__proto__:null,ALPHANUMERICAL:eA,AMPERSAND:tp,APOSTROPHE:np,ASCIINUMERICAL:X6,ASTERISK:rp,AT:xs,BACKSLASH:ip,BACKTICK:op,CARET:sp,CLOSEANGLEBRACKET:qh,CLOSEBRACE:bc,CLOSEBRACKET:Uh,CLOSEPAREN:Hh,COLON:Cs,COMMA:Fx,DOLLAR:ap,DOT:Gi,EMOJI:nA,EQUALS:lp,EXCLAMATION:$x,FULLWIDTHGREATERTHAN:ep,FULLWIDTHLEFTPAREN:Zh,FULLWIDTHLESSTHAN:Xh,FULLWIDTHMIDDLEDOT:tA,FULLWIDTHRIGHTPAREN:Jh,HYPHEN:yi,LEFTCORNERBRACKET:Kh,LEFTWHITECORNERBRACKET:Yh,LOCALHOST:Wc,NL:Lx,NUM:zx,OPENANGLEBRACKET:Wh,OPENBRACE:xc,OPENBRACKET:Bh,OPENPAREN:Vh,PERCENT:vc,PIPE:up,PLUS:cp,POUND:dp,QUERY:kc,QUOTE:Bx,RIGHTCORNERBRACKET:Gh,RIGHTWHITECORNERBRACKET:Qh,SCHEME:th,SEMI:Ux,SLASH:Yi,SLASH_SCHEME:_l,SYM:hp,TILDE:wc,TLD:oy,UNDERSCORE:fp,UTLD:sy,UWORD:iy,WORD:No,WS:ay});const Ao=/[a-z]/,Wu=new RegExp("\\p{L}","u"),jg=new RegExp("\\p{Emoji}","u"),Mo=/\d/,zg=/\s/,lS="\r",Lg=`
1366
- `,yG="️",xG="‍",Fg="";let Bf=null,Uf=null;function bG(e=[]){const t={};Br.groups=t;const n=new Br;Bf==null&&(Bf=uS(dG)),Uf==null&&(Uf=uS(fG)),ve(n,"'",np),ve(n,"{",xc),ve(n,"}",bc),ve(n,"[",Bh),ve(n,"]",Uh),ve(n,"(",Vh),ve(n,")",Hh),ve(n,"<",Wh),ve(n,">",qh),ve(n,"(",Zh),ve(n,")",Jh),ve(n,"「",Kh),ve(n,"」",Gh),ve(n,"『",Yh),ve(n,"』",Qh),ve(n,"<",Xh),ve(n,">",ep),ve(n,"&",tp),ve(n,"*",rp),ve(n,"@",xs),ve(n,"`",op),ve(n,"^",sp),ve(n,":",Cs),ve(n,",",Fx),ve(n,"$",ap),ve(n,".",Gi),ve(n,"=",lp),ve(n,"!",$x),ve(n,"-",yi),ve(n,"%",vc),ve(n,"|",up),ve(n,"+",cp),ve(n,"#",dp),ve(n,"?",kc),ve(n,'"',Bx),ve(n,"/",Yi),ve(n,";",Ux),ve(n,"~",wc),ve(n,"_",fp),ve(n,"\\",ip),ve(n,"・",tA);const r=En(n,Mo,zx,{[ey]:!0});En(r,Mo,r);const i=En(r,Ao,X6,{[yc]:!0}),o=En(r,Wu,eA,{[rc]:!0}),s=En(n,Ao,No,{[ty]:!0});En(s,Mo,i),En(s,Ao,s),En(i,Mo,i),En(i,Ao,i);const a=En(n,Wu,iy,{[ny]:!0});En(a,Ao),En(a,Mo,o),En(a,Wu,a),En(o,Mo,o),En(o,Ao),En(o,Wu,o);const u=ve(n,Lg,Lx,{[Pg]:!0}),c=ve(n,lS,ay,{[Pg]:!0}),f=En(n,zg,ay,{[Pg]:!0});ve(n,Fg,f),ve(c,Lg,u),ve(c,Fg,f),En(c,zg,f),ve(f,lS),ve(f,Lg),En(f,zg,f),ve(f,Fg,f);const h=En(n,jg,nA,{[Q6]:!0});ve(h,"#"),En(h,jg,h),ve(h,yG,h);const m=ve(h,xG);ve(m,"#"),En(m,jg,h);const g=[[Ao,s],[Mo,i]],x=[[Ao,null],[Wu,a],[Mo,o]];for(let b=0;b<Bf.length;b++)fs(n,Bf[b],oy,No,g);for(let b=0;b<Uf.length;b++)fs(n,Uf[b],sy,iy,x);ka(oy,{tld:!0,ascii:!0},t),ka(sy,{utld:!0,alpha:!0},t),fs(n,"file",th,No,g),fs(n,"mailto",th,No,g),fs(n,"http",_l,No,g),fs(n,"https",_l,No,g),fs(n,"ftp",_l,No,g),fs(n,"ftps",_l,No,g),ka(th,{scheme:!0,ascii:!0},t),ka(_l,{slashscheme:!0,ascii:!0},t),e=e.sort((b,k)=>b[0]>k[0]?1:-1);for(let b=0;b<e.length;b++){const k=e[b][0],_=e[b][1]?{[hG]:!0}:{[pG]:!0};k.indexOf("-")>=0?_[ry]=!0:Ao.test(k)?Mo.test(k)?_[yc]=!0:_[ty]=!0:_[ey]=!0,aS(n,k,k,_)}return aS(n,"localhost",Wc,{ascii:!0}),n.jd=new Br(hp),{start:n,tokens:Object.assign({groups:t},rA)}}function iA(e,t){const n=vG(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,u=null,c=0,f=null,h=-1,m=-1;for(;s<r&&(u=a.go(n[s]));)a=u,a.accepts()?(h=0,m=0,f=a):h>=0&&(h+=n[s].length,m++),c+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,c-=h,i.push({t:f.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function vG(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function fs(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const u=t[a];e.j[u]?o=e.j[u]:(o=new Br(r),o.jr=i.slice(),e.j[u]=o),e=o}return o=new Br(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function uS(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const qc={defaultProtocol:"http",events:null,format:cS,formatHref:cS,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Vx(e,t=null){let n=Object.assign({},qc);e&&(n=Object.assign(n,e instanceof Vx?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Vx.prototype={o:qc,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:qc[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function cS(e){return e}function oA(e,t){this.t="token",this.v=e,this.tk=t}oA.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=qc.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),u=e.get("target",n,t),c=e.get("rel",n,t),f=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),u&&(s.target=u),c&&(s.rel=c),f&&Object.assign(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function qp(e,t){class n extends oA{constructor(i,o){super(i,o),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const dS=qp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),fS=qp("text"),kG=qp("nl"),Vf=qp("url",{isLink:!0,toHref(e=qc.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Wc&&e[1].t===Cs}}),mi=e=>new Br(e);function wG({groups:e}){const t=e.domain.concat([tp,rp,xs,ip,op,sp,ap,lp,yi,zx,vc,up,cp,dp,Yi,hp,wc,fp]),n=[np,Cs,Fx,Gi,$x,vc,kc,Bx,Ux,Wh,qh,xc,bc,Uh,Bh,Vh,Hh,Zh,Jh,Kh,Gh,Yh,Qh,Xh,ep],r=[tp,np,rp,ip,op,sp,ap,lp,yi,xc,bc,vc,up,cp,dp,kc,Yi,hp,wc,fp],i=mi(),o=ve(i,wc);At(o,r,o),At(o,e.domain,o);const s=mi(),a=mi(),u=mi();At(i,e.domain,s),At(i,e.scheme,a),At(i,e.slashscheme,u),At(s,r,o),At(s,e.domain,s);const c=ve(s,xs);ve(o,xs,c),ve(a,xs,c),ve(u,xs,c);const f=ve(o,Gi);At(f,r,o),At(f,e.domain,o);const h=mi();At(c,e.domain,h),At(h,e.domain,h);const m=ve(h,Gi);At(m,e.domain,h);const g=mi(dS);At(m,e.tld,g),At(m,e.utld,g),ve(c,Wc,g);const x=ve(h,yi);ve(x,yi,x),At(x,e.domain,h),At(g,e.domain,h),ve(g,Gi,m),ve(g,yi,x);const b=ve(g,Cs);At(b,e.numeric,dS);const k=ve(s,yi),C=ve(s,Gi);ve(k,yi,k),At(k,e.domain,s),At(C,r,o),At(C,e.domain,s);const _=mi(Vf);At(C,e.tld,_),At(C,e.utld,_),At(_,e.domain,s),At(_,r,o),ve(_,Gi,C),ve(_,yi,k),ve(_,xs,c);const E=ve(_,Cs),I=mi(Vf);At(E,e.numeric,I);const N=mi(Vf),M=mi();At(N,t,N),At(N,n,M),At(M,t,N),At(M,n,M),ve(_,Yi,N),ve(I,Yi,N);const j=ve(a,Cs),O=ve(u,Cs),R=ve(O,Yi),F=ve(R,Yi);At(a,e.domain,s),ve(a,Gi,C),ve(a,yi,k),At(u,e.domain,s),ve(u,Gi,C),ve(u,yi,k),At(j,e.domain,N),ve(j,Yi,N),ve(j,kc,N),At(F,e.domain,N),At(F,t,N),ve(F,Yi,N);const ee=[[xc,bc],[Bh,Uh],[Vh,Hh],[Wh,qh],[Zh,Jh],[Kh,Gh],[Yh,Qh],[Xh,ep]];for(let X=0;X<ee.length;X++){const[Se,ue]=ee[X],$=ve(N,Se);ve(M,Se,$),ve($,ue,N);const Q=mi(Vf);At($,t,Q);const he=mi();At($,n),At(Q,t,Q),At(Q,n,he),At(he,t,Q),At(he,n,he),ve(Q,ue,N),ve(he,ue,N)}return ve(i,Wc,_),ve(i,Lx,kG),{start:i,tokens:rA}}function CG(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,u=null,c=null,f=0,h=null,m=-1;for(;i<r&&!(u=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=u||a.go(n[i].t));)u=null,a=c,a.accepts()?(m=0,h=a):m>=0&&m++,i++,f++;if(m<0)i-=f,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push($g(fS,t,s)),s=[]),i-=m,f-=m;const g=h.t,x=n.slice(i-f,i);o.push($g(g,t,x))}}return s.length>0&&o.push($g(fS,t,s)),o}function $g(e,t,n){const r=n[0].s,i=n[n.length-1].e,o=t.slice(r,i);return new e(o,n)}const SG=typeof console<"u"&&console&&console.warn||(()=>{}),EG="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",dn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function _G(){return Br.groups={},dn.scanner=null,dn.parser=null,dn.tokenQueue=[],dn.pluginQueue=[],dn.customSchemes=[],dn.initialized=!1,dn}function hS(e,t=!1){if(dn.initialized&&SG(`linkifyjs: already initialized - will not register custom scheme "${e}" ${EG}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1367
- 1. Must only contain digits, lowercase ASCII letters or "-"
1368
- 2. Cannot start or end with "-"
1369
- 3. "-" cannot repeat`);dn.customSchemes.push([e,t])}function TG(){dn.scanner=bG(dn.customSchemes);for(let e=0;e<dn.tokenQueue.length;e++)dn.tokenQueue[e][1]({scanner:dn.scanner});dn.parser=wG(dn.scanner.tokens);for(let e=0;e<dn.pluginQueue.length;e++)dn.pluginQueue[e][1]({scanner:dn.scanner,parser:dn.parser});return dn.initialized=!0,dn}function Hx(e){return dn.initialized||TG(),CG(dn.parser.start,e,iA(dn.scanner.start,e))}Hx.scan=iA;function sA(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Vx(n),i=Hx(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}var Wx="[\0-   ᠎ -\u2029  ]",AG=new RegExp(Wx),MG=new RegExp(`${Wx}$`),NG=new RegExp(Wx,"g");function IG(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function DG(e){return new yn({key:new jn("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=t.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=y6(n.doc,[...t]);if(S6(a).forEach(({newRange:c})=>{const f=_Z(r.doc,c,g=>g.isTextblock);let h,m;if(f.length>1)h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(f.length){const g=r.doc.textBetween(c.from,c.to," "," ");if(!MG.test(g))return;h=f[0],m=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&m){const g=m.split(AG).filter(Boolean);if(g.length<=0)return!1;const x=g[g.length-1],b=h.pos+m.lastIndexOf(x);if(!x)return!1;const k=Hx(x).map(C=>C.toObject(e.defaultProtocol));if(!IG(k))return!1;k.filter(C=>C.isLink).map(C=>({...C,from:b+C.start+1,to:b+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>e.validate(C.value)).filter(C=>e.shouldAutoLink(C.value)).forEach(C=>{Ix(C.from,C.to,r.doc).some(_=>_.mark.type===e.type)||s.addMark(C.from,C.to,e.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function OG(e){return new yn({key:new jn("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const u=r.target;if(!u)return!1;const c=e.editor.view.dom;s=u.closest("a"),s&&!c.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const u=C6(t.state,e.type.name),c=(i=s.href)!=null?i:u.href,f=(o=s.target)!=null?o:u.target;c&&(window.open(c,f),a=!0)}return a}}})}function RG(e){return new yn({key:new jn("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:o}=t,{selection:s}=o,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(f=>{u+=f.textContent});const c=sA(u,{defaultProtocol:e.defaultProtocol}).find(f=>f.isLink&&f.value===u);return!u||!c||i!==void 0&&!i(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function pa(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(NG,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var PG=si.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){hS(e);return}hS(e.scheme,e.optionalSlashes)})},onDestroy(){_G()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!pa(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!pa(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!pa(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Pn(this.options.HTMLAttributes,e),0]:["a",Pn(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;const s=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",a=(o=(i=e.attrs)==null?void 0:i.title)!=null?o:"",u=t.renderChildren(e);return a?`[${u}](${s} "${a}")`:`[${u}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!pa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!pa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Pa({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=sA(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!pa(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&t.push({text:o.value,data:{href:o.href},index:o.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(DG({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!pa(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(OG({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(RG({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),jG=Object.defineProperty,zG=(e,t)=>{for(var n in t)jG(e,n,{get:t[n],enumerable:!0})},LG="listItem",pS="textStyle",mS=/^\s*([-+*])\s$/,aA=Kt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Pn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1370
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(LG,this.editor.getAttributes(pS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Zl({find:mS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Zl({find:mS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pS),editor:this.editor})),[e]}}),lA=Kt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Pn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))n=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const s=e.tokens.slice(1),a=t.parseChildren(s);n.push(...a)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>Px(e,t,r=>{var i,o;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((o=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:o.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),FG={};zG(FG,{findListItemPos:()=>cd,getNextListDepth:()=>qx,handleBackspace:()=>ly,handleDelete:()=>uy,hasListBefore:()=>uA,hasListItemAfter:()=>$G,hasListItemBefore:()=>cA,listItemHasSubList:()=>dA,nextListIsDeeper:()=>fA,nextListIsHigher:()=>hA});var cd=(e,t)=>{const{$from:n}=t.selection,r=Rn(e,t.schema);let i=null,o=n.depth,s=n.pos,a=null;for(;o>0&&a===null;)i=n.node(o),i.type===r?a=o:(o-=1,s-=1);return a===null?null:{$pos:t.doc.resolve(s),depth:a}},qx=(e,t)=>{const n=cd(e,t);if(!n)return!1;const[,r]=jZ(t,e,n.$pos.pos+4);return r},uA=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},cA=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},dA=(e,t,n)=>{if(!n)return!1;const r=Rn(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},ly=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Bs(e.state,t)&&uA(e.state,t,n)){const{$anchor:a}=e.state.selection,u=e.state.doc.resolve(a.before()-1),c=[];u.node().descendants((m,g)=>{m.type.name===t&&c.push({node:m,pos:g})});const f=c.at(-1);if(!f)return!1;const h=e.state.doc.resolve(u.start()+f.pos+1);return e.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Bs(e.state,t)||!$Z(e.state))return!1;const r=cd(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=dA(t,e.state,o);return cA(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},fA=(e,t)=>{const n=qx(e,t),r=cd(e,t);return!r||!n?!1:n>r.depth},hA=(e,t)=>{const n=qx(e,t),r=cd(e,t);return!r||!n?!1:n<r.depth},uy=(e,t)=>{if(!Bs(e.state,t)||!FZ(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:fA(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():hA(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},$G=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},pA=fn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&uy(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&uy(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&ly(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&ly(e,n,r)&&(t=!0)}),t}}}}),gS=/^(\s*)(\d+)\.\s+(.*)$/,BG=/^\s/;function UG(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],o=i.match(gS);if(!o)break;const[,s,a,u]=o,c=s.length;let f=u,h=n+1;const m=[i];for(;h<e.length;){const g=e[h];if(g.match(gS))break;if(g.trim()==="")m.push(g),f+=`
1371
- `,h+=1;else if(g.match(BG))m.push(g),f+=`
1372
- ${g.slice(c+2)}`,h+=1;else break}t.push({indent:c,number:parseInt(a,10),content:f.trim(),raw:m.join(`
1373
- `)}),r=h,n=h}return[t,r]}function mA(e,t,n){var r;const i=[];let o=0;for(;o<e.length;){const s=e[o];if(s.indent===t){const a=s.content.split(`
1374
- `),u=((r=a[0])==null?void 0:r.trim())||"",c=[];u&&c.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const f=a.slice(1).join(`
1375
- `).trim();if(f){const g=n.blockTokens(f);c.push(...g)}let h=o+1;const m=[];for(;h<e.length&&e[h].indent>t;)m.push(e[h]),h+=1;if(m.length>0){const g=Math.min(...m.map(b=>b.indent)),x=mA(m,g,n);c.push({type:"list",ordered:!0,start:m[0].number,items:x,raw:m.map(b=>b.raw).join(`
1376
- `)})}i.push({type:"list_item",raw:s.raw,tokens:c}),o=h}else o+=1}return i}function VG(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=t.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=t.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var HG="listItem",yS="textStyle",xS=/^(\d+)\.\s$/,gA=Kt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Pn(this.options.HTMLAttributes,n),0]:["ol",Pn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?VG(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1377
- `):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
1378
- `),[o,s]=UG(i);if(o.length===0)return;const a=mA(o,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,s).join(`
1379
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HG,this.editor.getAttributes(yS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Zl({find:xS,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Zl({find:xS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(yS)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),WG=/^\s*(\[([( |x])?\])\s$/,qG=Kt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Pn(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return Px(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),u=document.createElement("div"),c=h=>{var m,g;a.ariaLabel=((g=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:g.call(m,h,a.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};c(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:m}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:g})=>{const x=n();if(typeof x!="number")return!1;const b=g.doc.nodeAt(x);return g.setNodeMarkup(x,void 0,{...b==null?void 0:b.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,m])=>{i.setAttribute(h,m)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,u),Object.entries(t).forEach(([h,m])=>{i.setAttribute(h,m)});let f=new Set(Object.keys(t));return{dom:i,contentDOM:u,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,c(h);const m=r.extensionManager.attributes,g=Wl(h,m),x=new Set(Object.keys(g)),b=this.options.HTMLAttributes;return f.forEach(k=>{x.has(k)||(k in b?i.setAttribute(k,b[k]):i.removeAttribute(k))}),Object.entries(g).forEach(([k,C])=>{C==null?k in b?i.setAttribute(k,b[k]):i.removeAttribute(k):i.setAttribute(k,C)}),f=x,!0}}}},addInputRules(){return[Zl({find:WG,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),ZG=Kt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Pn(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1380
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const s=Q1(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,u)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:u}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},i=Q1(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});fn.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(aA.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(lA.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(pA.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(gA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(qG.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ZG.configure(this.options.taskList)),e}});var bS="&nbsp;",JG=" ",KG=Kt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Pn(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===bS||r[0].text===JG)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";const n=Array.isArray(e.content)?e.content:[];return n.length===0?bS:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),GG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,YG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,QG=si.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Pn(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ql({find:GG,type:this.type})]},addPasteRules(){return[Pa({find:YG,type:this.type})]}}),XG=Kt.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),eY=si.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Pn(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function tY(e={}){return new yn({view(t){return new nY(t,e)}})}class nY{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(n){let h=t.nodeBefore,m=t.nodeAfter;if(h||m){let g=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(g){let x=g.getBoundingClientRect(),b=h?x.bottom:x.top;h&&m&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*a;r={left:x.left,right:x.right,top:b-k,bottom:b+k}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*s;r={left:h.left-m,right:h.left+m,top:h.top,bottom:h.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,f;if(!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,f=-pageYOffset;else{let h=u.getBoundingClientRect(),m=h.width/u.offsetWidth,g=h.height/u.offsetHeight;c=h.left-u.scrollLeft*m,f=h.top-u.scrollTop*g}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-f)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=lT(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class _n extends Mt{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return _n.valid(r)?new _n(r):Mt.near(r)}content(){return qe.empty}eq(t){return t instanceof _n&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new _n(t.resolve(n.pos))}getBookmark(){return new Zx(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!rY(t)||!iY(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&_n.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){o=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let u=t.doc.resolve(i);if(_n.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!ut.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=t.doc.resolve(i);if(_n.valid(a))return a}return null}}}_n.prototype.visible=!1;_n.findFrom=_n.findGapCursorFrom;Mt.jsonID("gapcursor",_n);class Zx{constructor(t){this.pos=t}map(t){return new Zx(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return _n.valid(n)?new _n(n):Mt.near(n)}}function yA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function rY(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||yA(i.type))return!0;if(i.inlineContent)return!1}}return!0}function iY(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||yA(i.type))return!0;if(i.inlineContent)return!1}}return!0}function oY(){return new yn({props:{decorations:uY,createSelectionBetween(e,t,n){return t.pos==n.pos&&_n.valid(n)?new _n(n):null},handleClick:aY,handleKeyDown:sY,handleDOMEvents:{beforeinput:lY}}})}const sY=u6({ArrowLeft:Hf("horiz",-1),ArrowRight:Hf("horiz",1),ArrowUp:Hf("vert",-1),ArrowDown:Hf("vert",1)});function Hf(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,a=t>0?s.$to:s.$from,u=s.empty;if(s instanceof yt){if(!o.endOfTextblock(n)||a.depth==0)return!1;u=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=_n.findGapCursorFrom(a,t,u);return c?(i&&i(r.tr.setSelection(new _n(c))),!0):!1}}function aY(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!_n.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ut.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new _n(r))),!0)}function lY(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof _n))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=me.empty;for(let s=r.length-1;s>=0;s--)i=me.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new qe(i,0,0));return o.setSelection(yt.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function uY(e){if(!(e.selection instanceof _n))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",wn.create(e.doc,[Cr.widget(e.selection.head,t,{key:"gapcursor"})])}var pp=200,Gn=function(){};Gn.prototype.append=function(t){return t.length?(t=Gn.from(t),!this.length&&t||t.length<pp&&this.leafAppend(t)||this.length<pp&&t.leafPrepend(this)||this.appendInner(t)):this};Gn.prototype.prepend=function(t){return t.length?Gn.from(t).append(this):this};Gn.prototype.appendInner=function(t){return new cY(this,t)};Gn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Gn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Gn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Gn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Gn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};Gn.from=function(t){return t instanceof Gn?t:t&&t.length?new xA(t):Gn.empty};var xA=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var u=o;u<s;u++)if(i(this.values[u],a+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var u=o-1;u>=s;u--)if(i(this.values[u],a+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=pp)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=pp)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Gn);Gn.empty=new xA([]);var cY=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(Gn);const dY=500;class Fi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,u,c=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new Qi(h.map));let g=h.step.map(i.slice(o)),x;g&&s.maybeStep(g).doc&&(x=s.mapping.maps[s.mapping.maps.length-1],c.push(new Qi(x,void 0,void 0,c.length+f.length))),o--,x&&i.appendMap(x,o)}else s.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(o)):h.selection,u=new Fi(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,u=!i&&a.length?a.get(a.length-1):null;for(let f=0;f<t.steps.length;f++){let h=t.steps[f].invert(t.docs[f]),m=new Qi(t.mapping.maps[f],h,n),g;(g=u&&u.merge(m))&&(m=g,f?o.pop():a=a.slice(0,a.length-1)),o.push(m),n&&(s++,n=void 0),i||(u=m)}let c=s-r.depth;return c>hY&&(a=fY(a,c),s-=c),new Fi(a.append(o),s)}remapping(t,n){let r=new Lc;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Fi(this.items.append(t.map(n=>new Qi(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},i);let u=n;this.items.forEach(m=>{let g=o.getMirror(--u);if(g==null)return;s=Math.min(s,g);let x=o.maps[g];if(m.step){let b=t.steps[g].invert(t.docs[g]),k=m.selection&&m.selection.map(o.slice(u+1,g));k&&a++,r.push(new Qi(x,b,k))}else r.push(new Qi(x))},i);let c=[];for(let m=n;m<s;m++)c.push(new Qi(o.maps[m]));let f=this.items.slice(0,i).append(c).append(r),h=new Fi(f,a);return h.emptyItemCount()>dY&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new Qi(c.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(h))?i[g]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new Fi(Gn.from(i.reverse()),o)}}Fi.empty=new Fi(Gn.empty,0);function fY(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Qi{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Qi(n.getMap().invert(),n,this.selection)}}}class bs{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const hY=20;function pY(e,t,n,r){let i=n.getMeta(_a),o;if(i)return i.historyState;n.getMeta(yY)&&(e=new bs(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(_a))return s.getMeta(_a).redo?new bs(e.done.addTransform(n,void 0,r,nh(t)),e.undone,vS(n.mapping.maps),e.prevTime,e.prevComposition):new bs(e.done,e.undone.addTransform(n,void 0,r,nh(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),u=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!mY(n,e.prevRanges)),c=s?Bg(e.prevRanges,n.mapping):vS(n.mapping.maps);return new bs(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,nh(t)),Fi.empty,c,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new bs(e.done.rebased(n,o),e.undone.rebased(n,o),Bg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Bg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function mY(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function vS(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function Bg(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function gY(e,t,n){let r=nh(t),i=_a.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new bs(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(_a,{redo:n,historyState:u})}let Ug=!1,kS=null;function nh(e){let t=e.plugins;if(kS!=t){Ug=!1,kS=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Ug=!0;break}}return Ug}const _a=new jn("history"),yY=new jn("closeHistory");function xY(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new yn({key:_a,state:{init(){return new bs(Fi.empty,Fi.empty,null,0,-1)},apply(t,n,r){return pY(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?vA:r=="historyRedo"?kA:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function bA(e,t){return(n,r)=>{let i=_a.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=gY(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const vA=bA(!1,!0),kA=bA(!0,!0);fn.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new yn({key:new jn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,a=0,u=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,u);return e=!0,c}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,u=o-r,c=a-u,f=a;return t.deleteRange(c,f),!(this.storage.characters({node:t.doc})>r)}})]}});var bY=fn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[tY(this.options)]}});fn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yn({key:new jn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return wn.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((u,c)=>{if(u.isText)return;if(!(i>=c&&i<=c+u.nodeSize-1))return!1;s+=1});let a=0;return e.descendants((u,c)=>{if(u.isText||!(i>=c&&i<=c+u.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(Cr.node(c,c+u.nodeSize,{class:this.options.className}))}),wn.create(e,o)}}})]}});var vY=fn.create({name:"gapCursor",addProseMirrorPlugins(){return[oY()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Zt(lt(e,"allowGapCursor",n)))!=null?t:null}}}),wS="placeholder";function kY(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var wY=fn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:wS,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${kY(this.options.dataAttribute)}`:`data-${wS}`;return[new yn({key:new jn("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;const s=this.editor.isEmpty;return t.descendants((a,u)=>{const c=i>=u&&i<=u+a.nodeSize,f=!a.isLeaf&&Hp(a);if((c||!this.options.showOnlyCurrent)&&f){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const m=Cr.node(u,u+a.nodeSize,{class:h.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:u,hasAnchor:c}):this.options.placeholder});o.push(m)}return this.options.includeChildren}),wn.create(t,o)}}})]}});fn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new yn({key:new jn("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||E6(n.selection)||e.view.dragging?null:wn.create(n.doc,[Cr.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function CS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var CY=fn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new jn(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new yn({key:t,appendTransaction:(i,o,s)=>{const{doc:a,tr:u,schema:c}=s,f=t.getState(s),h=a.content.size,m=c.nodes[n];if(f)return u.insert(h,m.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!CS({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!CS({node:s,types:r})}}})]}}),SY=fn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>vA(e,t),redo:()=>({state:e,dispatch:t})=>kA(e,t)}},addProseMirrorPlugins(){return[xY(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),EY=fn.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(KK.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(HK.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(aA.configure(this.options.bulletList)),this.options.code!==!1&&i.push(QK.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(tG.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(nG.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(bY.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(vY.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(rG.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(iG.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(SY.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(oG.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(cG.configure(this.options.italic)),this.options.listItem!==!1&&i.push(lA.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(pA.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(PG.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(gA.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(KG.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(QG.configure(this.options.strike)),this.options.text!==!1&&i.push(XG.configure(this.options.text)),this.options.underline!==!1&&i.push(eY.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(CY.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),_Y=EY,TY=wY,AY=e=>Tn({find:/--$/,replace:e??"—"}),MY=e=>Tn({find:/\.\.\.$/,replace:e??"…"}),NY=e=>Tn({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??"“"}),IY=e=>Tn({find:/"$/,replace:e??"”"}),DY=e=>Tn({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??"‘"}),OY=e=>Tn({find:/'$/,replace:e??"’"}),RY=e=>Tn({find:/<-$/,replace:e??"←"}),PY=e=>Tn({find:/->$/,replace:e??"→"}),jY=e=>Tn({find:/\(c\)$/,replace:e??"©"}),zY=e=>Tn({find:/\(tm\)$/,replace:e??"™"}),LY=e=>Tn({find:/\(sm\)$/,replace:e??"℠"}),FY=e=>Tn({find:/\(r\)$/,replace:e??"®"}),$Y=e=>Tn({find:/(?:^|\s)(1\/2)\s$/,replace:e??"½"}),BY=e=>Tn({find:/\+\/-$/,replace:e??"±"}),UY=e=>Tn({find:/!=$/,replace:e??"≠"}),VY=e=>Tn({find:/<<$/,replace:e??"«"}),HY=e=>Tn({find:/>>$/,replace:e??"»"}),WY=e=>Tn({find:/\d+\s?([*x])\s?\d+$/,replace:e??"×"}),qY=e=>Tn({find:/\^2$/,replace:e??"²"}),ZY=e=>Tn({find:/\^3$/,replace:e??"³"}),JY=e=>Tn({find:/(?:^|\s)(1\/4)\s$/,replace:e??"¼"}),KY=e=>Tn({find:/(?:^|\s)(3\/4)\s$/,replace:e??"¾"}),GY=fn.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const e=[];return this.options.emDash!==!1&&e.push(AY(this.options.emDash)),this.options.ellipsis!==!1&&e.push(MY(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&e.push(NY(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(IY(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&e.push(DY(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(OY(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&e.push(RY(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(PY(this.options.rightArrow)),this.options.copyright!==!1&&e.push(jY(this.options.copyright)),this.options.trademark!==!1&&e.push(zY(this.options.trademark)),this.options.servicemark!==!1&&e.push(LY(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(FY(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push($Y(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(BY(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(UY(this.options.notEqual)),this.options.laquo!==!1&&e.push(VY(this.options.laquo)),this.options.raquo!==!1&&e.push(HY(this.options.raquo)),this.options.multiplication!==!1&&e.push(WY(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(qY(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(ZY(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(JY(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(KY(this.options.threeQuarters)),e}}),YY=GY;const SS={};function QY(e){let t=SS[e];if(t)return t;t=SS[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Jl(e,t){typeof t!="string"&&(t=Jl.defaultChars);const n=QY(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){const a=parseInt(r.slice(o+1,o+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&o+3<s){const u=parseInt(r.slice(o+4,o+6),16);if((u&192)===128){const c=a<<6&1984|u&63;c<128?i+="��":i+=String.fromCharCode(c),o+=3;continue}}if((a&240)===224&&o+6<s){const u=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16);if((u&192)===128&&(c&192)===128){const f=a<<12&61440|u<<6&4032|c&63;f<2048||f>=55296&&f<=57343?i+="���":i+=String.fromCharCode(f),o+=6;continue}}if((a&248)===240&&o+9<s){const u=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16),f=parseInt(r.slice(o+10,o+12),16);if((u&192)===128&&(c&192)===128&&(f&192)===128){let h=a<<18&1835008|u<<12&258048|c<<6&4032|f&63;h<65536||h>1114111?i+="����":(h-=65536,i+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),o+=9;continue}}i+="�"}return i})}Jl.defaultChars=";/?:@&=+$,#";Jl.componentChars="";const ES={};function XY(e){let t=ES[e];if(t)return t;t=ES[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function dd(e,t,n){typeof t!="string"&&(n=t,t=dd.defaultChars),typeof n>"u"&&(n=!0);const r=XY(t);let i="";for(let o=0,s=e.length;o<s;o++){const a=e.charCodeAt(o);if(n&&a===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<s){const u=e.charCodeAt(o+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}dd.defaultChars=";/?:@&=+$,-_.!~*'()#";dd.componentChars="-_.!~*'()";function Jx(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function mp(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const eQ=/^([a-z0-9.+-]+:)/i,tQ=/:[0-9]*$/,nQ=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,rQ=["<",">",'"',"`"," ","\r",`
1381
- `," "],iQ=["{","}","|","\\","^","`"].concat(rQ),oQ=["'"].concat(iQ),_S=["%","/","?",";","#"].concat(oQ),TS=["/","?","#"],sQ=255,AS=/^[+a-z0-9A-Z_-]{0,63}$/,aQ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,MS={javascript:!0,"javascript:":!0},NS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Kx(e,t){if(e&&e instanceof mp)return e;const n=new mp;return n.parse(e,t),n}mp.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const c=nQ.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=eQ.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&MS[s])&&(o=o.substr(2),this.slashes=!0)),!MS[s]&&(i||s&&!NS[s])){let c=-1;for(let x=0;x<TS.length;x++)r=o.indexOf(TS[x]),r!==-1&&(c===-1||r<c)&&(c=r);let f,h;c===-1?h=o.lastIndexOf("@"):h=o.lastIndexOf("@",c),h!==-1&&(f=o.slice(0,h),o=o.slice(h+1),this.auth=f),c=-1;for(let x=0;x<_S.length;x++)r=o.indexOf(_S[x]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=o.length),o[c-1]===":"&&c--;const m=o.slice(0,c);o=o.slice(c),this.parseHost(m),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const x=this.hostname.split(/\./);for(let b=0,k=x.length;b<k;b++){const C=x[b];if(C&&!C.match(AS)){let _="";for(let E=0,I=C.length;E<I;E++)C.charCodeAt(E)>127?_+="x":_+=C[E];if(!_.match(AS)){const E=x.slice(0,b),I=x.slice(b+1),N=C.match(aQ);N&&(E.push(N[1]),I.unshift(N[2])),I.length&&(o=I.join(".")+o),this.hostname=E.join(".");break}}}}this.hostname.length>sQ&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const u=o.indexOf("?");return u!==-1&&(this.search=o.substr(u),o=o.slice(0,u)),o&&(this.pathname=o),NS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};mp.prototype.parseHost=function(e){let t=tQ.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const lQ=Object.freeze(Object.defineProperty({__proto__:null,decode:Jl,encode:dd,format:Jx,parse:Kx},Symbol.toStringTag,{value:"Module"})),wA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,CA=/[\0-\x1F\x7F-\x9F]/,uQ=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Gx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,SA=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,EA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,cQ=Object.freeze(Object.defineProperty({__proto__:null,Any:wA,Cc:CA,Cf:uQ,P:Gx,S:SA,Z:EA},Symbol.toStringTag,{value:"Module"})),dQ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),fQ=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Vg;const hQ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),pQ=(Vg=String.fromCodePoint)!==null&&Vg!==void 0?Vg:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function mQ(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=hQ.get(e))!==null&&t!==void 0?t:e}var Jn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Jn||(Jn={}));const gQ=32;var As;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(As||(As={}));function cy(e){return e>=Jn.ZERO&&e<=Jn.NINE}function yQ(e){return e>=Jn.UPPER_A&&e<=Jn.UPPER_F||e>=Jn.LOWER_A&&e<=Jn.LOWER_F}function xQ(e){return e>=Jn.UPPER_A&&e<=Jn.UPPER_Z||e>=Jn.LOWER_A&&e<=Jn.LOWER_Z||cy(e)}function bQ(e){return e===Jn.EQUALS||xQ(e)}var qn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(qn||(qn={}));var Ss;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ss||(Ss={}));class vQ{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=qn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ss.Strict}startEntity(t){this.decodeMode=t,this.state=qn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case qn.EntityStart:return t.charCodeAt(n)===Jn.NUM?(this.state=qn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=qn.NamedEntity,this.stateNamedEntity(t,n));case qn.NumericStart:return this.stateNumericStart(t,n);case qn.NumericDecimal:return this.stateNumericDecimal(t,n);case qn.NumericHex:return this.stateNumericHex(t,n);case qn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|gQ)===Jn.LOWER_X?(this.state=qn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=qn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(cy(i)||yQ(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(cy(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Jn.SEMI)this.consumed+=1;else if(this.decodeMode===Ss.Strict)return 0;return this.emitCodePoint(mQ(this.result),this.consumed),this.errors&&(t!==Jn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&As.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=kQ(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Ss.Attribute&&(o===0||bQ(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&As.VALUE_LENGTH)>>14,o!==0){if(s===Jn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Ss.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&As.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~As.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case qn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ss.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case qn.NumericDecimal:return this.emitNumericEntity(0,2);case qn.NumericHex:return this.emitNumericEntity(0,3);case qn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case qn.EntityStart:return 0}}}function _A(e){let t="";const n=new vQ(e,r=>t+=pQ(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(s,a),n.startEntity(o);const c=n.write(i,a+1);if(c<0){s=a+n.end();break}s=a+c,a=c===0?s+1:s}const u=t+i.slice(s);return t="",u}}function kQ(e,t,n,r){const i=(t&As.BRANCH_LENGTH)>>7,o=t&As.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const u=r-o;return u<0||u>=i?-1:e[n+u]-1}let s=n,a=s+i-1;for(;s<=a;){const u=s+a>>>1,c=e[u];if(c<r)s=u+1;else if(c>r)a=u-1;else return e[u+i]}return-1}const wQ=_A(dQ);_A(fQ);function TA(e,t=Ss.Legacy){return wQ(e,t)}function CQ(e){return Object.prototype.toString.call(e)}function Yx(e){return CQ(e)==="[object String]"}const SQ=Object.prototype.hasOwnProperty;function EQ(e,t){return SQ.call(e,t)}function Zp(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){e[r]=n[r]})}}),e}function AA(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Qx(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function gp(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const MA=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,_Q=/&([a-z#][a-z0-9]{1,31});/gi,TQ=new RegExp(MA.source+"|"+_Q.source,"gi"),AQ=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function MQ(e,t){if(t.charCodeAt(0)===35&&AQ.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Qx(r)?gp(r):e}const n=TA(e);return n!==e?n:e}function NQ(e){return e.indexOf("\\")<0?e:e.replace(MA,"$1")}function Kl(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(TQ,function(t,n,r){return n||MQ(t,r)})}const IQ=/[&<>"]/,DQ=/[&<>"]/g,OQ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function RQ(e){return OQ[e]}function Us(e){return IQ.test(e)?e.replace(DQ,RQ):e}const PQ=/[.?*+^$[\]\\(){}|-]/g;function jQ(e){return e.replace(PQ,"\\$&")}function nn(e){switch(e){case 9:case 32:return!0}return!1}function Zc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Jc(e){return Gx.test(e)||SA.test(e)}function Kc(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Jp(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const zQ={mdurl:lQ,ucmicro:cQ},LQ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:AA,assign:Zp,escapeHtml:Us,escapeRE:jQ,fromCodePoint:gp,has:EQ,isMdAsciiPunct:Kc,isPunctChar:Jc,isSpace:nn,isString:Yx,isValidEntityCode:Qx,isWhiteSpace:Zc,lib:zQ,normalizeReference:Jp,unescapeAll:Kl,unescapeMd:NQ},Symbol.toStringTag,{value:"Module"}));function FQ(e,t,n){let r,i,o,s;const a=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),o===93&&(r--,r===0)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),o===91){if(s===e.pos-1)r++;else if(n)return e.pos=u,-1}}let c=-1;return i&&(c=e.pos),e.pos=u,c}function $Q(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=Kl(e.slice(t+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return t===i||s!==0||(o.str=Kl(e.slice(t,i)),o.pos=i,o.ok=!0),o}function BQ(e,t,n,r){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=e.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;t++,o++,a===40&&(a=41),s.marker=a}for(;o<n;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=Kl(e.slice(t,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=Kl(e.slice(t,o)),s}const UQ=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:$Q,parseLinkLabel:FQ,parseLinkTitle:BQ},Symbol.toStringTag,{value:"Module"})),uo={};uo.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+Us(o.content)+"</code>"};uo.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+Us(e[t].content)+`</code></pre>
1382
- `};uo.fence=function(e,t,n,r,i){const o=e[t],s=o.info?Kl(o.info).trim():"";let a="",u="";if(s){const f=s.split(/(\s+)/g);a=f[0],u=f.slice(2).join("")}let c;if(n.highlight?c=n.highlight(o.content,a,u)||Us(o.content):c=Us(o.content),c.indexOf("<pre")===0)return c+`
1383
- `;if(s){const f=o.attrIndex("class"),h=o.attrs?o.attrs.slice():[];f<0?h.push(["class",n.langPrefix+a]):(h[f]=h[f].slice(),h[f][1]+=" "+n.langPrefix+a);const m={attrs:h};return`<pre><code${i.renderAttrs(m)}>${c}</code></pre>
1384
- `}return`<pre><code${i.renderAttrs(o)}>${c}</code></pre>
1385
- `};uo.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)};uo.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
1386
- `:`<br>
1387
- `};uo.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
1388
- `:`<br>
1389
- `:`
1390
- `};uo.text=function(e,t){return Us(e[t].content)};uo.html_block=function(e,t){return e[t].content};uo.html_inline=function(e,t){return e[t].content};function tu(){this.rules=Zp({},uo)}tu.prototype.renderAttrs=function(t){let n,r,i;if(!t.attrs)return"";for(i="",n=0,r=t.attrs.length;n<r;n++)i+=" "+Us(t.attrs[n][0])+'="'+Us(t.attrs[n][1])+'"';return i};tu.prototype.renderToken=function(t,n,r){const i=t[n];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&t[n-1].hidden&&(o+=`
1391
- `),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&n+1<t.length)){const a=t[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(s=!1)}return o+=s?`>
1392
- `:">",o};tu.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;typeof i[a]<"u"?r+=i[a](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r};tu.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"html_inline":case"html_block":r+=e[i].content;break;case"softbreak":case"hardbreak":r+=`
1393
- `;break}return r};tu.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;a==="inline"?r+=this.renderInline(e[o].children,t,n):typeof i[a]<"u"?r+=i[a](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r};function Vr(){this.__rules__=[],this.__cache__=null}Vr.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Vr.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})};Vr.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Vr.prototype.before=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Vr.prototype.after=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Vr.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};Vr.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Vr.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Vr.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Vr.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Ui(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ui.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1};Ui.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Ui.prototype.attrSet=function(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i};Ui.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Ui.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function NA(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}NA.prototype.Token=Ui;const VQ=/\r\n?|\n/g,HQ=/\0/g;function WQ(e){let t;t=e.src.replace(VQ,`
1394
- `),t=t.replace(HQ,"�"),e.src=t}function qQ(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ZQ(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function JQ(e){return/^<a[>\s]/i.test(e)}function KQ(e){return/^<\/a\s*>/i.test(e)}function GQ(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let i=t[n].children,o=0;for(let s=i.length-1;s>=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(JQ(a.content)&&o>0&&o--,KQ(a.content)&&o++),!(o>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const u=a.content;let c=e.md.linkify.match(u);const f=[];let h=a.level,m=0;c.length>0&&c[0].index===0&&s>0&&i[s-1].type==="text_special"&&(c=c.slice(1));for(let g=0;g<c.length;g++){const x=c[g].url,b=e.md.normalizeLink(x);if(!e.md.validateLink(b))continue;let k=c[g].text;c[g].schema?c[g].schema==="mailto:"&&!/^mailto:/i.test(k)?k=e.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):k=e.md.normalizeLinkText(k):k=e.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,"");const C=c[g].index;if(C>m){const N=new e.Token("text","",0);N.content=u.slice(m,C),N.level=h,f.push(N)}const _=new e.Token("link_open","a",1);_.attrs=[["href",b]],_.level=h++,_.markup="linkify",_.info="auto",f.push(_);const E=new e.Token("text","",0);E.content=k,E.level=h,f.push(E);const I=new e.Token("link_close","a",-1);I.level=--h,I.markup="linkify",I.info="auto",f.push(I),m=c[g].lastIndex}if(m<u.length){const g=new e.Token("text","",0);g.content=u.slice(m),g.level=h,f.push(g)}t[n].children=i=AA(i,s,f)}}}}const IA=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,YQ=/\((c|tm|r)\)/i,QQ=/\((c|tm|r)\)/ig,XQ={c:"©",r:"®",tm:"™"};function eX(e,t){return XQ[t.toLowerCase()]}function tX(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(QQ,eX)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function nX(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&IA.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function rX(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(YQ.test(e.tokens[t].content)&&tX(e.tokens[t].children),IA.test(e.tokens[t].content)&&nX(e.tokens[t].children))}const iX=/['"]/,IS=/['"]/g,DS="’";function Wf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function oX(e,t){let n;const r=[];for(let i=0;i<e.length;i++){const o=e[i],s=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,u=0,c=a.length;e:for(;u<c;){IS.lastIndex=u;const f=IS.exec(a);if(!f)break;let h=!0,m=!0;u=f.index+1;const g=f[0]==="'";let x=32;if(f.index-1>=0)x=a.charCodeAt(f.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(u<c)b=a.charCodeAt(u);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const k=Kc(x)||Jc(String.fromCharCode(x)),C=Kc(b)||Jc(String.fromCharCode(b)),_=Zc(x),E=Zc(b);if(E?h=!1:C&&(_||k||(h=!1)),_?m=!1:k&&(E||C||(m=!1)),b===34&&f[0]==='"'&&x>=48&&x<=57&&(m=h=!1),h&&m&&(h=k,m=C),!h&&!m){g&&(o.content=Wf(o.content,f.index,DS));continue}if(m)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<s)break;if(I.single===g&&r[n].level===s){I=r[n];let N,M;g?(N=t.md.options.quotes[2],M=t.md.options.quotes[3]):(N=t.md.options.quotes[0],M=t.md.options.quotes[1]),o.content=Wf(o.content,f.index,M),e[I.token].content=Wf(e[I.token].content,I.pos,N),u+=M.length-1,I.token===i&&(u+=N.length-1),a=o.content,c=a.length,r.length=n;continue e}}h?r.push({token:i,pos:f.index,single:g,level:s}):m&&g&&(o.content=Wf(o.content,f.index,DS))}}}function sX(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!iX.test(e.tokens[t].content)||oX(e.tokens[t].children,e)}function aX(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;const s=r[o].children,a=s.length;for(t=0;t<a;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<a;t++)s[t].type==="text"&&t+1<a&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}const Hg=[["normalize",WQ],["block",qQ],["inline",ZQ],["linkify",GQ],["replacements",rX],["smartquotes",sX],["text_join",aX]];function Xx(){this.ruler=new Vr;for(let e=0;e<Hg.length;e++)this.ruler.push(Hg[e][0],Hg[e][1])}Xx.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)};Xx.prototype.State=NA;function co(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,a=0,u=0,c=i.length,f=!1;s<c;s++){const h=i.charCodeAt(s);if(!f)if(nn(h)){a++,h===9?u+=4-u%4:u++;continue}else f=!0;(h===10||s===c-1)&&(h!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),f=!1,a=0,u=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}co.prototype.push=function(e,t,n){const r=new Ui(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};co.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};co.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};co.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const r=this.src.charCodeAt(t);if(!nn(r))break}return t};co.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!nn(this.src.charCodeAt(--t)))return t+1;return t};co.prototype.skipChars=function(t,n){for(let r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t};co.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t};co.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const o=new Array(n-t);for(let s=0,a=t;a<n;a++,s++){let u=0;const c=this.bMarks[a];let f=c,h;for(a+1<n||i?h=this.eMarks[a]+1:h=this.eMarks[a];f<h&&u<r;){const m=this.src.charCodeAt(f);if(nn(m))m===9?u+=4-(u+this.bsCount[a])%4:u++;else if(f-c<this.tShift[a])u++;else break;f++}u>r?o[s]=new Array(u-r+1).join(" ")+this.src.slice(f,h):o[s]=this.src.slice(f,h)}return o.join("")};co.prototype.Token=Ui;const lX=65536;function Wg(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function OS(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)i===124&&(o?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),o=i===92,r++,i=e.charCodeAt(r);return t.push(a+e.substring(s)),t}function uX(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!nn(a)||s===45&&nn(a))return!1;for(;o<e.eMarks[i];){const I=e.src.charCodeAt(o);if(I!==124&&I!==45&&I!==58&&!nn(I))return!1;o++}let u=Wg(e,t+1),c=u.split("|");const f=[];for(let I=0;I<c.length;I++){const N=c[I].trim();if(!N){if(I===0||I===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(N))return!1;N.charCodeAt(N.length-1)===58?f.push(N.charCodeAt(0)===58?"center":"right"):N.charCodeAt(0)===58?f.push("left"):f.push("")}if(u=Wg(e,t).trim(),u.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;c=OS(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const h=c.length;if(h===0||h!==f.length)return!1;if(r)return!0;const m=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRules("blockquote"),x=e.push("table_open","table",1),b=[t,0];x.map=b;const k=e.push("thead_open","thead",1);k.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let I=0;I<c.length;I++){const N=e.push("th_open","th",1);f[I]&&(N.attrs=[["style","text-align:"+f[I]]]);const M=e.push("inline","",0);M.content=c[I].trim(),M.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let _,E=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let I=!1;for(let M=0,j=g.length;M<j;M++)if(g[M](e,i,n,!0)){I=!0;break}if(I||(u=Wg(e,i).trim(),!u)||e.sCount[i]-e.blkIndent>=4||(c=OS(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),E+=h-c.length,E>lX))break;if(i===t+2){const M=e.push("tbody_open","tbody",1);M.map=_=[t+2,0]}const N=e.push("tr_open","tr",1);N.map=[i,i+1];for(let M=0;M<h;M++){const j=e.push("td_open","td",1);f[M]&&(j.attrs=[["style","text-align:"+f[M]]]);const O=e.push("inline","",0);O.content=c[M]?c[M].trim():"",O.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return _&&(e.push("tbody_close","tbody",-1),_[1]=i),e.push("table_close","table",-1),b[1]=i,e.parentType=m,e.line=i,!0}function cX(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+`
1395
- `,o.map=[t,e.line],!0}function dX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=e.skipChars(i,s);let u=i-a;if(u<3)return!1;const c=e.src.slice(a,i),f=e.src.slice(i,o);if(s===96&&f.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let h=t,m=!1;for(;h++,!(h>=n||(i=a=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],i<o&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[h]-e.blkIndent>=4)&&(i=e.skipChars(i,s),!(i-a<u)&&(i=e.skipSpaces(i),!(i<o)))){m=!0;break}u=e.sCount[t],e.line=h+(m?1:0);const g=e.push("fence","code",0);return g.info=f,g.content=e.getLines(t+1,h,u,!0),g.markup=c,g.map=[t,e.line],!0}function fX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],u=[],c=[],f=[],h=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let g=!1,x;for(x=t;x<n;x++){const E=e.sCount[x]<e.blkIndent;if(i=e.bMarks[x]+e.tShift[x],o=e.eMarks[x],i>=o)break;if(e.src.charCodeAt(i++)===62&&!E){let N=e.sCount[x]+1,M,j;e.src.charCodeAt(i)===32?(i++,N++,j=!1,M=!0):e.src.charCodeAt(i)===9?(M=!0,(e.bsCount[x]+N)%4===3?(i++,N++,j=!1):j=!0):M=!1;let O=N;for(a.push(e.bMarks[x]),e.bMarks[x]=i;i<o;){const R=e.src.charCodeAt(i);if(nn(R))R===9?O+=4-(O+e.bsCount[x]+(j?1:0))%4:O++;else break;i++}g=i>=o,u.push(e.bsCount[x]),e.bsCount[x]=e.sCount[x]+1+(M?1:0),c.push(e.sCount[x]),e.sCount[x]=O-N,f.push(e.tShift[x]),e.tShift[x]=i-e.bMarks[x];continue}if(g)break;let I=!1;for(let N=0,M=h.length;N<M;N++)if(h[N](e,x,n,!0)){I=!0;break}if(I){e.lineMax=x,e.blkIndent!==0&&(a.push(e.bMarks[x]),u.push(e.bsCount[x]),f.push(e.tShift[x]),c.push(e.sCount[x]),e.sCount[x]-=e.blkIndent);break}a.push(e.bMarks[x]),u.push(e.bsCount[x]),f.push(e.tShift[x]),c.push(e.sCount[x]),e.sCount[x]=-1}const b=e.blkIndent;e.blkIndent=0;const k=e.push("blockquote_open","blockquote",1);k.markup=">";const C=[t,0];k.map=C,e.md.block.tokenize(e,t,x);const _=e.push("blockquote_close","blockquote",-1);_.markup=">",e.lineMax=s,e.parentType=m,C[1]=e.line;for(let E=0;E<f.length;E++)e.bMarks[E+t]=a[E],e.tShift[E+t]=f[E],e.sCount[E+t]=c[E],e.bsCount[E+t]=u[E];return e.blkIndent=b,!0}function hX(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o<i;){const c=e.src.charCodeAt(o++);if(c!==s&&!nn(c))return!1;c===s&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const u=e.push("hr","hr",0);return u.map=[t,e.line],u.markup=Array(a+1).join(String.fromCharCode(s)),!0}function RS(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const o=e.src.charCodeAt(r);if(!nn(o))return-1}return r}function PS(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=e.src.charCodeAt(i),!nn(o))?-1:i}function pX(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function mX(e,t,n,r){let i,o,s,a,u=t,c=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let f=!1;r&&e.parentType==="paragraph"&&e.sCount[u]>=e.blkIndent&&(f=!0);let h,m,g;if((g=PS(e,u))>=0){if(h=!0,s=e.bMarks[u]+e.tShift[u],m=Number(e.src.slice(s,g-1)),f&&m!==1)return!1}else if((g=RS(e,u))>=0)h=!1;else return!1;if(f&&e.skipSpaces(g)>=e.eMarks[u])return!1;if(r)return!0;const x=e.src.charCodeAt(g-1),b=e.tokens.length;h?(a=e.push("ordered_list_open","ol",1),m!==1&&(a.attrs=[["start",m]])):a=e.push("bullet_list_open","ul",1);const k=[u,0];a.map=k,a.markup=String.fromCharCode(x);let C=!1;const _=e.md.block.ruler.getRules("list"),E=e.parentType;for(e.parentType="list";u<n;){o=g,i=e.eMarks[u];const I=e.sCount[u]+g-(e.bMarks[u]+e.tShift[u]);let N=I;for(;o<i;){const $=e.src.charCodeAt(o);if($===9)N+=4-(N+e.bsCount[u])%4;else if($===32)N++;else break;o++}const M=o;let j;M>=i?j=1:j=N-I,j>4&&(j=1);const O=I+j;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(x);const R=[u,0];a.map=R,h&&(a.info=e.src.slice(s,g-1));const F=e.tight,ee=e.tShift[u],X=e.sCount[u],Se=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=O,e.tight=!0,e.tShift[u]=M-e.bMarks[u],e.sCount[u]=N,M>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||C)&&(c=!1),C=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Se,e.tShift[u]=ee,e.sCount[u]=X,e.tight=F,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(x),u=e.line,R[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let ue=!1;for(let $=0,Q=_.length;$<Q;$++)if(_[$](e,u,n,!0)){ue=!0;break}if(ue)break;if(h){if(g=PS(e,u),g<0)break;s=e.bMarks[u]+e.tShift[u]}else if(g=RS(e,u),g<0)break;if(x!==e.src.charCodeAt(g-1))break}return h?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(x),k[1]=u,e.line=u,e.parentType=E,c&&pX(e,b),!0}function gX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function a(_){const E=e.lineMax;if(_>=E||e.isEmpty(_))return null;let I=!1;if(e.sCount[_]-e.blkIndent>3&&(I=!0),e.sCount[_]<0&&(I=!0),!I){const j=e.md.block.ruler.getRules("reference"),O=e.parentType;e.parentType="reference";let R=!1;for(let F=0,ee=j.length;F<ee;F++)if(j[F](e,_,E,!0)){R=!0;break}if(e.parentType=O,R)return null}const N=e.bMarks[_]+e.tShift[_],M=e.eMarks[_];return e.src.slice(N,M+1)}let u=e.src.slice(i,o+1);o=u.length;let c=-1;for(i=1;i<o;i++){const _=u.charCodeAt(i);if(_===91)return!1;if(_===93){c=i;break}else if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(_===92&&(i++,i<o&&u.charCodeAt(i)===10)){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}}if(c<0||u.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<o;i++){const _=u.charCodeAt(i);if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(!nn(_))break}const f=e.md.helpers.parseLinkDestination(u,i,o);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;i=f.pos;const m=i,g=s,x=i;for(;i<o;i++){const _=u.charCodeAt(i);if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(!nn(_))break}let b=e.md.helpers.parseLinkTitle(u,i,o);for(;b.can_continue;){const _=a(s);if(_===null)break;u+=_,i=o,o=u.length,s++,b=e.md.helpers.parseLinkTitle(u,i,o,b)}let k;for(i<o&&x!==i&&b.ok?(k=b.str,i=b.pos):(k="",i=m,s=g);i<o;){const _=u.charCodeAt(i);if(!nn(_))break;i++}if(i<o&&u.charCodeAt(i)!==10&&k)for(k="",i=m,s=g;i<o;){const _=u.charCodeAt(i);if(!nn(_))break;i++}if(i<o&&u.charCodeAt(i)!==10)return!1;const C=Jp(u.slice(1,c));return C?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:k,href:h}),e.line=s),!0):!1}const yX=["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"],xX="[a-zA-Z_:][a-zA-Z0-9:._-]*",bX="[^\"'=<>`\\x00-\\x20]+",vX="'[^']*'",kX='"[^"]*"',wX="(?:"+bX+"|"+vX+"|"+kX+")",CX="(?:\\s+"+xX+"(?:\\s*=\\s*"+wX+")?)",DA="<[A-Za-z][A-Za-z0-9\\-]*"+CX+"*\\s*\\/?>",OA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",SX="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",EX="<[?][\\s\\S]*?[?]>",_X="<![A-Za-z][^>]*>",TX="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",AX=new RegExp("^(?:"+DA+"|"+OA+"|"+SX+"|"+EX+"|"+_X+"|"+TX+")"),MX=new RegExp("^(?:"+DA+"|"+OA+")"),yl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+yX.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(MX.source+"\\s*$"),/^$/,!1]];function NX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,o),a=0;for(;a<yl.length&&!yl[a][0].test(s);a++);if(a===yl.length)return!1;if(r)return yl[a][2];let u=t+1;if(!yl[a][1].test(s)){for(;u<n&&!(e.sCount[u]<e.blkIndent);u++)if(i=e.bMarks[u]+e.tShift[u],o=e.eMarks[u],s=e.src.slice(i,o),yl[a][1].test(s)){s.length!==0&&u++;break}}e.line=u;const c=e.push("html_block","",0);return c.map=[t,u],c.content=e.getLines(t,u,e.blkIndent,!0),!0}function IX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);s===35&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!nn(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const u=e.skipCharsBack(o,35,i);u>i&&nn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const f=e.push("inline","",0);f.content=e.src.slice(i,o).trim(),f.map=[t,e.line],f.children=[];const h=e.push("heading_close","h"+String(a),-1);return h.markup="########".slice(0,a),!0}function DX(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,s,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let g=e.bMarks[a]+e.tShift[a];const x=e.eMarks[a];if(g<x&&(s=e.src.charCodeAt(g),(s===45||s===61)&&(g=e.skipChars(g,s),g=e.skipSpaces(g),g>=x))){o=s===61?1:2;break}}if(e.sCount[a]<0)continue;let m=!1;for(let g=0,x=r.length;g<x;g++)if(r[g](e,a,n,!0)){m=!0;break}if(m)break}if(!o)return!1;const u=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a+1;const c=e.push("heading_open","h"+String(o),1);c.markup=String.fromCharCode(s),c.map=[t,e.line];const f=e.push("inline","",0);f.content=u,f.map=[t,e.line-1],f.children=[];const h=e.push("heading_close","h"+String(o),-1);return h.markup=String.fromCharCode(s),e.parentType=i,!0}function OX(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let c=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,o,n,!0)){c=!0;break}if(c)break}const s=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const u=e.push("inline","",0);return u.content=s,u.map=[t,e.line],u.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}const qf=[["table",uX,["paragraph","reference"]],["code",cX],["fence",dX,["paragraph","reference","blockquote","list"]],["blockquote",fX,["paragraph","reference","blockquote","list"]],["hr",hX,["paragraph","reference","blockquote","list"]],["list",mX,["paragraph","reference","blockquote"]],["reference",gX],["html_block",NX,["paragraph","reference","blockquote"]],["heading",IX,["paragraph","reference","blockquote"]],["lheading",DX],["paragraph",OX]];function Kp(){this.ruler=new Vr;for(let e=0;e<qf.length;e++)this.ruler.push(qf[e][0],qf[e][1],{alt:(qf[e][2]||[]).slice()})}Kp.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting;let s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}const u=e.line;let c=!1;for(let f=0;f<i;f++)if(c=r[f](e,s,n,!1),c){if(u>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}};Kp.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)};Kp.prototype.State=co;function fd(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}fd.prototype.pushPending=function(){const e=new Ui("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};fd.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Ui(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};fd.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-e,a=o<n?this.src.charCodeAt(o):32,u=Kc(i)||Jc(String.fromCharCode(i)),c=Kc(a)||Jc(String.fromCharCode(a)),f=Zc(i),h=Zc(a),m=!h&&(!c||f||u),g=!f&&(!u||h||c);return{can_open:m&&(t||!g||u),can_close:g&&(t||!m||c),length:s}};fd.prototype.Token=Ui;function RX(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function PX(e,t){let n=e.pos;for(;n<e.posMax&&!RX(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const jX=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function zX(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(jX);if(!i)return!1;const o=i[1],s=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;let u=a.length;for(;u>0&&a.charCodeAt(u-1)===42;)u--;u!==a.length&&(a=a.slice(0,u));const c=e.md.normalizeLink(a);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const f=e.push("link_open","a",1);f.attrs=[["href",c]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(a);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=a.length-o.length,!0}function LX(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&nn(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const eb=[];for(let e=0;e<256;e++)eb.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){eb[e.charCodeAt(0)]=1});function FX(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),!!nn(i));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const a=e.push("text_special","",0);i<256&&eb[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return e.pos=n+1,!0}function $X(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(i,n),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=s),e.pos+=a,!0;let u=n,c;for(;(c=e.src.indexOf("`",u))!==-1;){for(u=c+1;u<o&&e.src.charCodeAt(u)===96;)u++;const f=u-c;if(f===a){if(!t){const h=e.push("code_inline","code",0);h.markup=s,h.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=u,!0}e.backticks[f]=c}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=a,!0}function BX(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=s,o--);for(let u=0;u<o;u+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function jS(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];if(s.marker!==126||s.end===-1)continue;const a=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const o=r.pop();let s=o+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[o],e.tokens[o]=n)}}function UX(e){const t=e.tokens_meta,n=e.tokens_meta.length;jS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&jS(e,t[r].delimiters)}const RA={tokenize:BX,postProcess:UX};function VX(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);for(let o=0;o<i.length;o++){const s=e.push("text","",0);s.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function zS(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],s=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=s?"strong_open":"em_open",u.tag=s?"strong":"em",u.nesting=1,u.markup=s?a+a:a,u.content="";const c=e.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?a+a:a,c.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function HX(e){const t=e.tokens_meta,n=e.tokens_meta.length;zS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&zS(e,t[r].delimiters)}const PA={tokenize:VX,postProcess:HX};function WX(e,t){let n,r,i,o,s="",a="",u=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,h=e.posMax,m=e.pos+1,g=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(g<0)return!1;let x=g+1;if(x<h&&e.src.charCodeAt(x)===40){for(c=!1,x++;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);if(x>=h)return!1;if(u=x,i=e.md.helpers.parseLinkDestination(e.src,x,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?x=i.pos:s="",u=x;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);if(i=e.md.helpers.parseLinkTitle(e.src,x,e.posMax),x<h&&u!==x&&i.ok)for(a=i.str,x=i.pos;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);}(x>=h||e.src.charCodeAt(x)!==41)&&(c=!0),x++}if(c){if(typeof e.env.references>"u")return!1;if(x<h&&e.src.charCodeAt(x)===91?(u=x+1,x=e.md.helpers.parseLinkLabel(e,x),x>=0?r=e.src.slice(u,x++):x=g+1):x=g+1,r||(r=e.src.slice(m,g)),o=e.env.references[Jp(r)],!o)return e.pos=f,!1;s=o.href,a=o.title}if(!t){e.pos=m,e.posMax=g;const b=e.push("link_open","a",1),k=[["href",s]];b.attrs=k,a&&k.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=x,e.posMax=h,!0}function qX(e,t){let n,r,i,o,s,a,u,c,f="";const h=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,x=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(x<0)return!1;if(o=x+1,o<m&&e.src.charCodeAt(o)===40){for(o++;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);if(o>=m)return!1;for(c=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?o=a.pos:f=""),c=o;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<m&&c!==o&&a.ok)for(u=a.str,o=a.pos;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);else u="";if(o>=m||e.src.charCodeAt(o)!==41)return e.pos=h,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<m&&e.src.charCodeAt(o)===91?(c=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(c,o++):o=x+1):o=x+1,i||(i=e.src.slice(g,x)),s=e.env.references[Jp(i)],!s)return e.pos=h,!1;f=s.href,u=s.title}if(!t){r=e.src.slice(g,x);const b=[];e.md.inline.parse(r,e.md,e.env,b);const k=e.push("image","img",0),C=[["src",f],["alt",""]];k.attrs=C,k.children=b,k.content=r,u&&C.push(["title",u])}return e.pos=o,e.posMax=m,!0}const ZX=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,JX=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function KX(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=e.src.slice(r+1,n);if(JX.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}if(ZX.test(o)){const s=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}return!1}function GX(e){return/^<a[>\s]/i.test(e)}function YX(e){return/^<\/a\s*>/i.test(e)}function QX(e){const t=e|32;return t>=97&&t<=122}function XX(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!QX(i))return!1;const o=e.src.slice(r).match(AX);if(!o)return!1;if(!t){const s=e.push("html_inline","",0);s.content=o[0],GX(s.content)&&e.linkLevel++,YX(s.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const eee=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,tee=/^&([a-z][a-z0-9]{1,31});/i;function nee(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(eee);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=e.push("text_special","",0);a.content=Qx(s)?gp(s):gp(65533),a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(tee);if(o){const s=TA(o[0]);if(s!==o[0]){if(!t){const a=e.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function LS(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const a=e[s];if(o.push(0),(e[r].marker!==a.marker||i!==a.token-1)&&(r=s),i=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=t[a.marker][(a.open?3:0)+a.length%3];let c=r-o[r]-1,f=c;for(;c>u;c-=o[c]+1){const h=e[c];if(h.marker===a.marker&&h.open&&h.end<0){let m=!1;if((h.close||a.open)&&(h.length+a.length)%3===0&&(h.length%3!==0||a.length%3!==0)&&(m=!0),!m){const g=c>0&&!e[c-1].open?o[c-1]+1:0;o[s]=s-c+g,o[c]=g,a.open=!1,h.end=s,h.close=!1,f=-1,i=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function ree(e){const t=e.tokens_meta,n=e.tokens_meta.length;LS(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&LS(t[r].delimiters)}function iee(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type==="text"&&t+1<o&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}const qg=[["text",PX],["linkify",zX],["newline",LX],["escape",FX],["backticks",$X],["strikethrough",RA.tokenize],["emphasis",PA.tokenize],["link",WX],["image",qX],["autolink",KX],["html_inline",XX],["entity",nee]],Zg=[["balance_pairs",ree],["strikethrough",RA.postProcess],["emphasis",PA.postProcess],["fragments_join",iee]];function hd(){this.ruler=new Vr;for(let e=0;e<qg.length;e++)this.ruler.push(qg[e][0],qg[e][1]);this.ruler2=new Vr;for(let e=0;e<Zg.length;e++)this.ruler2.push(Zg[e][0],Zg[e][1])}hd.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let s=!1;if(e.level<i){for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos};hd.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let s=!1;if(e.level<i){for(let a=0;a<n;a++)if(s=t[a](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};hd.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)};hd.prototype.State=fd;function oee(e){const t={};e=e||{},t.src_Any=wA.source,t.src_Cc=CA.source,t.src_Z=EA.source,t.src_P=Gx.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function dy(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function Gp(e){return Object.prototype.toString.call(e)}function see(e){return Gp(e)==="[object String]"}function aee(e){return Gp(e)==="[object Object]"}function lee(e){return Gp(e)==="[object RegExp]"}function FS(e){return Gp(e)==="[object Function]"}function uee(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const jA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function cee(e){return Object.keys(e||{}).reduce(function(t,n){return t||jA.hasOwnProperty(n)},!1)}const dee={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},fee="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hee="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function pee(e){e.__index__=-1,e.__text_cache__=""}function mee(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function $S(){return function(e,t){t.normalize(e)}}function yp(e){const t=e.re=oee(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(fee),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(a,u){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+u)}Object.keys(e.__schemas__).forEach(function(a){const u=e.__schemas__[a];if(u===null)return;const c={validate:null,link:null};if(e.__compiled__[a]=c,aee(u)){lee(u.validate)?c.validate=mee(u.validate):FS(u.validate)?c.validate=u.validate:o(a,u),FS(u.normalize)?c.normalize=u.normalize:u.normalize?o(a,u):c.normalize=$S();return}if(see(u)){i.push(a);return}o(a,u)}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:$S()};const s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(uee).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),pee(e)}function gee(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function fy(e,t){const n=new gee(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function ii(e,t){if(!(this instanceof ii))return new ii(e,t);t||cee(e)&&(t=e,e={}),this.__opts__=dy({},jA,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=dy({},dee,e),this.__compiled__={},this.__tlds__=hee,this.__tlds_replaced__=!1,this.re={},yp(this)}ii.prototype.add=function(t,n){return this.__schemas__[t]=n,yp(this),this};ii.prototype.set=function(t){return this.__opts__=dy(this.__opts__,t),this};ii.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,s,a,u,c,f;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(f=t.indexOf("@"),f>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};ii.prototype.pretest=function(t){return this.re.pretest.test(t)};ii.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};ii.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(fy(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(fy(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};ii.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,fy(this,0)):null};ii.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),yp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,yp(this),this)};ii.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ii.prototype.onCompile=function(){};const Il=2147483647,eo=36,tb=1,Gc=26,yee=38,xee=700,zA=72,LA=128,FA="-",bee=/^xn--/,vee=/[^\0-\x7F]/,kee=/[\x2E\u3002\uFF0E\uFF61]/g,wee={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Jg=eo-tb,to=Math.floor,Kg=String.fromCharCode;function vs(e){throw new RangeError(wee[e])}function Cee(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function $A(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(kee,".");const i=e.split("."),o=Cee(i,t).join(".");return r+o}function BA(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}const See=e=>String.fromCodePoint(...e),Eee=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:eo},BS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},UA=function(e,t,n){let r=0;for(e=n?to(e/xee):e>>1,e+=to(e/t);e>Jg*Gc>>1;r+=eo)e=to(e/Jg);return to(r+(Jg+1)*e/(e+yee))},VA=function(e){const t=[],n=e.length;let r=0,i=LA,o=zA,s=e.lastIndexOf(FA);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&vs("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const u=r;for(let f=1,h=eo;;h+=eo){a>=n&&vs("invalid-input");const m=Eee(e.charCodeAt(a++));m>=eo&&vs("invalid-input"),m>to((Il-r)/f)&&vs("overflow"),r+=m*f;const g=h<=o?tb:h>=o+Gc?Gc:h-o;if(m<g)break;const x=eo-g;f>to(Il/x)&&vs("overflow"),f*=x}const c=t.length+1;o=UA(r-u,c,u==0),to(r/c)>Il-i&&vs("overflow"),i+=to(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},HA=function(e){const t=[];e=BA(e);const n=e.length;let r=LA,i=0,o=zA;for(const u of e)u<128&&t.push(Kg(u));const s=t.length;let a=s;for(s&&t.push(FA);a<n;){let u=Il;for(const f of e)f>=r&&f<u&&(u=f);const c=a+1;u-r>to((Il-i)/c)&&vs("overflow"),i+=(u-r)*c,r=u;for(const f of e)if(f<r&&++i>Il&&vs("overflow"),f===r){let h=i;for(let m=eo;;m+=eo){const g=m<=o?tb:m>=o+Gc?Gc:m-o;if(h<g)break;const x=h-g,b=eo-g;t.push(Kg(BS(g+x%b,0))),h=to(x/b)}t.push(Kg(BS(h,0))),o=UA(i,c,a===s),i=0,++a}++i,++r}return t.join("")},_ee=function(e){return $A(e,function(t){return bee.test(t)?VA(t.slice(4).toLowerCase()):t})},Tee=function(e){return $A(e,function(t){return vee.test(t)?"xn--"+HA(t):t})},WA={version:"2.3.1",ucs2:{decode:BA,encode:See},decode:VA,encode:HA,toASCII:Tee,toUnicode:_ee},Aee={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Mee={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Nee={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},Iee={default:Aee,zero:Mee,commonmark:Nee},Dee=/^(vbscript|javascript|file|data):/,Oee=/^data:image\/(gif|png|jpeg|webp);/;function Ree(e){const t=e.trim().toLowerCase();return Dee.test(t)?Oee.test(t):!0}const qA=["http:","https:","mailto:"];function Pee(e){const t=Kx(e,!0);if(t.hostname&&(!t.protocol||qA.indexOf(t.protocol)>=0))try{t.hostname=WA.toASCII(t.hostname)}catch{}return dd(Jx(t))}function jee(e){const t=Kx(e,!0);if(t.hostname&&(!t.protocol||qA.indexOf(t.protocol)>=0))try{t.hostname=WA.toUnicode(t.hostname)}catch{}return Jl(Jx(t),Jl.defaultChars+"%")}function Hr(e,t){if(!(this instanceof Hr))return new Hr(e,t);t||Yx(e)||(t=e||{},e="default"),this.inline=new hd,this.block=new Kp,this.core=new Xx,this.renderer=new tu,this.linkify=new ii,this.validateLink=Ree,this.normalizeLink=Pee,this.normalizeLinkText=jee,this.utils=LQ,this.helpers=Zp({},UQ),this.options={},this.configure(e),t&&this.set(t)}Hr.prototype.set=function(e){return Zp(this.options,e),this};Hr.prototype.configure=function(e){const t=this;if(Yx(e)){const n=e;if(e=Iee[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Hr.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Hr.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Hr.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Hr.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Hr.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Hr.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Hr.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const zee=new lx({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Lee(e,t){if(e.isText&&t.isText&&qt.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class Fee{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:qt.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(t,n.marks),s;i&&(s=Lee(i,o))?r[r.length-1]=s:r.push(o)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let r=t[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,t,n)}}addNode(t,n,r){let i=this.top(),o=t.createAndFill(n,r,i?i.marks:[]);return o?(this.push(o),o):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:qt.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function qu(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function Gg(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function US(e){return e[e.length-1]==`
1396
- `?e.slice(0,e.length-1):e}function Yg(){}function $ee(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let o=e.nodeType(i.block);Gg(i,r)?n[r]=(s,a,u,c)=>{s.openNode(o,qu(i,a,u,c)),s.addText(US(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,u,c)=>s.openNode(o,qu(i,a,u,c)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=e.nodeType(i.node);n[r]=(s,a,u,c)=>s.addNode(o,qu(i,a,u,c))}else if(i.mark){let o=e.marks[i.mark];Gg(i,r)?n[r]=(s,a,u,c)=>{s.openMark(o.create(qu(i,a,u,c))),s.addText(US(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,u,c)=>s.openMark(o.create(qu(i,a,u,c))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)Gg(i,r)?n[r]=Yg:(n[r+"_open"]=Yg,n[r+"_close"]=Yg);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let Bee=class{constructor(t,n,r){this.schema=t,this.tokenizer=n,this.tokens=r,this.tokenHandlers=$ee(t,r)}parse(t,n={}){let r=new Fee(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(t,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function VS(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new Bee(zee,Hr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:VS(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:VS(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const Uee={open:"",close:"",mixable:!0};let Vee=class{constructor(t,n,r={}){this.nodes=t,this.marks=n,this.options=r}serialize(t,n={}){n=Object.assign({},this.options,n);let r=new ZA(this.nodes,this.marks,n);return r.renderContent(t),r.out}};const fo=new Vee({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+`
1397
- `),e.text(t.textContent,!1),e.write(`
1398
- `),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(" ",r+2);e.renderList(t,i,o=>{let s=String(n+o);return e.repeat(" ",r-s.length)+s+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("!["+e.esc(t.attrs.alt||"")+"]("+t.attrs.src.replace(/[\(\)]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
1399
- `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=Hee(t,n,r),e.inAutolink?"<":"["},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,r){return HS(n.child(r),-1)},close(e,t,n,r){return HS(n.child(r-1),1)},escape:!1}});function HS(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let o=i>0&&t>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&t<0&&(o+=" "),o}function Hee(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let ZA=class{constructor(t,n,r){this.nodes=t,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
1400
- `),t>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<t;i++)this.out+=n+`
1401
- `}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=Uee}return n}wrapBlock(t,n,r,i){let o=this.delim;this.write(n??t),this.delim+=t,i(),this.delim=o,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
1402
- `)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let r=t.split(`
1403
- `);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
1404
- `)}render(t,n,r){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,r,i)=>this.render(n,t,i))}renderInline(t,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,u)=>{let c=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(c=c.filter(b=>{if(u+1==t.childCount)return!1;let k=t.child(u+1);return b.isInSet(k.marks)&&(!k.isText||/\S/.test(k.text))}));let f=i;if(i="",s&&s.isText&&c.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!b.isInSet(r)})){let[b,k,C]=/^(\s*)(.*)$/m.exec(s.text);k&&(f+=k,s=C?s.withText(C):null,s||(c=r))}if(s&&s.isText&&c.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!this.isMarkAhead(t,u+1,b)})){let[b,k,C]=/^(.*?)(\s*)$/m.exec(s.text);C&&(i=C,s=k?s.withText(k):null,s||(c=r))}let h=c.length?c[c.length-1]:null,m=h&&this.getMark(h.type.name).escape===!1,g=c.length-(m?1:0);e:for(let b=0;b<g;b++){let k=c[b];if(!this.getMark(k.type.name).mixable)break;for(let C=0;C<r.length;C++){let _=r[C];if(!this.getMark(_.type.name).mixable)break;if(k.eq(_)){b>C?c=c.slice(0,C).concat(k).concat(c.slice(C,b)).concat(c.slice(b+1,g)):C>b&&(c=c.slice(0,b).concat(c.slice(b+1,C)).concat(k).concat(c.slice(C,g)));continue e}}}let x=0;for(;x<Math.min(r.length,g)&&c[x].eq(r[x]);)++x;for(;x<r.length;)this.text(this.markString(r.pop(),!1,t,u),!1);if(f&&this.text(f),s){for(;r.length<g;){let b=c[r.length];r.push(b),this.text(this.markString(b,!0,t,u),!1),this.atBlockStart=!1}m&&s.isText?this.text(this.markString(h,!0,t,u)+s.text+this.markString(h,!1,t,u+1),!1):this.render(s,t,u),this.atBlockStart=!1}s!=null&&s.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(o),o(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,r){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,t.forEach((s,a,u)=>{u&&i&&this.flushClose(1),this.wrapBlock(n,r(u),t,()=>this.render(s,t,u))}),this.inTightList=o}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<t.length&&t[i-1].match(/\w/)&&t[i+1].match(/\w/)?r:"\\"+r),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let r="";for(let i=0;i<n;i++)r+=t;return r}markString(t,n,r,i){let o=this.getMark(t.type.name),s=n?o.open:o.close;return typeof s=="string"?s:s(this,t,r,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,r){for(;;n++){if(n>=t.childCount)return!1;let i=t.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var Qg,WS;function Wee(){if(WS)return Qg;WS=1;var e=!0,t=!1,n=!1;Qg=function(b,k){k&&(e=!k.enabled,t=!!k.label,n=!!k.labelAfter),b.core.ruler.after("inline","github-task-lists",function(C){for(var _=C.tokens,E=2;E<_.length;E++)o(_,E)&&(s(_[E],C.Token),r(_[E-2],"class","task-list-item"+(e?"":" enabled")),r(_[i(_,E-2)],"class","contains-task-list"))})};function r(b,k,C){var _=b.attrIndex(k),E=[k,C];_<0?b.attrPush(E):b.attrs[_]=E}function i(b,k){for(var C=b[k].level-1,_=k-1;_>=0;_--)if(b[_].level===C)return _;return-1}function o(b,k){return h(b[k])&&m(b[k-1])&&g(b[k-2])&&x(b[k])}function s(b,k){if(b.children.unshift(a(b,k)),b.children[1].content=b.children[1].content.slice(3),b.content=b.content.slice(3),t)if(n){b.children.pop();var C="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);b.children[0].content=b.children[0].content.slice(0,-1)+' id="'+C+'">',b.children.push(f(b.content,C,k))}else b.children.unshift(u(k)),b.children.push(c(k))}function a(b,k){var C=new k("html_inline","",0),_=e?' disabled="" ':"";return b.content.indexOf("[ ] ")===0?C.content='<input class="task-list-item-checkbox"'+_+'type="checkbox">':(b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0)&&(C.content='<input class="task-list-item-checkbox" checked=""'+_+'type="checkbox">'),C}function u(b){var k=new b("html_inline","",0);return k.content="<label>",k}function c(b){var k=new b("html_inline","",0);return k.content="</label>",k}function f(b,k,C){var _=new C("html_inline","",0);return _.content='<label class="task-list-item-label" for="'+k+'">'+b+"</label>",_.attrs=[{for:k}],_}function h(b){return b.type==="inline"}function m(b){return b.type==="paragraph_open"}function g(b){return b.type==="list_item_open"}function x(b){return b.content.indexOf("[ ] ")===0||b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0}return Qg}var qee=Wee();const Zee=ja(qee);var Jee=Object.defineProperty,Kee=(e,t,n)=>t in e?Jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xp=(e,t,n)=>(Kee(e,typeof t!="symbol"?t+"":t,n),n);const Gee=fn.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const a=r.getAttributes(s);return i.updateAttributes(s,{tight:t??!(a!=null&&a.tight)})}return e.options.listTypes.some(s=>o(s))}}}}}),qS=Hr();function JA(e,t){return qS.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new qS.inline.State(e,null,null,[]).scanDelims(t,!0)}function KA(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function Yee(e,t,n,r){let i=n,o=e;for(;i<r&&!JA(o,i).can_open;)o=KA(o,t,i,1),i++;return{text:o,from:i,to:r}}function Qee(e,t,n,r){let i=r,o=e;for(;i>n&&!JA(o,i).can_close;)o=KA(o,t,i,-1),i--;return{text:o,from:n,to:i}}function Xee(e,t,n,r){let i={text:e,from:n,to:r};return i=Yee(i.text,t,i.from,i.to),i=Qee(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}class ete extends ZA{constructor(t,n,r){super(t,n,r??{}),xp(this,"inTable",!1),this.inlines=[]}render(t,n,r){super.render(t,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:o,start:s,end:a}=this.normalizeInline(i);this.out=Xee(this.out,o,s,a),this.inlines.pop()}}markString(t,n,r,i){const o=this.marks[t.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{const s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(t,n,r,i)}normalizeInline(t){let{start:n,end:r}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const GA=si.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,r;return this.editor.storage.markdown.options.html?(n=(r=ZS(t))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=ZS(t))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function ZS(e){const t=e.type.schema,n=t.text(" ",[e]),i=ld(me.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function nb(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function tte(e){return e==null?void 0:e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function nte(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function rte(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Yp=Kt.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(ite(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function ite(e,t){const n=e.type.schema,r=ld(me.from(e),n);return e.isBlock&&(t instanceof me||t.type.name===n.topNodeType.name)?ote(r):r}function ote(e){const n=nb(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
1405
- ${n.innerHTML}
1406
- `:`
1407
- `,n.outerHTML}const ste=Kt.create({name:"blockquote"}),ate=ste.extend({addStorage(){return{markdown:{serialize:fo.nodes.blockquote,parse:{}}}}}),lte=Kt.create({name:"bulletList"}),YA=lte.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),ute=Kt.create({name:"codeBlock"}),cte=ute.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
1408
- `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),dte=Kt.create({name:"hardBreak"}),QA=dte.extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?Yp.storage.markdown.serialize.call(this,e,t,n):`\\
1409
- `);return}},parse:{}}}}}),fte=Kt.create({name:"heading"}),hte=fte.extend({addStorage(){return{markdown:{serialize:fo.nodes.heading,parse:{}}}}}),pte=Kt.create({name:"horizontalRule"}),mte=pte.extend({addStorage(){return{markdown:{serialize:fo.nodes.horizontal_rule,parse:{}}}}}),gte=Kt.create({name:"image"}),yte=gte.extend({addStorage(){return{markdown:{serialize:fo.nodes.image,parse:{}}}}}),xte=Kt.create({name:"listItem"}),bte=xte.extend({addStorage(){return{markdown:{serialize:fo.nodes.list_item,parse:{}}}}}),vte=Kt.create({name:"orderedList"});function kte(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const wte=vte.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,o=String(i+t.childCount-1).length,s=e.repeat(" ",o+2),u=kte(t,n,r)%2?") ":". ";e.renderList(t,s,c=>{const f=String(i+c);return e.repeat(" ",o-f.length)+f+u})},parse:{}}}}}),Cte=Kt.create({name:"paragraph"}),Ste=Cte.extend({addStorage(){return{markdown:{serialize:fo.nodes.paragraph,parse:{}}}}});function Xg(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const Ete=Kt.create({name:"table"}),_te=Ete.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!Tte(t)){Yp.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,o)=>{if(e.write("| "),r.forEach((s,a,u)=>{u&&e.write(" | ");const c=s.firstChild;c.textContent.trim()&&e.renderInline(c)}),e.write(" |"),e.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${s} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function JS(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function Tte(e){const t=Xg(e),n=t[0],r=t.slice(1);return!(Xg(n).some(i=>i.type.name!=="tableHeader"||JS(i)||i.childCount>1)||r.some(i=>Xg(i).some(o=>o.type.name==="tableHeader"||JS(o)||o.childCount>1)))}const Ate=Kt.create({name:"taskItem"}),Mte=Ate.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Nte=Kt.create({name:"taskList"}),Ite=Nte.extend({addStorage(){return{markdown:{serialize:YA.storage.markdown.serialize,parse:{setup(e){e.use(Zee)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),Dte=Kt.create({name:"text"}),Ote=Dte.extend({addStorage(){return{markdown:{serialize(e,t){e.text(tte(t.text))},parse:{}}}}}),Rte=si.create({name:"bold"}),Pte=Rte.extend({addStorage(){return{markdown:{serialize:fo.marks.strong,parse:{}}}}}),jte=si.create({name:"code"}),zte=jte.extend({addStorage(){return{markdown:{serialize:fo.marks.code,parse:{}}}}}),Lte=si.create({name:"italic"}),Fte=Lte.extend({addStorage(){return{markdown:{serialize:fo.marks.em,parse:{}}}}}),$te=si.create({name:"link"}),Bte=$te.extend({addStorage(){return{markdown:{serialize:fo.marks.link,parse:{}}}}}),Ute=si.create({name:"strike"}),Vte=Ute.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),Hte=[ate,YA,cte,QA,hte,mte,Yp,yte,bte,wte,Ste,_te,Mte,Ite,Ote,Pte,zte,GA,Fte,Bte,Vte];function bp(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=Hte.find(o=>o.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class Wte{constructor(t){xp(this,"editor",null),this.editor=t}serialize(t){const n=new ete(this.nodes,this.marks,{hardBreakNodeName:QA.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Yp)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(GA)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=bp(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=bp(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class qte{constructor(t,n){xp(this,"editor",null),xp(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=t,this.md=this.withPatchedRenderer(Hr({html:r,linkify:i,breaks:o}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=bp(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(t),i=nb(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=bp(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(t,i),t}normalizeBlocks(t){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&nte(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,a;const u=t.firstElementChild,{nextElementSibling:c}=u,f=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",h=c?"":(s=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${h}`;return}rte(u),t.innerHTML=`${f}${t.innerHTML}${h}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
1410
- `?i:i[i.length-1]===`
1411
- `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const Zte=fn.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new yn({key:new jn("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return Ro.fromSchema(this.editor.schema).parseSlice(nb(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),Jte=fn.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=N6.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new qte(this.editor,this.options),serializer:new Wte(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[Gee.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),Zte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function Kte(){return Math.random().toString(36).substring(2,15)}function ic(e){const t=[];let n=e;for(;n&&n!==document.body;){let r=n.tagName.toLowerCase();if(n.id){r=`#${n.id}`,t.unshift(r);break}const i=n.parentElement;if(i){const o=Array.from(i.children).filter(s=>s.tagName===n.tagName);if(o.length>1){const s=o.indexOf(n)+1;r+=`:nth-of-type(${s})`}}t.unshift(r),n=n.parentElement}return t.join(" > ")}function hy(e){var r;const t=[];let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){let i=n.tagName.toLowerCase();if(n.id){t.unshift(`//*[@id="${n.id}"]`);break}const o=n.parentElement;if(o){const s=Array.from(o.children).filter(a=>a.tagName===n.tagName);if(s.length>1){const a=s.indexOf(n)+1;i+=`[${a}]`}}t.unshift(i),n=n.parentElement}return(r=t[0])!=null&&r.startsWith("//*[@id")||t.unshift(""),t.join("/")||"//"+e.tagName.toLowerCase()}function Gte(e){const{container:t,exclude:n=[],enabled:r=!0}=e,[i,o]=T.useState(null),[s,a]=T.useState(null),u=T.useRef(null),c=T.useCallback(b=>b.closest("[data-bobbin]")?!0:n.some(k=>b.matches(k)||b.closest(k)),[n]),f=T.useCallback(b=>({element:b,rect:b.getBoundingClientRect(),path:ic(b),xpath:hy(b),tagName:b.tagName.toLowerCase(),id:b.id||void 0,classList:Array.from(b.classList)}),[]),h=T.useCallback(b=>{if(!r)return;const k=document.elementFromPoint(b.clientX,b.clientY);if(!k||c(k)){o(null);return}if(t&&!t.contains(k)){o(null);return}o(f(k))},[r,t,c,f]),m=T.useCallback(b=>{!r||b.target.closest("[data-bobbin]")||i&&(b.preventDefault(),b.stopPropagation(),a(i),u.current=i.rect)},[r,i]),g=T.useCallback(()=>{a(null),o(null)},[]),x=T.useCallback(b=>{if(!b){g();return}a(f(b))},[f,g]);return T.useEffect(()=>{if(r)return document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("click",m,{capture:!0}),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("click",m,{capture:!0})}},[r,h,m]),T.useEffect(()=>{if(!s)return;const b=()=>{const k=s.element.getBoundingClientRect();a(C=>C?{...C,rect:k}:null)};return window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[s==null?void 0:s.element]),{hoveredElement:i,selectedElement:s,selectElement:x,clearSelection:g,lastRect:u.current}}function Yte(){const[e,t]=T.useState([]),n=T.useRef([]),r=T.useRef(new Map),i=T.useCallback((x,b,k)=>{r.current.has(x)||r.current.set(x,new Map);const C=r.current.get(x);C.has(b)||C.set(b,k)},[]),o=T.useCallback(x=>{const b={...x,id:Kte(),timestamp:Date.now()};return t(k=>[...k,b]),n.current.push(b),b},[]),s=T.useCallback((x,b,k,C,_,E)=>(i(x,C,E),o({type:"style",target:{path:x,xpath:b,tagName:k},before:{property:C,value:E},after:{property:C,value:_}})),[o,i]),a=T.useCallback((x,b,k,C,_)=>o({type:"text",target:{path:x,xpath:b,tagName:k},before:C,after:_}),[o]),u=T.useCallback((x,b,k,C,_,E,I)=>o({type:"move",target:{path:x,xpath:b,tagName:k},before:{parent:C,index:_},after:{parent:E,index:I}}),[o]),c=T.useCallback((x,b,k,C,_,E,I)=>o({type:x,target:{path:b,xpath:k,tagName:C},before:_,after:E,metadata:I}),[o]),f=T.useCallback(()=>{if(e.length===0)return null;const x=e[e.length-1];return t(b=>b.slice(0,-1)),x},[e]),h=T.useCallback(()=>{t([]),r.current.clear()},[]),m=T.useCallback(()=>[...e],[e]),g=T.useMemo(()=>{var b;const x=new Map;for(const k of e){let C;if(k.type==="style"){const _=k;C=`${k.target.path}:style:${_.after.property}`}else C=`${k.target.path}:${k.type}:${k.id}`;if(k.type==="style"){const _=k;if(((b=r.current.get(k.target.path))==null?void 0:b.get(_.after.property))===_.after.value){x.delete(C);continue}}x.set(C,k)}return Array.from(x.values())},[e]);return{changes:e,deduplicatedChanges:g,changeCount:g.length,recordStyleChange:s,recordTextChange:a,recordMoveChange:u,recordChange:c,undo:f,clearChanges:h,getChanges:m,originalStates:r.current}}function Qte(){const[e,t]=T.useState(null),n=T.useCallback(i=>{t(i)},[]),r=T.useCallback(()=>{t(null)},[]);return{copied:e,copy:n,clear:r,hasCopied:e!==null}}function XA(e,t=[]){const n={version:"1.0",timestamp:new Date().toISOString(),changeCount:e.length+t.length,changes:e.map(r=>{const i={type:r.type,target:r.target.path,xpath:r.target.xpath};switch(r.type){case"style":return{...i,property:r.before.property,before:r.before.value,after:r.after.value};case"text":return{...i,before:r.before,after:r.after};case"move":return{...i,before:`${r.before.parent}[${r.before.index}]`,after:`${r.after.parent}[${r.after.index}]`};default:return{...i,before:JSON.stringify(r.before),after:JSON.stringify(r.after)}}}),annotations:t.map(r=>({type:"annotation",target:r.elementPath,xpath:r.elementXpath,note:r.content}))};return py(n)}function py(e,t=0){const n=" ".repeat(t);if(e==null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return/[\n:{}[\],&*#?|\-<>=!%@`]/.test(e)||e.trim()!==e?`"${e.replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`:e||'""';if(Array.isArray(e))return e.length===0?"[]":e.map(r=>{const i=py(r,t+1);return typeof r=="object"&&r!==null?`${n}- ${i.trimStart()}`:`${n}- ${i}`}).join(`
1412
- `);if(typeof e=="object"){const r=Object.entries(e);return r.length===0?"{}":r.map(([i,o])=>{const s=py(o,t+1);return typeof o=="object"&&o!==null&&!Array.isArray(o)?`${n}${i}:
1413
- ${s}`:Array.isArray(o)&&o.length>0?`${n}${i}:
1414
- ${s}`:`${n}${i}: ${s}`}).join(`
1415
- `)}return String(e)}var Xte={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},ene={px:"1px",0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},tne={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},nne={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},rne={sans:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',serif:'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',mono:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'},ine={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},one={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},sne={none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},ane={0:"0px",DEFAULT:"1px",2:"2px",4:"4px",8:"8px"},lne={sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},une={colors:Xte,spacing:ene,fontSize:tne,fontWeight:nne,fontFamily:rne,borderRadius:sne,borderWidth:ane,boxShadow:lne,lineHeight:ine,letterSpacing:one};function KS(e,t,n){e.style.setProperty(t,n)}function GS(e,t){t?(e.contentEditable="true",e.querySelectorAll("p, span, h1, h2, h3, h4, h5, h6, a, li, td, th, label, div").forEach(r=>{var i;if(r instanceof HTMLElement&&r.childNodes.length>0){for(const o of r.childNodes)if(o.nodeType===Node.TEXT_NODE&&((i=o.textContent)!=null&&i.trim())){r.contentEditable="true";break}}})):(e.contentEditable="false",e.querySelectorAll('[contenteditable="true"]').forEach(r=>{r instanceof HTMLElement&&(r.contentEditable="false")}))}function cne(e={}){const{tokens:t,container:n,defaultActive:r=!1,onChanges:i,onSelect:o,exclude:s=[]}=e,[a,u]=T.useState(r),[c,f]=T.useState(!1),[h,m]=T.useState([]),[g,x]=T.useState(!1),[b,k]=T.useState("style"),[C,_]=T.useState("system"),E=T.useMemo(()=>({...une,...t}),[t]),{hoveredElement:I,selectedElement:N,selectElement:M,clearSelection:j}=Gte({container:n,exclude:[...s,"[data-bobbin]"],enabled:a}),O=Yte(),R=Qte();T.useEffect(()=>{if(N)return GS(N.element,!0),()=>GS(N.element,!1)},[N]),T.useEffect(()=>{i==null||i(O.changes)},[O.changes,i]),T.useEffect(()=>{o==null||o(N)},[N,o]),T.useEffect(()=>{const _e=document.documentElement;if(C==="dark")_e.classList.add("dark"),_e.style.colorScheme="dark";else if(C==="light")_e.classList.remove("dark"),_e.style.colorScheme="light";else{const Pe=window.matchMedia("(prefers-color-scheme: dark)").matches;_e.classList.toggle("dark",Pe),_e.style.colorScheme=Pe?"dark":"light"}},[C]);const F=T.useCallback(()=>u(!0),[]),ee=T.useCallback(()=>{u(!1),j()},[j]),X=T.useCallback((_e,Pe)=>{if(!N)return;const Ee=N.element,$e=getComputedStyle(Ee).getPropertyValue(_e);KS(Ee,_e,Pe),O.recordStyleChange(N.path,N.xpath,N.tagName,_e,Pe,$e)},[N,O]),Se=T.useCallback(()=>{if(!N)return;const _e=N.element;_e.parentElement&&(O.recordChange("delete",N.path,N.xpath,N.tagName,_e.outerHTML,null),_e.remove(),j())},[N,O,j]),ue=T.useCallback((_e,Pe)=>{if(!N)return;const Ee=N.element,$e=Ee.parentElement;if(!$e)return;const xt=Array.from($e.children).indexOf(Ee),on=ic($e),Yn=ic(_e);if(Pe>=_e.children.length)_e.appendChild(Ee);else{const Qn=_e.children[Pe]??null;_e.insertBefore(Ee,Qn)}O.recordMoveChange(N.path,N.xpath,N.tagName,on,xt,Yn,Pe)},[N,O]),$=T.useCallback(()=>{if(!N)return;const _e=N.element,Pe=_e.cloneNode(!0),Ee=_e.parentElement;Ee&&Ee.insertBefore(Pe,_e.nextSibling),O.recordChange("duplicate",N.path,N.xpath,N.tagName,null,Pe.outerHTML),M(Pe)},[N,O,M]),Q=T.useCallback((_e,Pe="")=>{var xt,on;if(!N)return;const Ee=N.element,$e=document.createElement("span");$e.textContent=Pe||"​",$e.contentEditable="true",_e==="child"?Ee.appendChild($e):_e==="before"?(xt=Ee.parentElement)==null||xt.insertBefore($e,Ee):(on=Ee.parentElement)==null||on.insertBefore($e,Ee.nextSibling),O.recordChange("insert",ic($e),hy($e),"span",null,$e.outerHTML,{direction:_e}),M($e)},[N,O,M]),he=T.useCallback(()=>{N&&R.copy(N)},[N,R]),te=T.useCallback(_e=>{var $e,xt;if(!N||!R.copied)return;const Pe=N.element,Ee=R.copied.element.cloneNode(!0);_e==="child"?Pe.appendChild(Ee):_e==="before"?($e=Pe.parentElement)==null||$e.insertBefore(Ee,Pe):(xt=Pe.parentElement)==null||xt.insertBefore(Ee,Pe.nextSibling),O.recordChange("insert",ic(Ee),hy(Ee),Ee.tagName.toLowerCase(),null,Ee.outerHTML,{source:"paste",direction:_e}),M(Ee)},[N,R,O,M]),Me=T.useCallback(_e=>{N&&m(Pe=>{const Ee=Pe.findIndex($e=>$e.elementPath===N.path);if(Ee>=0){const $e=Pe[Ee];if(!$e)return Pe;if(!_e.trim())return Pe.filter((on,Yn)=>Yn!==Ee);const xt=[...Pe];return xt[Ee]={id:$e.id,elementPath:$e.elementPath,elementXpath:$e.elementXpath,content:_e,createdAt:Date.now()},xt}else if(_e.trim()){const $e={id:crypto.randomUUID(),elementPath:N.path,elementXpath:N.xpath,content:_e,createdAt:Date.now()};return[...Pe,$e]}return Pe})},[N]),D=T.useCallback(()=>{x(_e=>!_e)},[]),W=T.useCallback(()=>{_(_e=>_e==="light"?"dark":_e==="dark"?"system":"light")},[]),oe=T.useCallback(()=>{const _e=O.undo();_e&&console.log("Undoing:",_e)},[O]),P=T.useCallback(()=>{const _e=O.originalStates;for(const[Pe,Ee]of _e.entries()){const $e=document.querySelector(Pe);if($e)for(const[xt,on]of Ee.entries())KS($e,xt,on)}O.clearChanges()},[O]),tt=T.useCallback(()=>XA(O.deduplicatedChanges,h),[O.deduplicatedChanges,h]),U={isActive:a,isPillExpanded:c,hoveredElement:I,selectedElement:N,changes:O.deduplicatedChanges,annotations:h,clipboard:R.copied,showMarginPadding:g,activePanel:b,theme:C},ke={activate:F,deactivate:ee,selectElement:M,clearSelection:j,applyStyle:X,deleteElement:Se,moveElement:ue,duplicateElement:$,insertElement:Q,copyElement:he,pasteElement:te,annotate:Me,toggleMarginPadding:D,toggleTheme:W,undo:oe,exportChanges:tt,getChanges:O.getChanges,resetChanges:P};return{...U,...ke,tokens:E,setActivePanel:k,setIsPillExpanded:f}}var dne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),v.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]}),fne=()=>v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("path",{d:"M12 20h9"}),v.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]});function hne({state:e,actions:t,position:n,container:r,zIndex:i=9999}){const[o,s]=T.useState(!1),[a,u]=T.useState(!1),[c,f]=T.useState(null),h=n??{bottom:16,right:16};T.useLayoutEffect(()=>{if(!r){f(null);return}const b=()=>{const C=r.getBoundingClientRect();f({bottom:window.innerHeight-C.bottom+h.bottom,right:window.innerWidth-C.right+h.right})};b();const k=new ResizeObserver(b);return k.observe(r),window.addEventListener("scroll",b,!0),()=>{k.disconnect(),window.removeEventListener("scroll",b,!0)}},[r,h.bottom,h.right]);const m=c??h,g=()=>{e.isActive?t.deactivate():t.activate()},x=b=>{b.stopPropagation();const k=t.exportChanges();navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),1500)};return v.jsxs("div",{"data-bobbin":"pill",className:"bobbin-pill",style:{position:"fixed",bottom:m.bottom,right:m.right,zIndex:i,display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"9999px",backgroundColor:e.isActive?"#18181b":"#fafafa",color:e.isActive?"#fafafa":"#18181b",border:"1px solid #e4e4e7",cursor:"pointer",boxShadow:"0 1px 2px 0 rgb(0 0 0 / 0.05)",transition:"all 0.15s ease",userSelect:"none",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},onClick:g,children:[v.jsx(fne,{}),(e.changes.length>0||e.annotations.length>0)&&v.jsxs("button",{onClick:x,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{display:"flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"9999px",backgroundColor:e.isActive?"#fafafa":"#18181b",color:e.isActive?"#18181b":"#fafafa",fontSize:"11px",fontWeight:500,border:"none",cursor:"pointer",transition:"all 0.1s ease"},title:"Copy changes as YAML",children:[v.jsx("span",{children:e.changes.length+e.annotations.length}),o&&v.jsx(dne,{}),a&&v.jsx("span",{style:{fontSize:"10px"},children:"✓"})]}),e.clipboard&&v.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:e.isActive?"#fafafa":"#18181b",border:"1px solid #a1a1aa"},title:"Element copied"})]})}function pne({hoveredElement:e,selectedElement:t,offset:n=4,zIndex:r=9998}){const[i,o]=T.useState(null),[s,a]=T.useState(null);T.useLayoutEffect(()=>{if(!e||e===t){o(null);return}o(e.rect)},[e,t]),T.useLayoutEffect(()=>{if(!t){a(null);return}a(t.rect)},[t]);const u=(c,f)=>c?{position:"fixed",top:c.top-n,left:c.left-n,width:c.width+n*2,height:c.height+n*2,border:f?"1.5px solid #18181b":"1.5px dashed #71717a",borderRadius:"3px",pointerEvents:"none",zIndex:r,transition:"all 0.12s cubic-bezier(0.4, 0, 0.2, 1)",opacity:1,boxShadow:f?"0 0 0 1px rgba(24, 24, 27, 0.1)":"none"}:{opacity:0,pointerEvents:"none"};return v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-bobbin":"hover-overlay",style:u(i,!1)}),v.jsx("div",{"data-bobbin":"select-overlay",style:u(s,!0)})]})}function mne(e){const t=e.parentElement;if(!t)return"unknown";const n=getComputedStyle(t),r=n.display,i=n.flexDirection;return r.includes("flex")?i==="column"||i==="column-reverse"?"vertical":"horizontal":r.includes("grid")?"horizontal":"vertical"}var gne=60,YS=70,xl=18,Zf=28;function yne({selectedElement:e,actions:t,clipboard:n,zIndex:r=9999}){const[i,o]=T.useState(null),[s,a]=T.useState(null),[u,c]=T.useState(!1),[f,h]=T.useState(null),[m,g]=T.useState(!1);T.useRef(null);const{rect:x}=e,b=T.useMemo(()=>mne(e.element),[e.element]);x.width<gne,x.height<YS,x.width<YS,T.useEffect(()=>{g(!1),a(null),o(null)},[e.path]);const k=()=>v.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})}),C=()=>v.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),v.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]}),_=()=>v.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("polyline",{points:"5 9 2 12 5 15"}),v.jsx("polyline",{points:"9 5 12 2 15 5"}),v.jsx("polyline",{points:"15 19 12 22 9 19"}),v.jsx("polyline",{points:"19 9 22 12 19 15"}),v.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),v.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"})]}),E=()=>v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("path",{d:"M12 5v14M5 12h14"})}),I=()=>v.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),v.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"})]}),N=()=>v.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),v.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"})]});T.useEffect(()=>{if(!m&&!s)return;const $=he=>{he.target.closest('[data-bobbin="control-handles"]')||(g(!1),a(null))},Q=setTimeout(()=>{document.addEventListener("mousedown",$)},0);return()=>{clearTimeout(Q),document.removeEventListener("mousedown",$)}},[m,s]);const M=T.useCallback($=>{if(!u)return;const he=document.elementsFromPoint($.clientX,$.clientY).find(te=>!te.hasAttribute("data-bobbin")&&te!==e.element&&!e.element.contains(te)&&te instanceof HTMLElement&&te.tagName!=="HTML"&&te.tagName!=="BODY");he!==f&&(f&&(f.style.outline="",f.style.outlineOffset=""),he&&(he.style.outline="2px dashed #3b82f6",he.style.outlineOffset="2px"),h(he||null))},[u,f,e.element]),j=T.useCallback(()=>{if(u&&f){const $=f.parentElement;if($){const Q=Array.from($.children).indexOf(f)+1;t.moveElement($,Q)}f.style.outline="",f.style.outlineOffset=""}c(!1),h(null)},[u,f,t]);T.useEffect(()=>(u&&(document.addEventListener("mousemove",M),document.addEventListener("mouseup",j),document.body.style.cursor="grabbing"),()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",j),document.body.style.cursor="",f&&(f.style.outline="",f.style.outlineOffset="")}),[u,M,j,f]);const O=$=>{const Q=$==="top"||$==="bottom",he={position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",gap:"3px",zIndex:r,transition:"opacity 0.1s ease",pointerEvents:"auto"};return Q?{...he,left:x.left,width:x.width,height:Zf,top:$==="top"?x.top-Zf:x.bottom,flexDirection:"row"}:{...he,top:x.top,height:x.height,width:Zf,left:$==="left"?x.left-Zf:x.right,flexDirection:"column"}},R=({icon:$,onClick:Q,title:he,visible:te})=>{const[Me,D]=T.useState(!1);return te?v.jsx("button",{style:{width:xl,height:xl,borderRadius:"3px",backgroundColor:Me?"#27272a":"#18181b",color:"#fafafa",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.2)",pointerEvents:"auto",flexShrink:0},onClick:W=>{W.stopPropagation(),W.preventDefault(),Q()},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),title:he,children:$}):null},F=()=>{const[$,Q]=T.useState(!1);return v.jsx("button",{style:{width:xl,height:xl,borderRadius:"3px",backgroundColor:$?"#27272a":"#18181b",color:"#fafafa",border:"none",cursor:u?"grabbing":"grab",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.2)",pointerEvents:"auto",flexShrink:0},onMouseDown:he=>{he.stopPropagation(),he.preventDefault(),c(!0)},onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),title:"Move element (drag to new location)",children:v.jsx(_,{})})},ee=({position:$})=>{const Q=X($),te=$==="top"||$==="bottom"?v.jsx("div",{style:{width:"1px",height:xl,backgroundColor:"#3f3f46",margin:"0 2px"}}):v.jsx("div",{style:{height:"1px",width:xl,backgroundColor:"#3f3f46",margin:"2px 0"}});return v.jsxs(v.Fragment,{children:[$==="top"&&v.jsxs(v.Fragment,{children:[v.jsx(R,{icon:v.jsx(k,{}),onClick:()=>t.deleteElement(),title:"Delete element",visible:!0}),v.jsx(R,{icon:v.jsx(C,{}),onClick:()=>t.copyElement(),title:"Copy element",visible:!0}),te]}),v.jsx(R,{icon:v.jsx(E,{}),onClick:()=>t.insertElement(Q),title:`Add text ${Q}`,visible:!0}),v.jsx(R,{icon:v.jsx(N,{}),onClick:()=>t.pasteElement(Q),title:`Paste ${Q}`,visible:!!n}),v.jsx(R,{icon:v.jsx(I,{}),onClick:t.duplicateElement,title:"Duplicate element",visible:!0}),$==="top"&&v.jsxs(v.Fragment,{children:[te,v.jsx(F,{})]})]})},X=$=>b==="horizontal"?$==="left"?"before":"after":$==="top"?"before":"after",[Se,ue]=T.useState(null);return v.jsx("div",{"data-bobbin":"control-handles",style:{pointerEvents:"none"},children:["top","bottom","left","right"].map($=>{const Q=i===$;return v.jsx("div",{style:O($),onMouseEnter:()=>o($),onMouseLeave:()=>o(null),children:Q&&v.jsx(ee,{position:$})},$)})})}function xne({selectedElement:e,zIndex:t=9997}){const{element:n,rect:r}=e,i=window.getComputedStyle(n),o={top:parseFloat(i.marginTop)||0,right:parseFloat(i.marginRight)||0,bottom:parseFloat(i.marginBottom)||0,left:parseFloat(i.marginLeft)||0},s={top:parseFloat(i.paddingTop)||0,right:parseFloat(i.paddingRight)||0,bottom:parseFloat(i.paddingBottom)||0,left:parseFloat(i.paddingLeft)||0},a=parseFloat(i.gap)||0,u=parseFloat(i.rowGap)||a,c=parseFloat(i.columnGap)||a,f=i.display,h=i.flexDirection,m=f.includes("flex")||f.includes("grid"),g=h==="column"||h==="column-reverse",x="rgba(251, 146, 60, 0.3)",b="rgba(74, 222, 128, 0.3)",k="rgba(168, 85, 247, 0.35)",_=(()=>{if(!m||u===0&&c===0)return[];const E=Array.from(n.children).filter(N=>N instanceof HTMLElement&&getComputedStyle(N).display!=="none"&&getComputedStyle(N).visibility!=="hidden");if(E.length<2)return[];const I=[];for(let N=0;N<E.length-1;N++){const M=E[N],j=E[N+1];if(!M||!j)continue;const O=M.getBoundingClientRect(),R=j.getBoundingClientRect();if((g||f.includes("grid"))&&u>0&&R.top>O.bottom){const F=O.bottom,ee=Math.min(u,R.top-O.bottom);ee>0&&I.push({top:F,left:r.left+s.left,width:r.width-s.left-s.right,height:ee})}if((!g||f.includes("grid"))&&c>0&&R.left>O.right){const F=O.right,ee=Math.min(c,R.left-O.right);ee>0&&I.push({top:r.top+s.top,left:F,width:ee,height:r.height-s.top-s.bottom})}}return I})();return v.jsxs("div",{"data-bobbin":"margin-padding-overlay",style:{position:"fixed",top:0,left:0,zIndex:t,pointerEvents:"none"},children:[o.top>0&&v.jsx("div",{style:{position:"fixed",top:r.top-o.top,left:r.left,width:r.width,height:o.top,backgroundColor:x}}),o.bottom>0&&v.jsx("div",{style:{position:"fixed",top:r.bottom,left:r.left,width:r.width,height:o.bottom,backgroundColor:x}}),o.left>0&&v.jsx("div",{style:{position:"fixed",top:r.top,left:r.left-o.left,width:o.left,height:r.height,backgroundColor:x}}),o.right>0&&v.jsx("div",{style:{position:"fixed",top:r.top,left:r.right,width:o.right,height:r.height,backgroundColor:x}}),s.top>0&&v.jsx("div",{style:{position:"fixed",top:r.top,left:r.left,width:r.width,height:s.top,backgroundColor:b}}),s.bottom>0&&v.jsx("div",{style:{position:"fixed",top:r.bottom-s.bottom,left:r.left,width:r.width,height:s.bottom,backgroundColor:b}}),s.left>0&&v.jsx("div",{style:{position:"fixed",top:r.top+s.top,left:r.left,width:s.left,height:r.height-s.top-s.bottom,backgroundColor:b}}),s.right>0&&v.jsx("div",{style:{position:"fixed",top:r.top+s.top,left:r.right-s.right,width:s.right,height:r.height-s.top-s.bottom,backgroundColor:b}}),_.map((E,I)=>v.jsx("div",{style:{position:"fixed",top:E.top,left:E.left,width:E.width,height:E.height,backgroundColor:k}},`gap-${I}`))]})}function Va({title:e,expanded:t,onToggle:n,children:r,hasChanges:i=!1}){return v.jsxs("div",{style:{borderBottom:"1px solid #f4f4f5"},children:[v.jsxs("button",{onClick:n,style:{width:"100%",padding:"8px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:i?"#eff6ff":"transparent",border:"none",cursor:"pointer",color:"#18181b",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.05em"},children:[v.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[e,i&&v.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#3b82f6"},title:"Has unsaved changes"})]}),v.jsx("span",{style:{fontSize:"10px",color:"#a1a1aa"},children:t?"▲":"▼"})]}),t&&v.jsx("div",{style:{padding:"0 12px 12px"},children:r})]})}function oc({value:e,options:t,onChange:n}){return v.jsx("div",{style:{display:"flex",gap:"2px"},children:t.map(r=>v.jsx("button",{onClick:()=>n(r.value),style:{flex:1,padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:e===r.value?"#18181b":"#ffffff",color:e===r.value?"#fafafa":"#71717a",cursor:"pointer",fontSize:"10px",fontWeight:500,transition:"all 0.1s ease",display:"flex",alignItems:"center",justifyContent:"center"},children:r.label},r.value))})}function vp({value:e,tokens:t,onChange:n,placeholder:r="Select..."}){return v.jsxs("select",{value:e,onChange:i=>n(i.target.value),style:{width:"100%",padding:"4px 8px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#18181b",fontSize:"11px",cursor:"pointer",outline:"none"},children:[v.jsx("option",{value:"",children:r}),Object.entries(t).map(([i,o])=>v.jsxs("option",{value:o,children:[i,": ",o]},i))]})}var bne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),v.jsx("polyline",{points:"12 5 19 12 12 19"})]}),vne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),v.jsx("polyline",{points:"12 19 5 12 12 5"})]}),kne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),v.jsx("polyline",{points:"19 12 12 19 5 12"})]}),wne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),v.jsx("polyline",{points:"5 12 12 5 19 12"})]}),Cne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"4",x2:"3",y2:"20"}),v.jsx("rect",{x:"7",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"13",y:"8",width:"4",height:"8",rx:"1"})]}),Sne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"6",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"14",y:"8",width:"4",height:"8",rx:"1"})]}),Ene=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"21",y1:"4",x2:"21",y2:"20"}),v.jsx("rect",{x:"7",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"13",y:"8",width:"4",height:"8",rx:"1"})]}),_ne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"4",x2:"3",y2:"20"}),v.jsx("line",{x1:"21",y1:"4",x2:"21",y2:"20"}),v.jsx("rect",{x:"6",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"14",y:"8",width:"4",height:"8",rx:"1"})]}),Tne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"4",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"10",y:"8",width:"4",height:"8",rx:"1"}),v.jsx("rect",{x:"16",y:"8",width:"4",height:"8",rx:"1"})]}),Ane=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"4",y1:"3",x2:"20",y2:"3"}),v.jsx("rect",{x:"6",y:"6",width:"4",height:"10",rx:"1"}),v.jsx("rect",{x:"14",y:"6",width:"4",height:"6",rx:"1"})]}),Mne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),v.jsx("rect",{x:"14",y:"7",width:"4",height:"10",rx:"1"})]}),Nne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"}),v.jsx("rect",{x:"6",y:"8",width:"4",height:"10",rx:"1"}),v.jsx("rect",{x:"14",y:"12",width:"4",height:"6",rx:"1"})]}),Ine=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"4",y1:"3",x2:"20",y2:"3"}),v.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"}),v.jsx("rect",{x:"6",y:"6",width:"4",height:"12",rx:"1"}),v.jsx("rect",{x:"14",y:"6",width:"4",height:"12",rx:"1"})]});function Dne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.display,a=n.flexDirection,u=n.justifyContent,c=n.alignItems,f=n.gap,h=s==="flex"||s==="inline-flex",m=s==="grid"||s==="inline-grid";return v.jsxs(Va,{title:"Layout",expanded:e,onToggle:t,hasChanges:o,children:[v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Display"}),v.jsx(oc,{value:s,options:[{value:"block",label:"Block"},{value:"flex",label:"Flex"},{value:"grid",label:"Grid"},{value:"inline",label:"Inline"},{value:"none",label:"None"}],onChange:g=>r("display",g)})]}),h&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Direction"}),v.jsx(oc,{value:a,options:[{value:"row",label:v.jsx(bne,{})},{value:"row-reverse",label:v.jsx(vne,{})},{value:"column",label:v.jsx(kne,{})},{value:"column-reverse",label:v.jsx(wne,{})}],onChange:g=>r("flex-direction",g)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Justify"}),v.jsx(oc,{value:u,options:[{value:"flex-start",label:v.jsx(Cne,{})},{value:"center",label:v.jsx(Sne,{})},{value:"flex-end",label:v.jsx(Ene,{})},{value:"space-between",label:v.jsx(_ne,{})},{value:"space-around",label:v.jsx(Tne,{})}],onChange:g=>r("justify-content",g)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Align"}),v.jsx(oc,{value:c,options:[{value:"flex-start",label:v.jsx(Ane,{})},{value:"center",label:v.jsx(Mne,{})},{value:"flex-end",label:v.jsx(Nne,{})},{value:"stretch",label:v.jsx(Ine,{})}],onChange:g=>r("align-items",g)})]})]}),(h||m)&&v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Gap"}),v.jsx(vp,{value:f,tokens:i.spacing,onChange:g=>r("gap",g)})]})]})}var QS=({linked:e})=>v.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:e?1:.4},children:e?v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),v.jsx("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),v.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}):v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),v.jsx("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),v.jsx("line",{x1:"8",y1:"12",x2:"10",y2:"12"}),v.jsx("line",{x1:"14",y1:"12",x2:"16",y2:"12"})]})});function One(e){return!e||e.trim()===""?!0:[/^-?\d+(\.\d+)?(px|em|rem|%|vh|vw|pt|cm|mm|in|pc)?$/i,/^auto$/i,/^inherit$/i,/^initial$/i,/^unset$/i,/^0$/].some(n=>n.test(e.trim()))}function XS({values:e,onChange:t,label:n,hasChanges:r={}}){const[i,o]=T.useState(null),[s,a]=T.useState(""),[u,c]=T.useState(!1),[f,h]=T.useState(!1),[m,g]=T.useState(null),x=T.useRef(null);T.useEffect(()=>{i&&x.current&&(x.current.focus(),x.current.select())},[i]);const b=T.useCallback((R,F)=>{t(R,F),u&&(R==="top"||R==="bottom")&&t(R==="top"?"bottom":"top",F),f&&(R==="left"||R==="right")&&t(R==="left"?"right":"left",F)},[t,u,f]),k=(R,F)=>{F.stopPropagation(),o(R),a(e[R]),u&&(R==="top"||R==="bottom")?g("vertical"):f&&(R==="left"||R==="right")&&g("horizontal")},C=R=>{a(R),i&&b(i,R)},_=()=>{o(null),g(null)},E=R=>{(R.key==="Enter"||R.key==="Escape")&&(o(null),g(null))},I=R=>{const F=R.match(/^([\d.]+)/);return F?F[1]:R||"0"},N=R=>m?m==="vertical"&&(R==="top"||R==="bottom")||m==="horizontal"&&(R==="left"||R==="right"):!1,M=R=>{const F=i===R,ee=N(R),X=F?One(s):!0,Se=r[R];return{padding:F?"0":"2px 4px",borderRadius:"3px",border:`1px solid ${X?Se?"#3b82f6":ee?"#8b5cf6":F?"#18181b":"#e4e4e7":"#ef4444"}`,backgroundColor:X?Se?"#eff6ff":ee?"#f5f3ff":"#ffffff":"#fef2f2",color:"#18181b",fontSize:"9px",textAlign:"center",cursor:"text",minWidth:"28px",transition:"all 0.1s ease",outline:"none"}},j=R=>({padding:"2px 4px",borderRadius:"3px",border:`1px solid ${R?"#8b5cf6":"#e4e4e7"}`,backgroundColor:R?"#f5f3ff":"#ffffff",color:R?"#8b5cf6":"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease"}),O=(R,F)=>{const ee=i===R;return v.jsx("div",{style:{position:"absolute",...F},children:ee?v.jsx("input",{ref:x,type:"text",value:s,onChange:X=>C(X.target.value),onBlur:_,onKeyDown:E,style:{...M(R),width:"36px",fontFamily:"inherit"}}):v.jsx("div",{onClick:X=>k(R,X),style:M(R),title:`${R}: ${e[R]}`,children:I(e[R])})})};return v.jsxs("div",{children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a"},children:n}),v.jsxs("div",{style:{display:"flex",gap:"2px"},children:[v.jsx("button",{style:j(u),onClick:()=>c(!u),title:u?"Unlink top/bottom":"Link top/bottom",children:v.jsx("span",{style:{transform:"rotate(90deg)",display:"flex"},children:v.jsx(QS,{linked:u})})}),v.jsx("button",{style:j(f),onClick:()=>h(!f),title:f?"Unlink left/right":"Link left/right",children:v.jsx(QS,{linked:f})})]})]}),v.jsxs("div",{style:{position:"relative",width:"100px",height:"40px",margin:"0 auto"},children:[v.jsxs("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},viewBox:"0 0 100 70",children:[v.jsx("rect",{x:"10",y:"10",width:"80",height:"50",fill:"none",stroke:"lightgray",strokeWidth:"1",strokeDasharray:"3,2",rx:"2"}),v.jsx("line",{x1:"50",y1:"10",x2:"50",y2:"2",stroke:"lightgray",strokeWidth:"1"}),v.jsx("line",{x1:"50",y1:"60",x2:"50",y2:"68",stroke:"lightgray",strokeWidth:"1"}),v.jsx("line",{x1:"10",y1:"35",x2:"2",y2:"35",stroke:"lightgray",strokeWidth:"1"}),v.jsx("line",{x1:"90",y1:"35",x2:"98",y2:"35",stroke:"lightgray",strokeWidth:"1"})]}),O("top",{top:"-8px",left:"50%",transform:"translateX(-50%)"}),O("bottom",{bottom:"-8px",left:"50%",transform:"translateX(-50%)"}),O("left",{left:"-12px",top:"50%",transform:"translateY(-50%)"}),O("right",{right:"-12px",top:"50%",transform:"translateY(-50%)"})]})]})}function Rne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,hasChanges:i=!1,changedProps:o={}}){const s={top:n.marginTop,right:n.marginRight,bottom:n.marginBottom,left:n.marginLeft},a={top:n.paddingTop,right:n.paddingRight,bottom:n.paddingBottom,left:n.paddingLeft},u={top:o["margin-top"],right:o["margin-right"],bottom:o["margin-bottom"],left:o["margin-left"]},c={top:o["padding-top"],right:o["padding-right"],bottom:o["padding-bottom"],left:o["padding-left"]};return v.jsxs(Va,{title:"Spacing",expanded:e,onToggle:t,hasChanges:i,children:[v.jsx("div",{style:{marginBottom:"16px"},children:v.jsx(XS,{label:"Margin",values:s,onChange:(f,h)=>r(`margin-${f}`,h),hasChanges:u})}),v.jsx(XS,{label:"Padding",values:a,onChange:(f,h)=>r(`padding-${f}`,h),hasChanges:c})]})}function eM({value:e,min:t=0,max:n=100,step:r=1,unit:i="px",onChange:o,label:s}){const[a,u]=T.useState(!1),[c,f]=T.useState(e),h=T.useCallback(g=>{g.preventDefault(),u(!0);const x=g.clientX,b=c,k=_=>{const E=_.clientX-x,I=_.shiftKey?.1:1,N=Math.min(n,Math.max(t,b+E*I)),M=Math.round(N/r)*r;f(M),o(M)},C=()=>{u(!1),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",k),document.addEventListener("mouseup",C)},[c,t,n,r,o]),m=g=>{const x=parseFloat(g.target.value)||0;f(x),o(x)};return v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s&&v.jsx("span",{style:{fontSize:"10px",color:"#71717a",width:"18px"},children:s}),v.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",padding:"3px 6px",cursor:"ew-resize"},onMouseDown:h,children:[v.jsx("input",{type:"number",value:c,onChange:m,style:{width:"100%",backgroundColor:"transparent",border:"none",color:"#18181b",fontSize:"11px",fontFamily:"ui-monospace, monospace",outline:"none",cursor:a?"ew-resize":"text"},onClick:g=>g.stopPropagation()}),v.jsx("span",{style:{fontSize:"10px",color:"#a1a1aa",marginLeft:"4px"},children:i})]})]})}var Pne={auto:"auto",full:"100%",fit:"fit-content",min:"min-content",max:"max-content",screen:"100vh"};function bl({label:e,value:t,property:n,onApplyStyle:r}){const[i,o]=T.useState(!1),s=parseFloat(t)||0,a=u=>t.toLowerCase()===u.toLowerCase();return v.jsxs("div",{style:{marginBottom:"10px"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a"},children:e}),v.jsx("button",{onClick:()=>o(!i),style:{padding:"1px 4px",borderRadius:"2px",border:"1px solid #e4e4e7",backgroundColor:i?"#18181b":"#ffffff",color:i?"#fafafa":"#71717a",fontSize:"8px",cursor:"pointer"},title:"Toggle custom size slider",children:"px"})]}),v.jsx("div",{style:{display:"flex",gap:"2px",flexWrap:"wrap",marginBottom:i?"6px":0},children:Object.entries(Pne).slice(0,5).map(([u,c])=>v.jsx("button",{onClick:()=>r(n,c),style:{padding:"2px 5px",borderRadius:"3px",border:"1px solid",borderColor:a(c)?"#18181b":"#e4e4e7",backgroundColor:a(c)?"#18181b":"#ffffff",color:a(c)?"#fafafa":"#18181b",fontSize:"9px",fontFamily:"ui-monospace, monospace",cursor:"pointer",transition:"all 0.1s ease"},title:c,children:u},u))}),i&&v.jsx(eM,{value:s,min:0,max:1e3,onChange:u=>r(n,`${u}px`)})]})}function jne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,hasChanges:i=!1}){const o=n.width,s=n.height,a=n.minWidth,u=n.maxWidth,c=n.minHeight,f=n.maxHeight;return v.jsxs(Va,{title:"Size",expanded:e,onToggle:t,hasChanges:i,children:[v.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[v.jsx(bl,{label:"Width",value:o,property:"width",onApplyStyle:r}),v.jsx(bl,{label:"Height",value:s,property:"height",onApplyStyle:r})]}),v.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[v.jsx(bl,{label:"Min W",value:a,property:"min-width",onApplyStyle:r}),v.jsx(bl,{label:"Max W",value:u,property:"max-width",onApplyStyle:r})]}),v.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[v.jsx(bl,{label:"Min H",value:c,property:"min-height",onApplyStyle:r}),v.jsx(bl,{label:"Max H",value:f,property:"max-height",onApplyStyle:r})]})]})}function Dl({value:e,tokens:t,quickKeys:n,onChange:r,placeholder:i="More..."}){const[o,s]=T.useState(!1),{quickItems:a,dropdownItems:u}=T.useMemo(()=>{const f=[],h=[];for(const[m,g]of Object.entries(t))n.includes(m)?f.push({key:m,value:g}):h.push({key:m,value:g});return f.sort((m,g)=>n.indexOf(m.key)-n.indexOf(g.key)),{quickItems:f,dropdownItems:h}},[t,n]),c=f=>{const h=m=>m.replace(/\s+/g,"").toLowerCase();return h(e)===h(f)};return v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"3px",flexWrap:"wrap"},children:[a.map(({key:f,value:h})=>v.jsx("button",{onClick:()=>r(h),style:{padding:"3px 6px",borderRadius:"3px",border:"1px solid",borderColor:c(h)?"#18181b":"#e4e4e7",backgroundColor:c(h)?"#18181b":"#ffffff",color:c(h)?"#fafafa":"#18181b",fontSize:"10px",fontFamily:"ui-monospace, monospace",cursor:"pointer",transition:"all 0.1s ease",minWidth:"28px",textAlign:"center"},title:`${f}: ${h}`,children:f},f)),u.length>0&&v.jsxs("div",{style:{position:"relative"},children:[v.jsx("button",{onClick:()=>s(!o),onBlur:()=>setTimeout(()=>s(!1),150),style:{padding:"3px 6px",borderRadius:"3px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",fontSize:"10px",cursor:"pointer",display:"flex",alignItems:"center",gap:"2px"},children:v.jsx("span",{children:"..."})}),o&&v.jsx("div",{style:{position:"absolute",top:"100%",left:0,marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:10,maxHeight:"150px",overflow:"auto",minWidth:"100px"},children:u.map(({key:f,value:h})=>v.jsxs("button",{onClick:()=>{r(h),s(!1)},style:{display:"block",width:"100%",padding:"4px 8px",border:"none",backgroundColor:c(h)?"#f4f4f5":"transparent",color:"#18181b",fontSize:"10px",fontFamily:"ui-monospace, monospace",cursor:"pointer",textAlign:"left"},children:[v.jsx("span",{style:{fontWeight:500},children:f}),v.jsx("span",{style:{color:"#71717a",marginLeft:"4px"},children:h})]},f))})]})]})}function my({value:e,colors:t,onChange:n}){const[r,i]=T.useState(!1),o=T.useMemo(()=>{const u=[];for(const[c,f]of Object.entries(t))if(typeof f=="object")for(const[h,m]of Object.entries(f))u.push({name:c,shade:h,value:m});return u},[t]),s=["500","600","700"],a=T.useMemo(()=>o.filter(u=>s.includes(u.shade)),[o]);return v.jsxs("div",{children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"6px"},children:[v.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"4px",backgroundColor:e,border:"1px solid #e4e4e7",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.06)"}}),v.jsx("input",{type:"text",value:e,onChange:u=>n(u.target.value),style:{flex:1,backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",padding:"4px 8px",color:"#18181b",fontSize:"11px",fontFamily:"ui-monospace, monospace"}}),v.jsx("button",{onClick:()=>i(!r),style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",fontSize:"10px",cursor:"pointer"},children:r?"▲":"▼"})]}),r&&v.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(11, 1fr)",gap:"2px",padding:"6px",backgroundColor:"#fafafa",border:"1px solid #e4e4e7",borderRadius:"8px",maxHeight:"200px",overflow:"auto"},children:o.map((u,c)=>v.jsx("button",{onClick:()=>n(u.value),style:{width:"18px",height:"18px",borderRadius:"3px",backgroundColor:u.value,border:e===u.value?"2px solid #18181b":"1px solid #e4e4e7",cursor:"pointer"},title:`${u.name}-${u.shade}`},c))}),!r&&v.jsx("div",{style:{display:"flex",gap:"3px",flexWrap:"wrap"},children:a.map((u,c)=>v.jsx("button",{onClick:()=>n(u.value),style:{width:"14px",height:"14px",borderRadius:"3px",backgroundColor:u.value,border:e===u.value?"2px solid #18181b":"1px solid #e4e4e7",cursor:"pointer"},title:`${u.name}-${u.shade}`},c))})]})}var zne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"12",x2:"15",y2:"12"}),v.jsx("line",{x1:"3",y1:"18",x2:"18",y2:"18"})]}),Lne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),v.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),Fne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"6",y1:"18",x2:"21",y2:"18"})]}),$ne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]});function Bne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.color,a=n.fontSize,u=n.fontWeight,c=n.fontFamily,f=n.textAlign,h=n.lineHeight;return v.jsxs(Va,{title:"Typography",expanded:e,onToggle:t,hasChanges:o,children:[v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Color"}),v.jsx(my,{value:s,colors:i.colors,onChange:m=>r("color",m)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Size"}),v.jsx(Dl,{value:a,tokens:i.fontSize,quickKeys:["xs","sm","base","lg","xl","2xl"],onChange:m=>r("font-size",m)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Weight"}),v.jsx(Dl,{value:u,tokens:i.fontWeight,quickKeys:["light","normal","medium","semibold","bold"],onChange:m=>r("font-weight",m)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Family"}),v.jsx(vp,{value:c,tokens:i.fontFamily,onChange:m=>r("font-family",m)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Text Align"}),v.jsx(oc,{value:f,options:[{value:"left",label:v.jsx(zne,{})},{value:"center",label:v.jsx(Lne,{})},{value:"right",label:v.jsx(Fne,{})},{value:"justify",label:v.jsx($ne,{})}],onChange:m=>r("text-align",m)})]}),v.jsxs("div",{children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Line Height"}),v.jsx(Dl,{value:h,tokens:i.lineHeight,quickKeys:["tight","snug","normal","relaxed"],onChange:m=>r("line-height",m)})]})]})}function Une({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.backgroundColor,a=n.borderColor,u=n.borderWidth,c=n.borderRadius;return v.jsxs(Va,{title:"Background & Border",expanded:e,onToggle:t,hasChanges:o,children:[v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Background"}),v.jsx(my,{value:s,colors:i.colors,onChange:f=>r("background-color",f)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Color"}),v.jsx(my,{value:a,colors:i.colors,onChange:f=>r("border-color",f)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Width"}),v.jsx(vp,{value:u,tokens:i.borderWidth,onChange:f=>r("border-width",f)})]}),v.jsxs("div",{children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Radius"}),v.jsx(vp,{value:c,tokens:i.borderRadius,onChange:f=>r("border-radius",f)})]})]})}function Vne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.boxShadow,a=n.borderRadius,u=n.borderWidth,c=parseFloat(n.opacity)*100;return v.jsxs(Va,{title:"Effects",expanded:e,onToggle:t,hasChanges:o,children:[v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Radius"}),v.jsx(Dl,{value:a,tokens:i.borderRadius,quickKeys:["none","sm","md","lg","full"],onChange:f=>r("border-radius",f)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Width"}),v.jsx(Dl,{value:u,tokens:i.borderWidth,quickKeys:["0","DEFAULT","2","4"],onChange:f=>r("border-width",f)})]}),v.jsxs("div",{style:{marginBottom:"12px"},children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Shadow"}),v.jsx(Dl,{value:s,tokens:i.boxShadow,quickKeys:["none","sm","md","lg"],onChange:f=>r("box-shadow",f)})]}),v.jsxs("div",{children:[v.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Opacity"}),v.jsx(eM,{value:c,min:0,max:100,step:1,unit:"%",onChange:f=>r("opacity",String(f/100))})]})]})}function Hne({expanded:e,onToggle:t,onAnnotate:n,existingAnnotation:r="",hasChanges:i=!1}){const[o,s]=T.useState(r),[a,u]=T.useState(!!r),c=T.useRef(null),f=T.useRef(null);T.useEffect(()=>{s(r),u(!!r)},[r]);const h=T.useCallback(x=>{s(x),u(!1),c.current&&clearTimeout(c.current),x.trim()&&(c.current=setTimeout(()=>{n(x.trim()),u(!0)},500))},[n]);T.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const m=()=>{c.current&&clearTimeout(c.current),o.trim()&&!a&&(n(o.trim()),u(!0))},g=!!(o.trim()&&a);return v.jsx(Va,{title:"Annotation",expanded:e,onToggle:t,hasChanges:i||g,children:v.jsxs("div",{style:{position:"relative",borderRadius:"4px",border:`1px solid ${g?"#3b82f6":"#e4e4e7"}`,backgroundColor:g?"#eff6ff":"#ffffff",transition:"all 0.15s ease"},children:[v.jsx("textarea",{ref:f,value:o,onChange:x=>h(x.target.value),onBlur:m,placeholder:"Add a note about this element...",style:{width:"100%",minHeight:"60px",padding:"8px",borderRadius:"4px",border:"none",backgroundColor:"transparent",color:"#18181b",fontSize:"11px",resize:"vertical",fontFamily:"system-ui, -apple-system, sans-serif",outline:"none"}}),o.trim()&&v.jsx("div",{style:{position:"absolute",bottom:"4px",right:"4px",fontSize:"9px",color:a?"#3b82f6":"#a1a1aa",display:"flex",alignItems:"center",gap:"2px"},children:a?v.jsxs(v.Fragment,{children:[v.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Saved"]}):"Saving..."})]})})}var Wne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("circle",{cx:"12",cy:"12",r:"5"}),v.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),v.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),v.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),v.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),v.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),v.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),v.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),v.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),qne=()=>v.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Zne=()=>v.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),v.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),v.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),Jne=()=>v.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),v.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1"})]}),Kne=()=>v.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),v.jsx("path",{d:"M3 3v5h5"})]}),Gne={display:"layout","flex-direction":"layout","justify-content":"layout","align-items":"layout","flex-wrap":"layout",gap:"layout","margin-top":"spacing","margin-right":"spacing","margin-bottom":"spacing","margin-left":"spacing","padding-top":"spacing","padding-right":"spacing","padding-bottom":"spacing","padding-left":"spacing",width:"size",height:"size","min-width":"size","min-height":"size","max-width":"size","max-height":"size","font-size":"typography","font-weight":"typography","font-family":"typography","line-height":"typography","letter-spacing":"typography","text-align":"typography",color:"typography","background-color":"background",background:"background","border-radius":"effects","box-shadow":"effects",border:"effects","border-width":"effects",opacity:"effects"};function Yne({selectedElement:e,actions:t,tokens:n,onClose:r,showMarginPadding:i,zIndex:o=9999,theme:s,onThemeToggle:a,changes:u,annotations:c,onReset:f}){var E;const[h,m]=T.useState(new Set(["annotation","layout","spacing","typography"])),g=T.useMemo(()=>{const I=new Set,N=u.filter(M=>M.target.path===e.path&&M.type==="style");for(const M of N){const j=M.after.property,O=Gne[j];O&&I.add(O)}return I},[u,e.path]),x=T.useMemo(()=>{const I={},N=u.filter(M=>M.target.path===e.path&&M.type==="style");for(const M of N){const j=M.after.property;(j.startsWith("margin-")||j.startsWith("padding-"))&&(I[j]=!0)}return I},[u,e.path]),b=I=>{m(N=>{const M=new Set(N);return M.has(I)?M.delete(I):M.add(I),M})},k=window.getComputedStyle(e.element),C={light:v.jsx(Wne,{}),dark:v.jsx(qne,{}),system:v.jsx(Zne,{})},_=u.some(I=>I.target.path===e.path);return v.jsxs("div",{"data-bobbin":"edit-panel",style:{position:"fixed",top:"16px",right:"16px",width:"280px",maxHeight:"calc(100vh - 32px)",backgroundColor:"#fafafa",borderRadius:"8px",border:"1px solid #e4e4e7",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",zIndex:o,overflow:"hidden",display:"flex",flexDirection:"column",color:"#18181b",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"13px"},children:[v.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #e4e4e7",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"#ffffff"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[v.jsx("span",{style:{fontWeight:500,fontSize:"12px"},children:e.tagName}),e.id&&v.jsxs("span",{style:{color:"#71717a",fontSize:"11px"},children:["#",e.id]}),e.classList.length>0&&v.jsxs("span",{style:{color:"#a1a1aa",fontSize:"10px"},children:[".",e.classList.slice(0,2).join("."),e.classList.length>2&&"..."]})]}),v.jsxs("div",{style:{display:"flex",gap:"4px"},children:[v.jsx("button",{onClick:a,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px"},title:`Theme: ${s}`,children:C[s]}),v.jsx("button",{onClick:t.toggleMarginPadding,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:i?"#18181b":"#ffffff",color:i?"#fafafa":"#71717a",cursor:"pointer",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Toggle spacing visualization",children:v.jsx(Jne,{})}),_&&v.jsx("button",{onClick:f,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",cursor:"pointer",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Reset all changes",children:v.jsx(Kne,{})}),v.jsx("button",{onClick:r,style:{width:"22px",height:"22px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px"},children:"×"})]})]}),v.jsxs("div",{style:{flex:1,overflow:"auto",padding:"8px 0"},children:[v.jsx(Hne,{expanded:h.has("annotation"),onToggle:()=>b("annotation"),onAnnotate:t.annotate,existingAnnotation:(E=c.find(I=>I.elementPath===e.path))==null?void 0:E.content,hasChanges:c.some(I=>I.elementPath===e.path)}),v.jsx(Dne,{expanded:h.has("layout"),onToggle:()=>b("layout"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("layout")}),v.jsx(Rne,{expanded:h.has("spacing"),onToggle:()=>b("spacing"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("spacing"),changedProps:x}),v.jsx(jne,{expanded:h.has("size"),onToggle:()=>b("size"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("size")}),v.jsx(Bne,{expanded:h.has("typography"),onToggle:()=>b("typography"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("typography")}),v.jsx(Une,{expanded:h.has("background"),onToggle:()=>b("background"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("background")}),v.jsx(Vne,{expanded:h.has("effects"),onToggle:()=>b("effects"),computedStyle:k,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("effects")})]})]})}function Qne({selectedElement:e,onSelectElement:t,zIndex:n=9999}){const[r,i]=T.useState("attributes"),[o,s]=T.useState(!1),a=T.useMemo(()=>{const f=window.getComputedStyle(e.element),h={},m=["display","position","width","height","margin","padding","border","background","color","font-family","font-size","font-weight","line-height","text-align","flex","grid"];for(const g of m)h[g]=f.getPropertyValue(g);return h},[e.element]),u=T.useMemo(()=>{const f={},h=e.element;for(const m of h.attributes)m.name.toLowerCase()!=="contenteditable"&&(f[m.name]=m.value);return f},[e.element]),c=T.useMemo(()=>{const f=[];let h=e.element;for(;h&&h!==document.body;)f.unshift(h),h=h.parentElement;return f},[e.element]);return v.jsx("div",{"data-bobbin":"inspector",style:{position:"fixed",bottom:"16px",left:"16px",width:o?"auto":"320px",maxHeight:o?"auto":"260px",backgroundColor:"#fafafa",borderRadius:"8px",border:"1px solid #e4e4e7",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:n,overflow:"hidden",display:"flex",flexDirection:"column",color:"#18181b",fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"11px"},children:o?v.jsx("div",{style:{padding:"6px 10px",display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",backgroundColor:"#ffffff"},onClick:()=>s(!1),children:v.jsx("span",{style:{fontSize:"10px",color:"#71717a"},children:"Inspector"})}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #e4e4e7",backgroundColor:"#ffffff"},children:[["styles","attributes"].map(f=>v.jsx("button",{onClick:()=>i(f),style:{flex:1,padding:"6px 8px",border:"none",borderBottom:r===f?"2px solid #18181b":"2px solid transparent",backgroundColor:"transparent",color:r===f?"#18181b":"#71717a",cursor:"pointer",textTransform:"capitalize",fontSize:"11px",fontWeight:r===f?500:400},children:f},f)),v.jsx("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"0 4px"},children:v.jsx("button",{onClick:()=>s(!0),style:{width:"18px",height:"18px",borderRadius:"3px",border:"none",backgroundColor:"transparent",color:"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px"},title:"Minimize",children:"−"})})]}),v.jsxs("div",{style:{flex:1,overflow:"auto",padding:"6px"},children:[r==="tree"&&v.jsx("div",{children:c.map((f,h)=>v.jsxs("div",{onClick:()=>t(f),style:{padding:"3px 6px",paddingLeft:`${h*10+6}px`,cursor:"pointer",backgroundColor:f===e.element?"#18181b":"transparent",color:f===e.element?"#fafafa":"#18181b",borderRadius:"3px",marginBottom:"1px"},children:[v.jsx("span",{style:{color:f===e.element?"#a1a1aa":"#52525b"},children:f.tagName.toLowerCase()}),f.id&&v.jsxs("span",{style:{color:f===e.element?"#d4d4d8":"#71717a"},children:["#",f.id]}),f.classList.length>0&&v.jsxs("span",{style:{color:(f===e.element,"#a1a1aa")},children:[".",Array.from(f.classList).slice(0,2).join(".")]})]},h))}),r==="styles"&&v.jsx("div",{children:Object.entries(a).map(([f,h])=>v.jsxs("div",{style:{display:"flex",padding:"2px 0",borderBottom:"1px solid #f4f4f5"},children:[v.jsxs("span",{style:{color:"#52525b",width:"100px"},children:[f,":"]}),v.jsx("span",{style:{color:"#18181b",flex:1},children:h})]},f))}),r==="attributes"&&v.jsx("div",{children:Object.entries(u).map(([f,h])=>v.jsxs("div",{style:{display:"flex",padding:"2px 0",borderBottom:"1px solid #f4f4f5"},children:[v.jsx("span",{style:{color:"#71717a",width:"80px"},children:f}),v.jsxs("span",{style:{color:"#18181b"},children:['"',h,'"']})]},f))})]})]})})}function Xne(e){const{showInspector:t=!1,...n}=e,r=cne(n),{zIndex:i=9999,pillContainer:o}=n;return Dy.createPortal(v.jsxs("div",{"data-bobbin":"root",children:[v.jsx(hne,{state:r,actions:r,position:n.position,container:o??n.container,zIndex:i}),r.isActive&&v.jsx(pne,{hoveredElement:r.hoveredElement,selectedElement:r.selectedElement,zIndex:i-10}),r.selectedElement&&v.jsx(yne,{selectedElement:r.selectedElement,actions:r,clipboard:r.clipboard,zIndex:i}),r.selectedElement&&r.showMarginPadding&&v.jsx(xne,{selectedElement:r.selectedElement,zIndex:i-5}),r.selectedElement&&r.activePanel==="style"&&v.jsx(Yne,{selectedElement:r.selectedElement,actions:r,tokens:r.tokens,onClose:r.clearSelection,showMarginPadding:r.showMarginPadding,zIndex:i,theme:r.theme,onThemeToggle:r.toggleTheme,changes:r.changes,annotations:r.annotations,onReset:r.resetChanges}),r.selectedElement&&(t||r.activePanel==="inspector")&&v.jsx(Qne,{selectedElement:r.selectedElement,onSelectElement:s=>r.selectElement(s),onClose:()=>r.setActivePanel(null),zIndex:i})]}),document.body)}var ere=/^```([a-z]*)?$/;function tre({node:e,updateAttributes:t,editor:n,getPos:r}){var h;const i=T.useRef(null),o=T.useCallback(()=>{requestAnimationFrame(()=>{var m;return(m=i.current)==null?void 0:m.focus()})},[]),s=T.useCallback(()=>{const m=typeof r=="function"?r():void 0;m!==void 0&&n.chain().focus().setTextSelection(m+1).run()},[n,r]),a=T.useCallback(()=>{const m=typeof r=="function"?r():void 0;m!==void 0&&m>1&&(n.state.doc.resolve(m).nodeBefore?n.chain().focus().setTextSelection(m-1).run():n.chain().focus().setTextSelection(1).run())},[n,r]),u=T.useCallback(m=>{t({language:m.target.value})},[t]),c=T.useCallback(m=>{switch(m.stopPropagation(),m.key){case"Enter":case"ArrowDown":m.preventDefault(),s();break;case"ArrowUp":m.preventDefault(),a();break;case"Escape":m.preventDefault(),s();break}},[s,a]),f=T.useCallback(m=>{m.stopPropagation(),m.preventDefault(),o()},[o]);return v.jsxs(PK,{className:"code-block-wrapper my-2","data-type":"codeBlock",children:[v.jsxs("div",{className:"language-input-wrapper flex items-center gap-1 mb-1",contentEditable:!1,children:[v.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"```"}),v.jsx("input",{ref:i,type:"text",value:e.attrs.language||"",onChange:u,onKeyDown:c,onKeyUp:m=>m.stopPropagation(),onMouseDown:f,onClick:m=>{m.stopPropagation(),o()},onFocus:m=>m.stopPropagation(),onBlur:m=>m.stopPropagation(),placeholder:"language",className:"language-input bg-transparent text-xs text-muted-foreground outline-none border-none min-w-[60px] max-w-[120px] focus:ring-1 focus:ring-ring rounded px-1",style:{width:`${Math.max(60,(((h=e.attrs.language)==null?void 0:h.length)||8)*7)}px`},spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]}),v.jsx("pre",{className:"bg-muted rounded-md px-3 py-2 font-mono text-sm overflow-x-auto !mt-0",children:v.jsx(RK,{as:"code"})})]})}var nre=Kt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var i;const{languageClassPrefix:t}=this.options;return Array.from(((i=e.firstElementChild)==null?void 0:i.classList)||[]).filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",t,["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addNodeView(){return BK(tre,{stopEvent:({event:e})=>{const t=e.target;return t.classList.contains("language-input")||!!t.closest(".language-input-wrapper")}})},addInputRules(){return[Lh({find:ere,type:this.type,getAttributes:e=>({language:e[1]||""})})]},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}}});function rre(e){var t;return((t=e.project.files.get(e.activeFile))==null?void 0:t.content)??""}function ire(e){return Array.from(e.files.values())}var eE=/<<<<<<< SEARCH\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> REPLACE/g,ore=[/^<<<<<<< SEARCH\s*$/m,/^=======\s*$/m,/^>>>>>>> REPLACE\s*$/m],sre=/^```(\w*)\s*((?:[a-zA-Z_][\w-]*="[^"]*"\s*)*)\s*$/,are=/([a-zA-Z_][\w-]*)="([^"]*)"/g;function lre(e){const t={};if(!e)return t;const n=new RegExp(are.source,"g");let r;for(;(r=n.exec(e))!==null;){const i=r[1],o=r[2];i&&o!==void 0&&(t[i]=o)}return t}function ure(e){const t=[],n=e.split(`
1416
- `);let r=0;for(;r<n.length;){const i=n[r];if(!i){r++;continue}const o=i.match(sre);if(o){const s=o[1]||"",a=lre(o[2]??""),u=[];for(r++;r<n.length;){const c=n[r];if(c!==void 0&&c.match(/^```\s*$/))break;u.push(c??""),r++}t.push({language:s,attributes:a,content:u.join(`
1417
- `)})}r++}return t}function cre(e){for(const t of ore){const n=e.match(t);if(n)return n[0].trim()}return null}function dre(e){let t=e;return t=t.replace(/^<<<<<<< SEARCH\s*\n?/gm,""),t=t.replace(/^=======\s*\n?/gm,""),t=t.replace(/^>>>>>>> REPLACE\s*\n?/gm,""),t=t.replace(/\n{3,}/g,`
1418
-
1419
- `),t}function fre(e){const t=[],n=[],r=ure(e);for(const o of r){o.attributes.note&&t.push(o.attributes.note);const s=o.content.match(/<<<<<<< SEARCH\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> REPLACE/);s&&s[1]!==void 0&&s[2]!==void 0&&n.push({note:o.attributes.note,path:o.attributes.path,search:s[1],replace:s[2]})}const i=gre(e);return{progressNotes:t,diffs:n,summary:i}}function hre(e,t,n={}){let r=e,i=0;const o=[];for(const u of t)if(r.includes(u.search))r=r.replace(u.search,u.replace),i++;else{const f=u.search.split(`
1420
- `).slice(0,3).join(`
1421
- `).slice(0,100),h=u.search.length>f.length?"...":"";o.push(f+h)}const s=cre(r);let a;return s&&(n.sanitize?(r=dre(r),a=`Removed stray diff marker "${s}" from output`):a=`Output contains diff marker "${s}" - the LLM may have generated a malformed response`),{code:r,applied:i,failed:o,warning:a}}function pre(e){return eE.lastIndex=0,eE.test(e)}var mre=/```\w*(?:\s+[a-zA-Z_][\w-]*="[^"]*")*\s*\n[\s\S]*?\n```/g;function gre(e){let t=e.replace(mre,"");return t=t.replace(/^<<<<<<< SEARCH\s*$/gm,""),t=t.replace(/^=======\s*$/gm,""),t=t.replace(/^>>>>>>> REPLACE\s*$/gm,""),t=t.replace(/^```[\w]*(?:\s+[a-zA-Z_][\w-]*="[^"]*")*\s*$/gm,""),t=t.replace(/\n{3,}/g,`
1422
-
1423
- `).trim(),t}async function yre(e,t={}){const{endpoint:n="/api/edit",onProgress:r,sanitize:i=!0}=t,o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error("Edit request failed");const s=await xre(o,r);if(!pre(s))throw new Error("No valid diffs in response");const a=fre(s),u=hre(e.code,a.diffs,{sanitize:i});if(u.applied===0){const f=u.failed.map((h,m)=>`[${m+1}] "${h}"`).join(`
1424
- `);throw new Error(`Failed to apply ${a.diffs.length} diff(s). None of the SEARCH blocks matched the code.
1425
-
1426
- Failed searches:
1427
- ${f}
1428
-
1429
- This usually means the code has changed or the SEARCH text doesn't match exactly.`)}let c=a.summary||`Applied ${u.applied} change(s)`;return u.warning&&(c=`⚠️ ${u.warning}
1430
-
1431
- ${c}`),{newCode:u.code,summary:c,progressNotes:a.progressNotes}}async function xre(e,t){var a;const n=(a=e.body)==null?void 0:a.getReader();if(!n)return e.text();const r=new TextDecoder;let i="";const o=new Set;let s=!1;for(;!s;){const u=await n.read();if(s=u.done,u.value&&(i+=r.decode(u.value,{stream:!0}),t)){const c=/```\w*\s+note="([^"]+)"/g;let f;for(;(f=c.exec(i))!==null;){const h=f[1];if(h){const m=h.trim();o.has(m)||(o.add(m),t(m))}}}}return i}function e1(e){return{...e,files:new Map(e.files)}}function bre(e){const{originalCode:t,originalProject:n,compile:r,apiEndpoint:i}=e;console.log("[useEditSession] providedProject:",n==null?void 0:n.id,"files:",n?Array.from(n.files.keys()):"none");const o=T.useMemo(()=>n??Eh(t??""),[n,t]),s=T.useRef(o),[a,u]=T.useState(o),[c,f]=T.useState(o.entry),[h,m]=T.useState([]),[g,x]=T.useState(!1),[b,k]=T.useState(null),[C,_]=T.useState([]),[E,I]=T.useState(null);T.useEffect(()=>{o!==s.current&&(s.current=o,u(o),f(o.entry),m([]),k(null),_([]))},[o]);const N=T.useCallback(async(X,Se,ue=!1)=>{const $=[],Q=await yre({code:X,prompt:Se},{endpoint:i,onProgress:he=>_(te=>[...te,he])});if($.push({prompt:ue?`Fix: ${Se}`:Se,summary:Q.summary,isRetry:ue}),r){const he=await r(Q.newCode);if(!he.success&&he.error){_([]);const te=`Compilation error: ${he.error}
1432
-
1433
- Please fix this error.`,Me=await N(Q.newCode,te,!0);return{newCode:Me.newCode,entries:[...$,...Me.entries]}}}return{newCode:Q.newCode,entries:$}},[r,i]),M=T.useMemo(()=>{var X;return((X=a.files.get(c))==null?void 0:X.content)??""},[a,c]),j=T.useCallback(async X=>{if(!(!X.trim()||g)){x(!0),k(null),_([]),I(X);try{const Se=await N(M,X);u(ue=>{const $=e1(ue),Q=$.files.get(c);return Q&&$.files.set(c,{...Q,content:Se.newCode}),$}),m(ue=>[...ue,...Se.entries])}catch(Se){k(Se instanceof Error?Se.message:"Edit failed")}finally{x(!1),_([]),I(null)}}},[M,c,g,N]),O=T.useCallback(()=>{u(o),f(o.entry),m([]),k(null),_([])},[o]),R=T.useCallback(X=>{u(Se=>{const ue=e1(Se),$=ue.files.get(c);return $&&ue.files.set(c,{...$,content:X}),ue})},[c]),F=T.useCallback((X,Se,ue="utf8")=>{u($=>{const Q=e1($),he=Q.files.get(X);return he?Q.files.set(X,{...he,content:Se,encoding:ue}):Q.files.set(X,{path:X,content:Se,encoding:ue}),Q})},[]),ee=T.useCallback(()=>{k(null)},[]);return{project:a,originalProject:o,activeFile:c,history:h,isApplying:g,error:b,streamingNotes:C,pendingPrompt:E,submitEdit:j,revert:O,updateActiveFile:R,setActiveFile:f,clearError:ee,replaceFile:F}}function vre({text:e,isLatest:t}){return v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground/60",children:[t&&v.jsx(ei,{className:"h-3 w-3 animate-spin"}),v.jsx("p",{className:"text-xs italic",children:e})]})}function kre({entries:e,streamingNotes:t,isStreaming:n,pendingPrompt:r,className:i=""}){const o=T.useRef(null);return T.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[e,t,r]),v.jsxs("div",{ref:o,className:`overflow-y-auto p-4 space-y-4 bg-background ${i}`,children:[e.map((s,a)=>v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{className:"flex justify-end",children:v.jsx("div",{className:"bg-primary text-primary-foreground rounded-lg px-4 py-2 max-w-[85%]",children:v.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:v.jsx(cc,{remarkPlugins:[dc],children:s.prompt})})})}),v.jsx("div",{className:"flex justify-start",children:v.jsx("div",{className:"bg-primary/10 rounded-lg px-4 py-2 max-w-[85%]",children:v.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:v.jsx(cc,{remarkPlugins:[dc],children:s.summary})})})})]},a)),r&&v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{className:"flex justify-end",children:v.jsx("div",{className:"bg-primary text-primary-foreground rounded-lg px-4 py-2 max-w-[85%]",children:v.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:v.jsx(cc,{remarkPlugins:[dc],children:r})})})}),n&&t.length>0&&v.jsx("div",{className:"space-y-1 py-2 px-3",children:t.map((s,a)=>v.jsx(vre,{text:s,isLatest:a===t.length-1},a))})]})]})}function tM({value:e,onChange:t,onSubmit:n,placeholder:r="Type a message...",disabled:i=!1,className:o=""}){const s=T.useRef(null),a=OK({extensions:[_Y.configure({heading:{levels:[1,2,3]},bulletList:{keepMarks:!0,keepAttributes:!1},orderedList:{keepMarks:!0,keepAttributes:!1},codeBlock:!1,code:{HTMLAttributes:{class:"bg-muted rounded px-1 py-0.5 font-mono text-sm"}},blockquote:{HTMLAttributes:{class:"border-l-4 border-muted-foreground/30 pl-4 italic"}},horizontalRule:!1,hardBreak:{keepMarks:!1}}),nre,TY.configure({placeholder:r,emptyEditorClass:"is-editor-empty"}),YY,Jte.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})],content:e,editable:!i,editorProps:{attributes:{class:`outline-none min-h-[40px] max-h-[200px] overflow-y-auto px-3 py-2 ${o}`},handleKeyDown:(c,f)=>{var E;const{state:h}=c,{selection:m}=h,{$from:g,$to:x,empty:b}=m,k=g.parent.type.name,C=k==="listItem",_=k==="codeBlock";if((f.metaKey||f.ctrlKey)&&f.key==="a"&&_){f.preventDefault();const{tr:I}=h;return I.setSelection(yt.create(I.doc,g.start(),g.end())),c.dispatch(I),!0}if(f.key==="ArrowUp"&&_&&!g.parent.textContent.slice(0,g.parentOffset).includes(`
1434
- `)){const M=(E=c.domAtPos(g.start()).node.parentElement)==null?void 0:E.closest(".code-block-wrapper"),j=M==null?void 0:M.querySelector(".language-input");if(j)return f.preventDefault(),j.focus(),j.select(),!0}if(f.key==="Tab"&&_){f.preventDefault();const{tr:I}=h;if(b)if(f.shiftKey){const N=g.parent.textContent.slice(0,g.parentOffset);N.endsWith(" ")?I.delete(g.pos-2,g.pos):N.endsWith(" ")&&I.delete(g.pos-1,g.pos)}else I.insertText(" ");else{const N=g.parent.textContent,M=N.lastIndexOf(`
1435
- `,g.parentOffset-1)+1,j=N.indexOf(`
1436
- `,x.parentOffset),O=j===-1?N.length:j,F=N.slice(M,O).split(`
1437
- `),ee=f.shiftKey?F.map(Se=>Se.replace(/^ ?/,"")).join(`
1438
- `):F.map(Se=>" "+Se).join(`
1439
- `),X=g.start();I.replaceWith(X+M,X+O,h.schema.text(ee))}return c.dispatch(I),!0}if(f.key==="Enter"){if(_){if(f.shiftKey){f.preventDefault();const{tr:I}=h;return I.insertText(`
1440
- `),c.dispatch(I),!0}return f.preventDefault(),n(),!0}if(f.shiftKey){f.preventDefault();const{tr:I}=h;return c.dispatch(I.split(g.pos)),!0}if(!C)return f.preventDefault(),n(),!0}return!1}},onUpdate:({editor:c})=>{const f=c.storage.markdown;f!=null&&f.getMarkdown?t(f.getMarkdown()):t(c.getText())}});T.useEffect(()=>{if(!a)return;const c=h=>{var k,C,_;const m=(k=h.clipboardData)==null?void 0:k.getData("text/plain"),g=(C=h.clipboardData)==null?void 0:C.getData("text/html");if(!m)return;const{$from:x}=a.state.selection;if(x.parent.type.name==="codeBlock"){h.preventDefault(),h.stopPropagation();const{tr:E}=a.state;E.insertText(m),a.view.dispatch(E);return}if(g){h.preventDefault(),h.stopPropagation();const E=a.storage.markdown;if(E!=null&&E.parser)try{const I=E.parser.parse(m);if(((_=I==null?void 0:I.content)==null?void 0:_.size)>0){const N=[];I.content.forEach(M=>N.push(M.toJSON())),a.chain().focus().insertContent(N).run();return}}catch(I){console.warn("Markdown parse failed, falling back to plain text",I)}a.chain().focus().insertContent(m).run()}},f=s.current;return f==null||f.addEventListener("paste",c,{capture:!0}),()=>f==null?void 0:f.removeEventListener("paste",c,{capture:!0})},[a]),T.useEffect(()=>{a&&e===""&&a.getText()!==""&&a.commands.clearContent()},[a,e]),T.useEffect(()=>{a==null||a.setEditable(!i)},[a,i]);const u=T.useCallback(()=>{a==null||a.commands.focus()},[a]);return T.useEffect(()=>{a&&(a.focusInput=u)},[a,u]),v.jsx("div",{ref:s,className:`
1441
- flex-1 rounded-md border border-input bg-background text-sm
1442
- ring-offset-background
1443
- focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
1444
- ${i?"cursor-not-allowed opacity-50":""}
1445
- `,onClick:()=>a==null?void 0:a.commands.focus(),children:v.jsx(W6,{editor:a,className:"markdown-editor"})})}var nM=[".tsx",".jsx",".ts",".js"],rM=[".svg",".png",".jpg",".jpeg",".gif",".webp",".mp4",".mov",".webm"],wre=[".json",".yaml",".yml",".md",".txt",".css",".html",".xml",".toml"],tE={".tsx":"tsx",".jsx":"jsx",".ts":"typescript",".js":"javascript",".json":"json",".yaml":"yaml",".yml":"yaml",".md":"markdown",".txt":"text",".css":"css",".html":"html",".xml":"xml",".toml":"toml",".svg":"xml"},rh={".tsx":"text/typescript-jsx",".jsx":"text/javascript-jsx",".ts":"text/typescript",".js":"text/javascript",".json":"application/json",".yaml":"text/yaml",".yml":"text/yaml",".md":"text/markdown",".txt":"text/plain",".css":"text/css",".html":"text/html",".xml":"application/xml",".toml":"text/toml",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".mp4":"video/mp4",".mov":"video/quicktime",".webm":"video/webm"};function nu(e){const t=e.lastIndexOf(".");return t===-1?"":e.slice(t).toLowerCase()}function Cre(e){const t=nu(e);return nM.includes(t)?{category:"compilable",language:tE[t]??null,mimeType:rh[t]??"text/plain"}:wre.includes(t)?{category:"text",language:tE[t]??null,mimeType:rh[t]??"text/plain"}:rM.includes(t)?{category:"media",language:t===".svg"?"xml":null,mimeType:rh[t]??"application/octet-stream"}:{category:"binary",language:null,mimeType:"application/octet-stream"}}function Sre(e){return nM.includes(nu(e))}function Ere(e){return rM.includes(nu(e))}function _re(e){const t=nu(e);return rh[t]??"application/octet-stream"}function Tre(e){const t=nu(e);return[".svg",".png",".jpg",".jpeg",".gif",".webp"].includes(t)}function Are(e){const t=nu(e);return[".mp4",".mov",".webm"].includes(t)}function Mre(e){const t={name:"",path:"",isDir:!0,children:[]};for(const n of e){const r=n.path.split("/");let i=t;for(let o=0;o<r.length;o++){const s=r[o],a=o===r.length-1,u=r.slice(0,o+1).join("/");let c=i.children.find(f=>f.name===s);c||(c={name:s,path:u,isDir:!a,children:[]},i.children.push(c)),i=c}}return t.children.sort((n,r)=>n.isDir!==r.isDir?n.isDir?-1:1:n.name.localeCompare(r.name)),t}function gy({node:e,activeFile:t,onSelect:n,onReplaceFile:r,depth:i=0}){const[o,s]=T.useState(!0),[a,u]=T.useState(!1),c=T.useRef(null),f=T.useCallback(b=>{var k;b.stopPropagation(),(k=c.current)==null||k.click()},[]),h=T.useCallback(b=>{var _;const k=(_=b.target.files)==null?void 0:_[0];if(!k||!r)return;const C=new FileReader;C.onload=()=>{const I=C.result.split(",")[1]??"";r(e.path,I,"base64")},C.readAsDataURL(k),b.target.value=""},[e.path,r]);if(!e.name)return v.jsx(v.Fragment,{children:e.children.map(b=>v.jsx(gy,{node:b,activeFile:t,onSelect:n,onReplaceFile:r,depth:i},b.path))});const m=e.path===t,g=!e.isDir&&Ere(e.path),x=g&&a&&r;return e.isDir?v.jsxs("div",{children:[v.jsxs("button",{onClick:()=>s(!o),className:"flex items-center gap-1 w-full px-2 py-1 text-left text-sm hover:bg-muted/50 rounded",style:{paddingLeft:`${i*12+8}px`},children:[o?v.jsx(Oc,{className:"h-3 w-3 shrink-0"}):v.jsx(_P,{className:"h-3 w-3 shrink-0"}),v.jsx(UP,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:e.name})]}),o&&v.jsx("div",{children:e.children.map(b=>v.jsx(gy,{node:b,activeFile:t,onSelect:n,onReplaceFile:r,depth:i+1},b.path))})]}):v.jsxs("div",{className:"relative",onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[v.jsxs("button",{onClick:()=>n(e.path),className:`flex items-center gap-1 w-full px-2 py-1 text-left text-sm hover:bg-muted/50 rounded ${m?"bg-primary/10 text-primary":""}`,style:{paddingLeft:`${i*12+20}px`},children:[v.jsx(LP,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"truncate flex-1",children:e.name}),x&&v.jsx("span",{onClick:f,className:"p-0.5 hover:bg-primary/20 rounded cursor-pointer",title:"Replace file",children:v.jsx(e9,{className:"h-3 w-3 text-primary"})})]}),g&&v.jsx("input",{ref:c,type:"file",className:"hidden",accept:"image/*,video/*",onChange:h})]})}function Nre({files:e,activeFile:t,onSelectFile:n,onReplaceFile:r}){const i=T.useMemo(()=>Mre(e),[e]);return v.jsxs("div",{className:"w-48 border-r bg-muted/30 overflow-auto text-foreground",children:[v.jsx("div",{className:"p-2 border-b text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Files"}),v.jsx("div",{className:"p-1",children:v.jsx(gy,{node:i,activeFile:t,onSelect:n,onReplaceFile:r})})]})}function Ire({isOpen:e,isSaving:t,error:n,onSave:r,onDiscard:i,onCancel:o}){return e?v.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/80",children:v.jsxs("div",{className:"bg-background border rounded-lg shadow-lg w-full max-w-md",children:[v.jsxs("div",{className:"p-6",children:[v.jsx("h2",{className:"text-lg font-semibold leading-none tracking-tight",children:"Unsaved Changes"}),v.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"You have unsaved changes. Would you like to save them before closing?"}),n&&v.jsxs("p",{className:"text-sm text-destructive mt-3",children:["Save failed: ",n]})]}),v.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-0",children:[v.jsx("button",{onClick:o,disabled:t,className:"inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-4 py-2 border border-input bg-background hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:"Cancel"}),v.jsx("button",{onClick:i,disabled:t,className:"inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-4 py-2 border border-input bg-background text-destructive hover:bg-destructive/10 disabled:opacity-50",children:"Discard"}),v.jsx("button",{onClick:r,disabled:t,className:"inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-4 py-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:t?"Saving...":"Save"})]})]})}):null}function nE({content:e,language:t,editable:n=!1,onChange:r}){const i=T.useRef(null);T.useEffect(()=>{i.current&&(i.current.style.height="auto",i.current.style.height=`${i.current.scrollHeight}px`)},[e]);const o=T.useCallback(u=>{r==null||r(u.target.value)},[r]),s=T.useCallback(u=>{if(u.key==="Tab"){u.preventDefault();const c=u.target,f=c.selectionStart,h=c.selectionEnd,m=c.value,g=m.substring(0,f)+" "+m.substring(h);r==null||r(g),requestAnimationFrame(()=>{c.selectionStart=c.selectionEnd=f+2})}},[r]),a=t||"text";return v.jsxs("div",{className:"h-full flex flex-col bg-muted/10",children:[v.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-muted/30 border-b text-xs",children:v.jsx("span",{className:"font-mono text-muted-foreground",children:a})}),n?v.jsx("textarea",{ref:i,value:e,onChange:o,onKeyDown:s,className:"w-full min-h-full font-mono text-xs leading-relaxed bg-transparent border-none outline-none resize-none",spellCheck:!1,style:{tabSize:2,WebkitTextFillColor:"inherit"}}):v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words m-0 leading-relaxed",children:v.jsx("code",{children:e})})]})}function Dre(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ore(e,t){return e.startsWith("data:")?e:`data:${t};base64,${e}`}function Rre({content:e,mimeType:t,fileName:n}){var h;const[r,i]=T.useState(null),[o,s]=T.useState(null),a=Ore(e,t),u=Tre(n),c=Are(n);e.length;const f=e.startsWith("data:")?Math.floor((((h=e.split(",")[1])==null?void 0:h.length)??0)*.75):Math.floor(e.length*.75);return T.useEffect(()=>{if(i(null),s(null),u){const m=new Image;m.onload=()=>{i({width:m.naturalWidth,height:m.naturalHeight})},m.onerror=()=>{s("Failed to load image")},m.src=a}},[a,u]),o?v.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 text-muted-foreground",children:[v.jsx(Fs,{className:"h-12 w-12 mb-4 text-destructive"}),v.jsx("p",{className:"text-sm",children:o})]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 bg-muted/20",children:[v.jsxs("div",{className:"flex-1 flex items-center justify-center w-full max-h-[60vh] overflow-hidden",children:[u&&v.jsx("img",{src:a,alt:n,className:"max-w-full max-h-full object-contain rounded shadow-sm",style:{maxHeight:"calc(60vh - 2rem)"}}),c&&v.jsx("video",{src:a,controls:!0,className:"max-w-full max-h-full rounded shadow-sm",style:{maxHeight:"calc(60vh - 2rem)"},children:"Your browser does not support video playback."}),!u&&!c&&v.jsxs("div",{className:"flex flex-col items-center text-muted-foreground",children:[v.jsx(zw,{className:"h-16 w-16 mb-4"}),v.jsx("p",{className:"text-sm",children:"Preview not available for this file type"})]})]}),v.jsxs("div",{className:"mt-6 text-center text-sm text-muted-foreground space-y-1",children:[v.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u&&v.jsx(zw,{className:"h-4 w-4"}),c&&v.jsx(jP,{className:"h-4 w-4"}),v.jsx("span",{className:"font-medium",children:n})]}),v.jsxs("div",{className:"text-xs space-x-3",children:[r&&v.jsxs("span",{children:[r.width," × ",r.height," px"]}),v.jsx("span",{children:Dre(f)}),v.jsx("span",{className:"text-muted-foreground/60",children:t})]})]})]})}function Pre(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}function jre({isOpen:e,onClose:t,onSave:n,onSaveProject:r,renderPreview:i,renderLoading:o,renderError:s,previewError:a,previewLoading:u,initialState:c={},hideFileTree:f=!1,...h}){var $e;const[m,g]=T.useState((c==null?void 0:c.showPreview)??!0),[x,b]=T.useState(f?!1:(c==null?void 0:c.showTree)??!1),[k,C]=T.useState(""),[_,E]=T.useState([]),[I,N]=T.useState(null),[M,j]=T.useState(!1),[O,R]=T.useState(!1),[F,ee]=T.useState(null),[X,Se]=T.useState(null),ue=T.useRef(""),$=bre(h),Q=rre($);ue.current=Q;const he=T.useMemo(()=>ire($.project),[$.project]),te=Q!==((($e=$.originalProject.files.get($.activeFile))==null?void 0:$e.content)??""),Me=T.useMemo(()=>Cre($.activeFile),[$.activeFile]),W=Sre($.activeFile),oe=T.useCallback(xt=>{E(xt)},[]),P=()=>{if(!k.trim()&&_.length===0||$.isApplying)return;let xt=k;if(_.length>0){const on=XA(_,[]);xt=`${k}
1446
-
1447
- ---
1448
- Visual Changes (apply these styles/modifications):
1449
- \`\`\`yaml
1450
- ${on}
1451
- \`\`\``}$.submitEdit(xt),C(""),E([])},tt=n||r,U=T.useCallback(()=>{var Qn;const xt=$.history.length,on=Q;xt>0&&on!==(((Qn=$.originalProject.files.get($.activeFile))==null?void 0:Qn.content)??"")&&tt?(Se({code:on,count:xt}),j(!0)):(C(""),$.clearError(),t(on,xt))},[Q,$,tt,t]),ke=T.useCallback(async()=>{if(!(!X||!tt)){R(!0),ee(null);try{r?await r($.project):n&&await n(X.code),j(!1),C(""),$.clearError(),t(X.code,X.count),Se(null)}catch(xt){ee(xt instanceof Error?xt.message:"Save failed")}finally{R(!1)}}},[X,n,r,$,t]),_e=T.useCallback(()=>{X&&(j(!1),C(""),$.clearError(),t(X.code,X.count),Se(null))},[X,$,t]),Pe=T.useCallback(()=>{j(!1),Se(null),ee(null)},[]),Ee=T.useCallback(async()=>{if(tt){R(!0),ee(null);try{r?await r($.project):n&&ue.current&&await n(ue.current)}catch(xt){ee(xt instanceof Error?xt.message:"Save failed")}finally{R(!1)}}},[n,r,$.project]);return e?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-8",children:v.jsxs("div",{className:"flex flex-col bg-background rounded-lg shadow-xl w-full h-full max-w-6xl max-h-[90vh] overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-background border-b-2",children:[v.jsx(x_,{className:"h-4 w-4 text-primary"}),$.isApplying&&v.jsxs("span",{className:"text-xs font-medium text-primary flex items-center gap-1 ml-2",children:[v.jsx(ei,{className:"h-3 w-3 animate-spin"}),"Applying edits..."]}),v.jsxs("div",{className:"ml-auto flex gap-2",children:[te&&v.jsx("button",{onClick:$.revert,className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-primary/20 text-primary",title:"Revert to original",children:v.jsx(b_,{className:"h-3 w-3"})}),!f&&v.jsx("button",{onClick:()=>b(!x),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${x?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,title:x?"Single file":"File tree",children:x?v.jsx(OP,{className:"h-3 w-3"}):v.jsx($P,{className:"h-3 w-3"})}),W&&v.jsxs("button",{onClick:()=>g(!m),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${m?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,children:[m?v.jsx(y_,{className:"h-3 w-3"}):v.jsx(x1,{className:"h-3 w-3"}),m?"Preview":"Code"]}),tt&&v.jsxs("button",{onClick:Ee,disabled:O,className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-primary/20 text-primary disabled:opacity-50",title:"Save changes",children:[O?v.jsx(ei,{className:"h-3 w-3 animate-spin"}):v.jsx(KP,{className:"h-3 w-3"}),"Save"]}),v.jsxs("button",{onClick:U,className:"px-2 py-1 text-xs rounded flex items-center gap-1 bg-primary text-primary-foreground hover:bg-primary/90",title:"Exit edit mode",children:[v.jsx(n9,{className:"h-3 w-3"}),"Done"]})]})]}),v.jsxs("div",{className:"flex-1 min-h-0 border-b-2 overflow-hidden flex",children:[!f&&x&&v.jsx(Nre,{files:he,activeFile:$.activeFile,onSelectFile:$.setActiveFile,onReplaceFile:$.replaceFile}),v.jsx("div",{className:"flex-1 overflow-auto",children:Me.category==="compilable"&&m?v.jsxs("div",{className:"bg-white h-full relative",ref:N,children:[a&&s?s(a):a?v.jsxs("div",{className:"p-4 text-sm text-destructive flex items-center gap-2",children:[v.jsx(Fs,{className:"h-4 w-4 shrink-0"}),v.jsx("span",{children:a})]}):u&&o?o():u?v.jsxs("div",{className:"p-4 flex items-center gap-2 text-muted-foreground",children:[v.jsx(ei,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}):v.jsx("div",{className:"p-4",children:i(Q)},Pre(Q)),!o&&!s&&!u&&v.jsx(Xne,{container:I,pillContainer:I,defaultActive:!1,showInspector:!0,onChanges:oe,exclude:[".bobbin-pill","[data-bobbin]"]})]}):Me.category==="compilable"&&!m?v.jsx(nE,{content:Q,language:Me.language,editable:!0,onChange:$.updateActiveFile}):Me.category==="text"?v.jsx(nE,{content:Q,language:Me.language,editable:!0,onChange:$.updateActiveFile}):Me.category==="media"?v.jsx(Rre,{content:Q,mimeType:_re($.activeFile),fileName:$.activeFile.split("/").pop()??$.activeFile}):v.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:v.jsx("p",{className:"text-sm",children:"Preview not available for this file type"})})})]}),v.jsx(kre,{entries:$.history,streamingNotes:$.streamingNotes,isStreaming:$.isApplying,pendingPrompt:$.pendingPrompt,className:"h-48"}),($.error||F)&&v.jsxs("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm flex items-center gap-2 border-t-2 border-destructive",children:[v.jsx(Fs,{className:"h-4 w-4 shrink-0"}),$.error||F]}),_.length>0&&v.jsxs("div",{className:"px-4 py-2 bg-blue-50 text-blue-700 text-sm flex items-center gap-2 border-t",children:[v.jsxs("span",{children:[_.length," visual change",_.length!==1?"s":""]}),v.jsx("button",{onClick:()=>E([]),className:"text-xs underline hover:no-underline",children:"Clear"})]}),v.jsxs("div",{className:"p-4 border-t-2 bg-primary/5 flex gap-2 items-end",children:[v.jsx("div",{className:"flex-1",children:v.jsx(tM,{value:k,onChange:C,onSubmit:P,placeholder:"Describe changes...",disabled:$.isApplying})}),v.jsx("button",{onClick:P,disabled:!k.trim()&&_.length===0||$.isApplying,className:"px-3 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center gap-1 shrink-0",children:$.isApplying?v.jsx(ei,{className:"h-4 w-4 animate-spin"}):v.jsx(v_,{className:"h-4 w-4"})})]})]})}),v.jsx(Ire,{isOpen:M,isSaving:O,error:F,onSave:ke,onDiscard:_e,onCancel:Pe})]}):null}var iM="/vfs",Jf=null;async function zre(){if(Jf)return Jf;try{const e=await fetch(`${iM}/config`);if(e.ok)return Jf=await e.json(),Jf}catch{}return{usePaths:!1}}var t1=null;function rb(){if(!t1){const e=new TV({baseUrl:iM});t1=new AV(e,{sync:!0,conflictStrategy:"local-wins"})}return t1}async function rE(e){await rb().saveProject(e)}async function Lre(e,t){return rb().readFile(e,t)}function Fre(e){return rb().on("change",e)}function oM(e){return{name:"preview",version:"1.0.0",platform:"browser",image:"@aprovan/patchwork-image-shadcn",services:e}}function sM(e,t,n,r){const[i,o]=T.useState(!1),[s,a]=T.useState(null),u=T.useRef(null),c=T.useRef(null);return T.useEffect(()=>{if(!n||!e||!u.current)return;let f=!1;async function h(){if(!(!u.current||!e)){o(!0),a(null);try{c.current&&(e.unmount(c.current),c.current=null);const m=await e.compile(t,oM(r),{typescript:!0});if(f)return;const g=await e.mount(m,{target:u.current,mode:"embedded"});c.current=g}catch(m){f||a(m instanceof Error?m.message:"Failed to render JSX")}finally{f||o(!1)}}}return h(),()=>{f=!0,c.current&&e&&(e.unmount(c.current),c.current=null)}},[t,e,n,r]),{containerRef:u,loading:i,error:s}}function $re({code:e,compiler:t,services:n,filePath:r,entrypoint:i="index.ts"}){const[o,s]=T.useState(!1),[a,u]=T.useState(!0),[c,f]=T.useState(e),[h,m]=T.useState(0),[g,x]=T.useState("unsaved"),[b,k]=T.useState(e),[C,_]=T.useState(null),E=T.useRef(c),I=T.useRef(b),N=T.useRef(o),M=T.useMemo(()=>crypto.randomUUID(),[]),j=T.useCallback(async()=>{if(r&&(await zre()).usePaths){const he=r.split("/");return he.length>1?he.slice(0,-1).join("/"):r.replace(/\.[^.]+$/,"")}return M},[r,M]),O=T.useCallback(()=>{if(r){const Q=r.split("/");return Q[Q.length-1]||i}return i},[r]);T.useEffect(()=>{E.current=c},[c]),T.useEffect(()=>{I.current=b},[b]),T.useEffect(()=>{N.current=o},[o]),T.useEffect(()=>{let Q=!0;return(async()=>{const he=await j(),te=O();Q&&_(`${he}/${te}`)})(),()=>{Q=!1}},[j,O]),T.useEffect(()=>{if(!C)return;const Q=Fre(async he=>{if(he.path===C){if(he.type==="delete"){x("unsaved");return}if(!N.current)try{const te=await Lre(C);if(E.current!==I.current){x("unsaved");return}te!==E.current&&(f(te),k(te),x("saved"))}catch{x("error")}}});return()=>Q()},[C]);const R=T.useCallback(async()=>{x("saving");try{const Q=await j(),he=O(),te=Eh(c,he,Q);await rE(te),k(c),x("saved")}catch(Q){console.warn("[VFS] Failed to save project:",Q),x("error")}},[c,j,O]),{containerRef:F,loading:ee,error:X}=sM(t,c,a&&!o,n),Se=T.useCallback(async Q=>{if(!t)return{success:!0};const he=[],te=console.error;console.error=(...Me)=>{he.push(Me.map(D=>typeof D=="object"?JSON.stringify(D):String(D)).join(" ")),te.apply(console,Me)};try{return await t.compile(Q,oM(n),{typescript:!0}),{success:!0}}catch(Me){const D=Me instanceof Error?Me.message:"Compilation failed",W=he.length>0?`
1452
-
1453
- Console errors:
1454
- ${he.join(`
1455
- `)}`:"";return{success:!1,error:D+W}}finally{console.error=te}},[t,n]),ue=()=>{f(e),m(0)},$=c!==e;return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"my-3 border rounded-lg",children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/50 border-b rounded-t-lg",children:[v.jsx(x1,{className:"h-4 w-4 text-muted-foreground"}),h>0&&v.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[v.jsx(WP,{className:"h-3 w-3"}),h," edit",h!==1?"s":""]}),v.jsx("button",{onClick:R,disabled:g==="saving",className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${g==="saved"?"text-green-600":g==="error"?"text-destructive hover:bg-muted":"text-muted-foreground hover:bg-muted"}`,title:g==="saved"?"Saved to disk":g==="saving"?"Saving...":g==="error"?"Save failed - click to retry":"Click to save",children:g==="saving"?v.jsx(ei,{className:"h-3 w-3 animate-spin"}):v.jsxs("span",{className:"relative",children:[v.jsx(MP,{className:"h-3 w-3"}),g==="saved"&&v.jsx(CP,{className:"h-2 w-2 absolute -bottom-0.5 -right-0.5 stroke-[3]"})]})}),v.jsxs("div",{className:"ml-auto flex gap-1",children:[$&&v.jsx("button",{onClick:ue,className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-muted text-muted-foreground",title:"Revert to original",children:v.jsx(b_,{className:"h-3 w-3"})}),v.jsx("button",{onClick:()=>s(!0),className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-muted",title:"Edit component",children:v.jsx(x_,{className:"h-3 w-3"})}),v.jsxs("button",{onClick:()=>u(!a),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${a?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,children:[a?v.jsx(y_,{className:"h-3 w-3"}):v.jsx(x1,{className:"h-3 w-3"}),a?"Preview":"Code"]})]})]}),a?v.jsxs("div",{className:"bg-white",children:[X?v.jsxs("div",{className:"p-3 text-sm text-destructive flex items-center gap-2",children:[v.jsx(Fs,{className:"h-4 w-4 shrink-0"}),v.jsx("span",{children:X})]}):ee?v.jsxs("div",{className:"p-3 flex items-center gap-2 text-muted-foreground",children:[v.jsx(ei,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}):t?null:v.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:"Compiler not initialized"}),v.jsx("div",{ref:F})]}):v.jsx("div",{className:"p-3 bg-muted/30 overflow-auto max-h-96",children:v.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words m-0",children:v.jsx("code",{children:c})})})]}),v.jsx(jre,{isOpen:o,onClose:(Q,he)=>{f(Q),m(te=>te+he),s(!1),he>0&&(x("saving"),(async()=>{try{const te=await j(),Me=O(),D=Eh(Q,Me,te);await rE(D),x("saved")}catch(te){console.warn("[VFS] Failed to save project:",te),x("error")}})())},originalCode:c,compile:Se,renderPreview:Q=>v.jsx(Bre,{code:Q,compiler:t,services:n})})]})}function Bre({code:e,compiler:t,services:n}){const{containerRef:r,loading:i,error:o}=sM(t,e,!0,n);return v.jsxs(v.Fragment,{children:[o&&v.jsxs("div",{className:"text-sm text-destructive flex items-center gap-2",children:[v.jsx(Fs,{className:"h-4 w-4 shrink-0"}),v.jsx("span",{children:o})]}),i&&v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx(ei,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}),!t&&!i&&!o&&v.jsx("div",{className:"text-sm text-muted-foreground",children:"Compiler not initialized"}),v.jsx("div",{ref:r})]})}function Ure({children:e,className:t=""}){return v.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 ${t}`,children:e})}function Vre({children:e,open:t,onOpenChange:n}){return t?v.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>n==null?void 0:n(!1),children:v.jsx("div",{className:"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 bg-background p-6 shadow-lg rounded-lg",onClick:r=>r.stopPropagation(),children:e})}):null}function Hre({namespaces:e,services:t=[],BadgeComponent:n=Ure,DialogComponent:r=Vre}){const[i,o]=T.useState(!1);if(e.length===0)return null;const s=t.reduce((a,u)=>{var c;return(a[c=u.namespace]??(a[c]=[])).push(u),a},{});return v.jsxs(v.Fragment,{children:[v.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[v.jsx(QP,{className:"h-4 w-4 text-muted-foreground"}),v.jsxs(n,{className:"text-xs",children:[e.length," service",e.length!==1?"s":""]})]}),v.jsxs(r,{open:i,onOpenChange:o,children:[v.jsxs("div",{className:"flex justify-between items-center mb-4",children:[v.jsx("h2",{className:"text-lg font-semibold",children:"Available Services"}),v.jsx("button",{onClick:()=>o(!1),className:"text-muted-foreground hover:text-foreground",children:"×"})]}),v.jsx("div",{className:"space-y-3 max-h-96 overflow-auto",children:e.map(a=>{var u;return v.jsxs("details",{open:e.length===1,children:[v.jsxs("summary",{className:"flex items-center gap-2 w-full p-2 rounded bg-muted/50 hover:bg-muted transition-colors cursor-pointer",children:[v.jsx(Oc,{className:"h-4 w-4 text-muted-foreground"}),v.jsx("span",{className:"font-medium text-sm",children:a}),s[a]&&v.jsxs(n,{className:"ml-auto text-xs",children:[s[a].length," tool",s[a].length!==1?"s":""]})]}),v.jsx("div",{className:"ml-6 mt-2 space-y-2",children:((u=s[a])==null?void 0:u.map(c=>v.jsxs("details",{children:[v.jsxs("summary",{className:"flex items-center gap-2 w-full text-left text-sm hover:text-foreground text-muted-foreground transition-colors cursor-pointer",children:[v.jsx(Oc,{className:"h-3 w-3"}),v.jsx("code",{className:"font-mono text-xs",children:c.procedure}),v.jsx("span",{className:"truncate text-xs opacity-70",children:c.description})]}),v.jsx("div",{className:"ml-5 mt-1 p-2 rounded border bg-muted/30 overflow-auto max-h-48",children:v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words m-0",children:JSON.stringify(c.parameters.jsonSchema,null,2)})})]},c.name)))??v.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool details available"})})]},a)})})]})]})}var Wre=/```([a-zA-Z0-9_+-]*)((?:\s+[a-zA-Z_][\w-]*="[^"]*")*)\s*\n([\s\S]*?)```/g,qre=/```([a-zA-Z0-9_+-]*)((?:\s+[a-zA-Z_][\w-]*="[^"]*")*)\s*\n([\s\S]*)$/,Zre=/([a-zA-Z_][\w-]*)="([^"]*)"/g;function iE(e){const t={};if(!e)return t;const n=new RegExp(Zre.source,"g");let r;for(;(r=n.exec(e))!==null;){const i=r[1],o=r[2];i&&o!==void 0&&(t[i]=o)}return t}function Jre(e,t={}){var f,h;const{filterLanguages:n,includeUnclosed:r=!1}=t,i=[];let o=0;const s=[],a=new RegExp(Wre.source,"g");let u;for(;(u=a.exec(e))!==null;){const m=((f=u[1])==null?void 0:f.toLowerCase())||"",g=iE(u[2]||""),x=u[3]??"",b=!n||n.has(m);s.push({match:u,language:m,content:x,attributes:g,included:b})}for(const{match:m,language:g,content:x,attributes:b,included:k}of s){if(m.index>o){const C=e.slice(o,m.index);C.trim()&&i.push({type:"text",content:C})}o=m.index+m[0].length,k&&i.push({type:"code",content:x,language:g,attributes:b})}const c=e.slice(o);if(r&&c.includes("```")){const m=c.match(qre);if(m){const g=((h=m[1])==null?void 0:h.toLowerCase())||"",x=iE(m[2]||""),b=m[3]??"",k=!n||n.has(g),C=c.indexOf("```");if(C>0){const _=c.slice(0,C);_.trim()&&i.push({type:"text",content:_})}k&&i.push({type:"code",content:b,language:g,attributes:x}),o=e.length}}if(o<e.length){const m=e.slice(o);m.trim()&&i.push({type:"text",content:m})}return i.length===0&&i.push({type:"text",content:e}),i}const ih="https://raw.githubusercontent.com/AprovanLabs/aprovan.com/main/docs/assets/social-labs.png",ib=T.createContext({compiler:null,namespaces:[]}),Kre=()=>T.useContext(ib).compiler,Gre=()=>T.useContext(ib).namespaces;function Yre({text:e,isUser:t}){const n=Kre(),r=Gre();if(t)return v.jsx("div",{className:"prose prose-sm prose-invert prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-pre:my-2 prose-code:before:content-none prose-code:after:content-none",children:v.jsx(cc,{remarkPlugins:[dc],children:e})});const i=Jre(e);return v.jsx("div",{className:"prose prose-sm dark:prose-invert prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-pre:my-2 prose-code:before:content-none prose-code:after:content-none",children:i.map((o,s)=>{var a;return o.type==="code"?v.jsx($re,{code:o.content,compiler:n,services:r,filePath:(a=o.attributes)==null?void 0:a.path,entrypoint:"main.tsx"},s):v.jsx(cc,{remarkPlugins:[dc],children:o.content},s)})})}function Qre({text:e,isStreaming:t}){return v.jsxs(v3,{defaultOpen:t,children:[v.jsxs(k3,{className:"flex items-center gap-2 text-yellow-700 dark:text-yellow-400 hover:opacity-80 w-full",children:[v.jsx(kP,{className:"h-4 w-4"}),v.jsx("span",{className:"text-xs font-medium",children:"Thinking"}),t&&v.jsx(ei,{className:"h-3 w-3 animate-spin"}),v.jsx(Oc,{className:"h-3 w-3 ml-auto transition-transform [[data-state=open]>&]:rotate-180"})]}),v.jsx(w3,{children:v.jsx("div",{className:"mt-2 p-3 rounded border-l-4 border-yellow-500 bg-yellow-50 dark:bg-yellow-950/50",children:v.jsx("p",{className:"text-sm text-muted-foreground italic whitespace-pre-wrap",children:e})})})]})}function Xre({toolName:e,state:t,input:n,output:r,errorText:i}){const o=t==="input-streaming"||t==="input-available",s=t==="output-error";return v.jsxs(v3,{className:"my-1 w-full",children:[v.jsxs(k3,{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border bg-muted/50 hover:bg-muted text-xs transition-colors",children:[v.jsx(i9,{className:"h-3 w-3 text-muted-foreground"}),v.jsx("span",{className:"font-mono",children:e}),v.jsxs("span",{className:"w-3 h-3 flex items-center justify-center",children:[o&&v.jsx(ei,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s&&v.jsx(Fs,{className:"h-3 w-3 text-destructive"})]}),v.jsx(Oc,{className:"h-3 w-3 text-muted-foreground transition-transform [[data-state=open]>&]:rotate-180"})]}),v.jsxs(w3,{className:"mt-2 p-3 rounded-lg border bg-white space-y-2",children:[n!==void 0&&v.jsxs("div",{children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"}),v.jsx("div",{className:"mt-1 p-2 bg-muted/30 rounded text-xs overflow-auto max-h-48",children:v.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:typeof n=="string"?n:JSON.stringify(n,null,2)})})]}),r!==void 0&&v.jsxs("div",{children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"}),v.jsx("div",{className:"mt-1 p-2 bg-muted/30 rounded text-xs overflow-auto max-h-48",children:v.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:typeof r=="string"?r:JSON.stringify(r,null,2)})})]}),i&&v.jsxs("div",{className:"text-sm text-destructive flex items-center gap-2",children:[v.jsx(Fs,{className:"h-4 w-4 shrink-0"}),v.jsx("span",{className:"break-words",children:i})]})]})]})}function eie({message:e}){var r,i;const t=e.role==="user",n=(r=e.parts)==null?void 0:r.some(o=>"state"in o&&(o.state==="input-streaming"||o.state==="input-available"));return v.jsxs("div",{className:`flex gap-3 ${t?"justify-end":"justify-start"}`,children:[!t&&v.jsxs(bh,{className:"h-8 w-8 shrink-0",children:[v.jsx("img",{src:ih,alt:"Assistant",className:"rounded-full"}),v.jsx(vh,{className:"bg-primary text-primary-foreground",children:"A"})]}),v.jsxs("div",{className:`flex flex-col gap-1 max-w-[80%] min-w-0 ${t?"items-end":"items-start"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 h-5",children:[v.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.role}),n&&v.jsxs(Vj,{variant:"outline",className:"text-xs",children:[v.jsx(ei,{className:"h-3 w-3 mr-1 animate-spin"}),"streaming"]})]}),v.jsx("div",{className:`rounded-lg px-4 py-2 overflow-hidden w-full ${t?"bg-primary text-primary-foreground":"bg-muted"}`,children:(i=e.parts)==null?void 0:i.map((o,s)=>{if(o.type==="text")return v.jsx(Yre,{text:o.text,isUser:t},s);if(o.type==="reasoning")return v.jsx(Qre,{text:o.text,isStreaming:o.state==="streaming"},s);if(o.type.startsWith("tool-")||o.type==="dynamic-tool"){const a=o,u=a.toolName??o.type.replace("tool-","");return v.jsx(Xre,{toolName:u,state:a.state,input:a.input,output:a.output,errorText:a.errorText},s)}return null})})]}),t&&v.jsx(bh,{className:"h-8 w-8 shrink-0",children:v.jsx(vh,{className:"bg-secondary",children:"U"})})]})}const tie="/api/proxy",oE="@aprovan/patchwork-image-shadcn",nie="https://esm.sh",rie="https://esm.sh";function iie(){var C;const[e,t]=T.useState("What's the weather in Houston, Texas like?"),[n,r]=T.useState(null),[i,o]=T.useState([]),[s,a]=T.useState([]),u=T.useRef(null);T.useEffect(()=>{fetch("/api/services").then(_=>_.json()).then(_=>{o(_.namespaces??[])}).catch(()=>{o([]),a([])}),kV({image:oE,proxyUrl:tie,cdnBaseUrl:nie,widgetCdnBaseUrl:rie}).then(r).catch(console.error)},[]);const c=T.useMemo(()=>({compiler:n,namespaces:i}),[n,i]),f=T.useMemo(()=>new h_({body:()=>({metadata:{patchwork:{compilers:[oE]}}})}),[]),{messages:h,sendMessage:m,status:g,error:x}=pP({transport:f}),b=g==="submitted"||g==="streaming",k=T.useCallback(_=>{_==null||_.preventDefault(),e.trim()&&(m({text:e}),t(""))},[e,m]);return T.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[h]),v.jsx(ib.Provider,{value:c,children:v.jsx("div",{className:"flex flex-col h-screen max-w-4xl mx-auto p-4",children:v.jsxs(f3,{className:"flex-1 flex flex-col min-h-0 overflow-hidden border",children:[v.jsx(h3,{className:"border-b py-3",children:v.jsxs(p3,{className:"flex items-center gap-3",children:[v.jsx("img",{src:ih,alt:"Aprovan",className:"h-8 w-8 rounded-full"}),v.jsx("span",{className:"text-lg",children:"patchwork"}),v.jsx(Hre,{namespaces:i,services:s})]})}),v.jsx(m3,{className:"flex-1 p-0 min-h-0",children:v.jsx(t3,{className:"h-full",ref:u,children:v.jsxs("div",{className:"p-4 space-y-4",children:[h.length===0?v.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[v.jsx("img",{src:ih,alt:"",className:"h-12 w-12 mx-auto mb-4 opacity-50 rounded-full"}),v.jsx("p",{children:"Start a conversation"})]}):h.map(_=>v.jsx(eie,{message:_},_.id)),b&&((C=h[h.length-1])==null?void 0:C.role)!=="assistant"&&v.jsxs("div",{className:"flex gap-3 justify-start",children:[v.jsxs(bh,{className:"h-8 w-8 shrink-0",children:[v.jsx("img",{src:ih,alt:"",className:"rounded-full"}),v.jsx(vh,{children:"A"})]}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("div",{className:"h-5"}),v.jsx("div",{className:"bg-muted rounded-lg px-4 py-2",children:v.jsx(ei,{className:"h-4 w-4 animate-spin"})})]})]})]})})}),x&&v.jsxs("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm flex items-center gap-2",children:[v.jsx(Fs,{className:"h-4 w-4"}),x.message]}),v.jsx("div",{className:"p-4 border-t",children:v.jsxs("form",{onSubmit:k,className:"flex gap-2 items-end",children:[v.jsx(tM,{value:e,onChange:t,onSubmit:()=>{!b&&e.trim()&&k()},placeholder:"Type a message... (Shift+Enter for new line)",disabled:b}),v.jsx($_,{type:"submit",disabled:b||!e.trim(),className:"shrink-0",children:b?v.jsx(ei,{className:"h-4 w-4 animate-spin"}):v.jsx(v_,{className:"h-4 w-4"})})]})})]})})})}function oie(){return v.jsx(iie,{})}GN.createRoot(document.getElementById("root")).render(v.jsx(zo.StrictMode,{children:v.jsx(oie,{})}));