@nextclaw/ui 0.26.5 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/.vite/manifest.json +1271 -1227
  3. package/dist/assets/{abnfDiagram-VRR7QNED-Dcw10Yt1.js → abnfDiagram-VRR7QNED-DmeCRAkd.js} +1 -1
  4. package/dist/assets/account-panel-BYxGT4m4.js +1 -0
  5. package/dist/assets/{aiden0z-pptx-renderer.es--oNqetPA.js → aiden0z-pptx-renderer.es-ChX5DHqP.js} +1 -1
  6. package/dist/assets/api-CG22BskB.js +20 -0
  7. package/dist/assets/app-presenter-provider-CJFjhVYI.js +28 -0
  8. package/dist/assets/app-presenter-provider-D3BuuOyZ.css +1 -0
  9. package/dist/assets/appearance-settings-page-BcXr0vHp.js +1 -0
  10. package/dist/assets/{arc-DBRedCax.js → arc-Cu6Ols44.js} +1 -1
  11. package/dist/assets/architecture-TIHT7OUA-CLjV_xu4.js +1 -0
  12. package/dist/assets/{architectureDiagram-ZJ3FMSHR-Dufhtuv-.js → architectureDiagram-ZJ3FMSHR-DrNB0eLE.js} +1 -1
  13. package/dist/assets/{blockDiagram-677ZJIJ3-BUk0vtJ7.js → blockDiagram-677ZJIJ3-08rHt6DJ.js} +1 -1
  14. package/dist/assets/{book-open-Bcnn2_uV.js → book-open-ClbJmmxP.js} +1 -1
  15. package/dist/assets/{c4Diagram-LMCZKHZV-CxDcVE9p.js → c4Diagram-LMCZKHZV-CCVgRG-u.js} +1 -1
  16. package/dist/assets/{card-Cqs73hGI.js → card-BdC01NFF.js} +1 -1
  17. package/dist/assets/channel-BgpbPyEH.js +1 -0
  18. package/dist/assets/channels-list-page-BrIvJlop.js +8 -0
  19. package/dist/assets/chunk-2Q5K7J3B-DjhMPqAC.js +1 -0
  20. package/dist/assets/{chunk-32BRIVSS-DSF3KElA.js → chunk-32BRIVSS-BeCaI-JN.js} +1 -1
  21. package/dist/assets/{chunk-52WLFC77-Costxzr3.js → chunk-52WLFC77-ZXIcYPYs.js} +1 -1
  22. package/dist/assets/{chunk-5FCAYU7R-rhqzGGZo.js → chunk-5FCAYU7R-DDwTPcy8.js} +1 -1
  23. package/dist/assets/{chunk-5HE753X5-BsEsmIao.js → chunk-5HE753X5-WygrMYPL.js} +1 -1
  24. package/dist/assets/{chunk-5JV3BV7I-Dqw_DCoN.js → chunk-5JV3BV7I-o8T3KZgk.js} +1 -1
  25. package/dist/assets/{chunk-5TONJI2A-Cft82fp8.js → chunk-5TONJI2A-BKFbUT7J.js} +1 -1
  26. package/dist/assets/{chunk-5VM5RSS4-DqNHn9Dl.js → chunk-5VM5RSS4-DYxCRV86.js} +1 -1
  27. package/dist/assets/{chunk-7BUUIJ7U-A5SBEMYY.js → chunk-7BUUIJ7U-CvSeJlKZ.js} +1 -1
  28. package/dist/assets/{chunk-BIQX33UG-1Ng3mTrH.js → chunk-BIQX33UG-BhH3RHCY.js} +1 -1
  29. package/dist/assets/{chunk-C7G6YPKG-DRJEy8ZI.js → chunk-C7G6YPKG-BTL0-xL3.js} +1 -1
  30. package/dist/assets/{chunk-CQNSW5MT-Bydv_J3J.js → chunk-CQNSW5MT-DWAU4QaD.js} +1 -1
  31. package/dist/assets/{chunk-CYSBUYHQ-HkMIg12u.js → chunk-CYSBUYHQ-B7ZBMXTx.js} +1 -1
  32. package/dist/assets/{chunk-EMLP6XTP-C5ndDvm3.js → chunk-EMLP6XTP-D92HvnHE.js} +1 -1
  33. package/dist/assets/{chunk-EX3LRPZG-DzeloZRo.js → chunk-EX3LRPZG-DfOGKwW8.js} +1 -1
  34. package/dist/assets/{chunk-FWX5IMBZ-n_2_CLTQ.js → chunk-FWX5IMBZ-DUuJUrXJ.js} +2 -2
  35. package/dist/assets/{chunk-HOUHSVGY-kx_slvu3.js → chunk-HOUHSVGY-i3MDyUY5.js} +1 -1
  36. package/dist/assets/{chunk-ICXQ74PX-sQLMURqL.js → chunk-ICXQ74PX-F_pmNX6t.js} +1 -1
  37. package/dist/assets/{chunk-JG7HCLWE-CMUn5Elc.js → chunk-JG7HCLWE-DygOelrU.js} +1 -1
  38. package/dist/assets/{chunk-JWPE2WC7-Cra3s-Uk.js → chunk-JWPE2WC7-BpiZMeRl.js} +1 -1
  39. package/dist/assets/{chunk-MOJQB5TN-umcrg5Bi.js → chunk-MOJQB5TN-CV10sB1I.js} +1 -1
  40. package/dist/assets/{chunk-MOZMSUNE-BnljD1ig.js → chunk-MOZMSUNE-Cf1WZNm0.js} +1 -1
  41. package/dist/assets/{chunk-OGEWGWER-BXx5pQjU.js → chunk-OGEWGWER-DuSw54VR.js} +1 -1
  42. package/dist/assets/{chunk-OSBZ3O6U-D-1qfdWu.js → chunk-OSBZ3O6U-_rt_XKSZ.js} +1 -1
  43. package/dist/assets/{chunk-PUDLZKDR-DLzX78LC.js → chunk-PUDLZKDR-BFPaAGNW.js} +1 -1
  44. package/dist/assets/{chunk-Q4XR5HBZ-DTK-rtW6.js → chunk-Q4XR5HBZ-GE0v_E5y.js} +1 -1
  45. package/dist/assets/{chunk-QBLGF6JB-CsFeIGfr.js → chunk-QBLGF6JB-BK_FpnlJ.js} +1 -1
  46. package/dist/assets/{chunk-R7FJI6CG-4xNYUeng.js → chunk-R7FJI6CG-CpYh6rGo.js} +1 -1
  47. package/dist/assets/{chunk-RYQCIY6F-DJiHiTE5.js → chunk-RYQCIY6F-htnxL_Cl.js} +1 -1
  48. package/dist/assets/{chunk-U6XO7XAA-BVYkauHz.js → chunk-U6XO7XAA-wDbE4BZ7.js} +1 -1
  49. package/dist/assets/{chunk-V7JOEXUC-BsazE8cS.js → chunk-V7JOEXUC-DDRSVFTB.js} +1 -1
  50. package/dist/assets/chunk-VAUOI2AC-GYimZYx9.js +1 -0
  51. package/dist/assets/{chunk-VR4S4FIN-7RoZQffO.js → chunk-VR4S4FIN-COdhHR1o.js} +1 -1
  52. package/dist/assets/{chunk-WYO6CB5R-DEuS6N1R.js → chunk-WYO6CB5R-DPDGhyF6.js} +3 -3
  53. package/dist/assets/chunk-XXDRQBXY-KKCf0HV5.js +1 -0
  54. package/dist/assets/{chunk-YOTPTUD7-9KBrosZL.js → chunk-YOTPTUD7-D8ir9Nx5.js} +1 -1
  55. package/dist/assets/{chunk-ZGVPDNZ5-IYgN9f5A.js → chunk-ZGVPDNZ5-BuNKD836.js} +1 -1
  56. package/dist/assets/{chunk-ZIRB5QZD-BUo0-zcp.js → chunk-ZIRB5QZD-DyHzq8jH.js} +1 -1
  57. package/dist/assets/{circle-dashed-EY1ScSMe.js → circle-dashed-nDaMRmP-.js} +1 -1
  58. package/dist/assets/classDiagram-OUVF2IWQ-iRMPRR8M.js +1 -0
  59. package/dist/assets/classDiagram-v2-EOCWNBFH-BguFy_wj.js +1 -0
  60. package/dist/assets/{client-CH7w6yRV.js → client-DlFB5dW5.js} +1 -1
  61. package/dist/assets/config-split-page-C06fU9OQ.js +1 -0
  62. package/dist/assets/confirm-dialog-DpcmlXhd.js +1 -0
  63. package/dist/assets/{app-presenter-provider-jNGlmBLe.css → context-menu-DEcVZfaU.css} +1 -1
  64. package/dist/assets/context-menu-DKIEaY7f.js +211 -0
  65. package/dist/assets/{cose-bilkent-JH36ORCC-DhqbC1fR.js → cose-bilkent-JH36ORCC-B1I1_P6a.js} +1 -1
  66. package/dist/assets/{createLucideIcon-Cfo2ySi5.js → createLucideIcon-Lnt-4LMC.js} +1 -1
  67. package/dist/assets/cynefin-VYW2F7L2-CtbjXuCW.js +1 -0
  68. package/dist/assets/{cynefinDiagram-TSTJHNR4-C-TBRi5V.js → cynefinDiagram-TSTJHNR4-DcOnhnCo.js} +1 -1
  69. package/dist/assets/{dagre-VKFMJZFB-BmafJymp.js → dagre-VKFMJZFB-hAX89lg3.js} +1 -1
  70. package/dist/assets/{dagre-CrgsRasE.js → dagre-nSYhf9yY.js} +1 -1
  71. package/dist/assets/{desktop-capabilities-page-BDYITStl.js → desktop-capabilities-page-DPORyZAu.js} +1 -1
  72. package/dist/assets/desktop-update-config-BMTeWZmn.js +1 -0
  73. package/dist/assets/{diagram-FQU43EPY-BoOMwa6D.js → diagram-FQU43EPY-C1mRMD2k.js} +1 -1
  74. package/dist/assets/{diagram-G47NLZAW-Le7N6Uym.js → diagram-G47NLZAW-D2XBn5al.js} +1 -1
  75. package/dist/assets/{diagram-NH7WQ7WH-Fbpj3-MO.js → diagram-NH7WQ7WH-3LmRsmkC.js} +1 -1
  76. package/dist/assets/{diagram-OA4YK3LP-D3QuGGuu.js → diagram-OA4YK3LP-CFWn-osC.js} +1 -1
  77. package/dist/assets/{diagram-WEI45ONY-Cxu1uiN6.js → diagram-WEI45ONY-BqNRbUvU.js} +1 -1
  78. package/dist/assets/dialog-BNXSPMX_.js +1 -0
  79. package/dist/assets/dist-Cuiqqp1O.js +41 -0
  80. package/dist/assets/doc-browser-CDEapjmj.js +1 -0
  81. package/dist/assets/{doc-browser-context-DwgG6wrz.js → doc-browser-context-0QDWYorh.js} +1 -1
  82. package/dist/assets/{docx-preview-CkU2psnd.js → docx-preview-CunAATyC.js} +1 -1
  83. package/dist/assets/{download-BoaKzDJk.js → download-f_sPcoLZ.js} +1 -1
  84. package/dist/assets/{ebnfDiagram-CCIWWBDH-CCAjuQM6.js → ebnfDiagram-CCIWWBDH-CYb8IwqD.js} +1 -1
  85. package/dist/assets/{erDiagram-Q63AITRT-BuzUAq-d.js → erDiagram-Q63AITRT-H47mUoeK.js} +1 -1
  86. package/dist/assets/eventmodeling-45OFAUF4-Djd6id_u.js +1 -0
  87. package/dist/assets/extensions-B-0xQz3L.js +1 -0
  88. package/dist/assets/external-link-CbVlnlNy.js +1 -0
  89. package/dist/assets/flowDiagram-23GEKE2U-DUrsM_ZL.js +1 -0
  90. package/dist/assets/{form-actions-D9JWSFQu.js → form-actions-BoTqELHB.js} +1 -1
  91. package/dist/assets/{ganttDiagram-NO4QXBWP-cJmWVY8F.js → ganttDiagram-NO4QXBWP-hSX45zfV.js} +1 -1
  92. package/dist/assets/gitGraph-TEB2WS4Q-CU6P_2Cm.js +1 -0
  93. package/dist/assets/{gitGraphDiagram-IHSO6WYX-F58o-vtP.js → gitGraphDiagram-IHSO6WYX-Br0UW2qg.js} +1 -1
  94. package/dist/assets/{i18n-Bm3Ov7Fy.js → i18n-B0V5NkFj.js} +2 -2
  95. package/dist/assets/inbox-Bna8iUy0.js +1 -0
  96. package/dist/assets/info-DKCQHKI2-Bj2P_7RC.js +1 -0
  97. package/dist/assets/{infoDiagram-FWYZ7A6U-Gt59b83C.js → infoDiagram-FWYZ7A6U-DQmP_67w.js} +1 -1
  98. package/dist/assets/{ishikawaDiagram-FXEZZL3T-1u4IAj1I.js → ishikawaDiagram-FXEZZL3T-BHAV2oes.js} +1 -1
  99. package/dist/assets/{journeyDiagram-5HDEW3XC-CCQsfV-5.js → journeyDiagram-5HDEW3XC-CFHax4_d.js} +1 -1
  100. package/dist/assets/{kanban-definition-HUTT4EX6-vlB6O_Zn.js → kanban-definition-HUTT4EX6-B4ZA9rp5.js} +1 -1
  101. package/dist/assets/katex-BprZ-Wwb.js +1 -0
  102. package/dist/assets/{keyboard-shortcuts-settings-page-DZ8A1iLg.js → keyboard-shortcuts-settings-page-BluWKrSo.js} +1 -1
  103. package/dist/assets/{line-D_bHubTL.js → line-BboM0HLF.js} +1 -1
  104. package/dist/assets/{linear-ChlwuS5y.js → linear-4K_M1oYM.js} +1 -1
  105. package/dist/assets/login-page-BMHW0Hh0.js +1 -0
  106. package/dist/assets/{login-page-C-DvcG3L.js → login-page-JNr5JCEw.js} +1 -1
  107. package/dist/assets/main-BCX_Untx.css +1 -0
  108. package/dist/assets/main-C5kbmGUV.js +2 -0
  109. package/dist/assets/main-i18n-catalog.config-DO4wNT7T.js +1 -0
  110. package/dist/assets/{map-oGHTsIu8.js → map-26GpO1wn.js} +1 -1
  111. package/dist/assets/mcp-marketplace-page-CV-PHKTN.js +1 -0
  112. package/dist/assets/{mermaid-parser.core-CuRe1ZG4.js → mermaid-parser.core-BTJFnvRC.js} +2 -2
  113. package/dist/assets/{mermaid.core-u4YCFKRf.js → mermaid.core-B7ufoXgq.js} +3 -3
  114. package/dist/assets/{mindmap-definition-LN4V7U3C-DeJAQYTu.js → mindmap-definition-LN4V7U3C-BHyru6KE.js} +1 -1
  115. package/dist/assets/model-config-page-C-wbM6Fe.js +1 -0
  116. package/dist/assets/{navigation-link-CjxNC8aT.js → navigation-link-DFLSVIut.js} +2 -2
  117. package/dist/assets/{ordinal-C6JFfkKN.js → ordinal-BqFe2ePF.js} +1 -1
  118. package/dist/assets/packet-7NZHBO7P-ti5ge2jr.js +1 -0
  119. package/dist/assets/panel-app-CSQmm_7E.js +1 -0
  120. package/dist/assets/panel-app-i18n-catalog.config-Bo52dPuF.js +1 -0
  121. package/dist/assets/panelStandalone-PuuMF65O.js +2 -0
  122. package/dist/assets/panelStandalone-XRlWxbRS.css +1 -0
  123. package/dist/assets/{pegDiagram-2B236MQR-nVMkxShH.js → pegDiagram-2B236MQR-PVTatU5j.js} +1 -1
  124. package/dist/assets/pie-RZYD4A2V-Bnep8TyV.js +1 -0
  125. package/dist/assets/{pieDiagram-ENE6RG2P-8aUH44QZ.js → pieDiagram-ENE6RG2P-CGc-QCc7.js} +1 -1
  126. package/dist/assets/plus-CywSlIbG.js +1 -0
  127. package/dist/assets/privacy-settings-page-CPdEiouE.js +1 -0
  128. package/dist/assets/projects-D_cd_t4G.js +1 -0
  129. package/dist/assets/provider-models-XRArsply.js +1 -0
  130. package/dist/assets/provider-scoped-model-input-C8JI-hus.js +1 -0
  131. package/dist/assets/providers-config-page-fyMlVgvq.js +1 -0
  132. package/dist/assets/puzzle-Bk3ud1KI.js +1 -0
  133. package/dist/assets/pwa-Cx6Fnox4.js +1 -0
  134. package/dist/assets/{quadrantDiagram-ABIIQ3AL-EY8hpFv8.js → quadrantDiagram-ABIIQ3AL-DGL36riv.js} +1 -1
  135. package/dist/assets/radar-I7S5WNFK-BYg-icAP.js +1 -0
  136. package/dist/assets/railroad-3IZDKUUU-_CHO-Fi1.js +1 -0
  137. package/dist/assets/railroad-abnf-AHOZXSZD-hbQDevHe.js +1 -0
  138. package/dist/assets/railroad-ebnf-EBAXGLYW-v4RZkOfi.js +1 -0
  139. package/dist/assets/railroad-peg-LSFZ7HO6-bC9BqkI5.js +1 -0
  140. package/dist/assets/{railroadDiagram-RFXS5EU6-CNhcIeji.js → railroadDiagram-RFXS5EU6-CyNwvhSb.js} +1 -1
  141. package/dist/assets/{refresh-cw-BlXDrVP0.js → refresh-cw-Ca2napNx.js} +1 -1
  142. package/dist/assets/remote-D5MBQNZE.js +1 -0
  143. package/dist/assets/{requirementDiagram-TGXJPOKE-D8Dcs-Rt.js → requirementDiagram-TGXJPOKE-C31NMKJ0.js} +1 -1
  144. package/dist/assets/{rotate-cw-ei6rPD6z.js → rotate-cw-DXg7sNUE.js} +1 -1
  145. package/dist/assets/runtime-config-page--ivCxBT4.js +1 -0
  146. package/dist/assets/{sankeyDiagram-HTMAVEWB-HTrb6aa-.js → sankeyDiagram-HTMAVEWB-CwrQ_7PA.js} +1 -1
  147. package/dist/assets/{save-DdF-bXgC.js → save-DNigywZ9.js} +1 -1
  148. package/dist/assets/search-U9C0oTQJ.js +1 -0
  149. package/dist/assets/search-config-page-Bdx_RR1q.js +1 -0
  150. package/dist/assets/secrets-config-page-CvMIcsfJ.js +3 -0
  151. package/dist/assets/security-config-CQmMqQ8v.js +1 -0
  152. package/dist/assets/select-DxwDeKUR.js +1 -0
  153. package/dist/assets/{sequenceDiagram-DBY2YBRQ-6f_4X16Y.js → sequenceDiagram-DBY2YBRQ-EFD482_y.js} +1 -1
  154. package/dist/assets/service-apps-panel-CiYO1Be4.js +1 -0
  155. package/dist/assets/{settings-2-CrNhfInU.js → settings-2-BrBUdRoY.js} +1 -1
  156. package/dist/assets/{sizeCapture-X5ZJPWSS-Ck9rsuwL.js → sizeCapture-X5ZJPWSS-TDvULTE1.js} +1 -1
  157. package/dist/assets/{src-C8AUg09O.js → src-CI2AvEMj.js} +1 -1
  158. package/dist/assets/{stateDiagram-2N3HPSRC-Cm33MLHu.js → stateDiagram-2N3HPSRC-JdPsIYHo.js} +1 -1
  159. package/dist/assets/stateDiagram-v2-6OUMAXLB-4_aAQfB_.js +1 -0
  160. package/dist/assets/{status-dot-C3SRFEta.js → status-dot-BbGsrkIX.js} +1 -1
  161. package/dist/assets/{swimlanes-5IMT3BWC-B107vmvM.js → swimlanes-5IMT3BWC-BnxpKeK_.js} +2 -2
  162. package/dist/assets/swimlanesDiagram-G3AALYLV-wCqfwsw-.js +8 -0
  163. package/dist/assets/tag-chip-BDbxcf6P.js +1 -0
  164. package/dist/assets/theme-provider-D98XGa-c.js +1 -0
  165. package/dist/assets/{timeline-definition-FHXFAJF6-CJEoAj33.js → timeline-definition-FHXFAJF6-2IL22-uC.js} +1 -1
  166. package/dist/assets/trash-2-DwSkRfeB.js +1 -0
  167. package/dist/assets/treeView-QDETBFTQ-BAyOb14Z.js +1 -0
  168. package/dist/assets/treemap-6X3UGDF4-DgPDM0zS.js +1 -0
  169. package/dist/assets/{use-config-evzage09.js → use-config-D3cNzk2k.js} +1 -1
  170. package/dist/assets/{use-desktop-capabilities-BYDjFlpt.js → use-desktop-capabilities-D7odgaTB.js} +1 -1
  171. package/dist/assets/use-viewport-layout-BANU5E1t.js +1 -0
  172. package/dist/assets/{vennDiagram-L72KCM5P-DzsUHk5I.js → vennDiagram-L72KCM5P-Cjf6n5Va.js} +1 -1
  173. package/dist/assets/wardley-OPB4EBWU-eCElh8z5.js +1 -0
  174. package/dist/assets/{wardleyDiagram-EHGQE667-1NfFs5ua.js → wardleyDiagram-EHGQE667-yv4qKbBO.js} +1 -1
  175. package/dist/assets/x-BqGj6_Vq.js +1 -0
  176. package/dist/assets/{xychartDiagram-FW5EYKEG-Ci8AI3Qo.js → xychartDiagram-FW5EYKEG-Bmp8Ck8X.js} +1 -1
  177. package/dist/index.html +43 -106
  178. package/dist/panel-standalone.html +18 -12
  179. package/index.html +15 -66
  180. package/package.json +4 -4
  181. package/src/app/styles/design-system.css +85 -1
  182. package/src/app/styles/island-theme.css +8 -6
  183. package/src/features/agents/components/agent-details-dialog.tsx +5 -3
  184. package/src/features/app-data/components/app-retained-data-section.tsx +2 -2
  185. package/src/features/apps/components/__tests__/app-marketplace-catalog.test.tsx +2 -2
  186. package/src/features/apps/components/__tests__/app-packages-panel.test.tsx +94 -23
  187. package/src/features/apps/components/__tests__/apps-panel.test.tsx +5 -3
  188. package/src/features/apps/components/app-document-access-section.tsx +17 -14
  189. package/src/features/apps/components/app-marketplace-catalog.tsx +66 -39
  190. package/src/features/apps/components/app-marketplace-cover.tsx +5 -2
  191. package/src/features/apps/components/app-marketplace-detail.tsx +9 -6
  192. package/src/features/apps/components/app-marketplace-operation.tsx +8 -3
  193. package/src/features/apps/components/app-marketplace-panel.tsx +168 -0
  194. package/src/features/apps/components/app-package-card.tsx +224 -147
  195. package/src/features/apps/components/app-package-details-dialog.tsx +103 -0
  196. package/src/features/apps/components/app-packages-panel.tsx +159 -144
  197. package/src/features/apps/components/apps-panel.tsx +40 -11
  198. package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +1 -1
  199. package/src/features/chat/components/conversation/chat-conversation-header.tsx +1 -1
  200. package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +2 -2
  201. package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +9 -7
  202. package/src/features/chat/features/conversation/components/floating-session-conversation.tsx +2 -3
  203. package/src/features/chat/features/conversation/components/session-conversation-area.tsx +1 -0
  204. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +33 -0
  205. package/src/features/chat/features/message/utils/chat-message-execution-summary.utils.ts +3 -0
  206. package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +1 -0
  207. package/src/features/chat/features/message/utils/chat-message-trigger-details.utils.ts +3 -0
  208. package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +1 -1
  209. package/src/features/chat/features/session/components/session-header/chat-session-metadata-dialog.tsx +1 -1
  210. package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +2 -2
  211. package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +31 -6
  212. package/src/features/chat/features/welcome/components/chat-conversation-welcome.tsx +13 -1
  213. package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +1 -1
  214. package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +1 -1
  215. package/src/features/chat/features/welcome/components/chat-welcome-prompt-suggestions.tsx +56 -13
  216. package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +3 -3
  217. package/src/features/chat/features/welcome/components/chat-welcome.tsx +14 -4
  218. package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-continuation.utils.test.ts +40 -0
  219. package/src/features/chat/features/welcome/utils/chat-welcome-continuation.utils.ts +21 -0
  220. package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +1 -1
  221. package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +3 -7
  222. package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +5 -4
  223. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +27 -27
  224. package/src/features/chat/features/workspace/components/overview/chat-session-continuous-attention.tsx +11 -11
  225. package/src/features/chat/features/workspace/components/overview/chat-session-token-usage.tsx +15 -15
  226. package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +2 -2
  227. package/src/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item.tsx +1 -1
  228. package/src/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar.tsx +2 -2
  229. package/src/features/chat/features/workspace/components/session-cron-job-content.tsx +7 -4
  230. package/src/features/cron/components/cron-job-row.tsx +5 -4
  231. package/src/features/desktop-capabilities/components/desktop-authorization-dialog.tsx +5 -5
  232. package/src/features/inbox/components/inbox-reader-dialog.test.tsx +46 -6
  233. package/src/features/inbox/components/inbox-reader-dialog.tsx +38 -29
  234. package/src/features/inbox/managers/inbox.manager.test.ts +28 -0
  235. package/src/features/inbox/managers/inbox.manager.ts +18 -4
  236. package/src/features/inbox/pages/inbox-page.test.ts +4 -2
  237. package/src/features/inbox/pages/inbox-page.tsx +6 -5
  238. package/src/features/panel-apps/components/panel-app-list-item.tsx +4 -3
  239. package/src/features/panel-apps/components/panel-app-service-action-authorization-dialog.tsx +2 -2
  240. package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +5 -24
  241. package/src/features/projects/components/work/project-work-items.tsx +1 -1
  242. package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +3 -3
  243. package/src/features/pwa/managers/pwa-shell-theme.manager.ts +8 -3
  244. package/src/features/right-panel-resources/components/__tests__/page-resource-icon.test.tsx +13 -2
  245. package/src/features/right-panel-resources/components/page-resource-icon.tsx +15 -7
  246. package/src/features/right-panel-resources/configs/right-panel-resource-routes.config.ts +1 -1
  247. package/src/features/right-panel-resources/index.ts +3 -0
  248. package/src/features/right-panel-resources/utils/__tests__/right-panel-resource-route-resolver.utils.test.ts +5 -0
  249. package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +3 -2
  250. package/src/features/service-apps/components/service-action-row.tsx +4 -3
  251. package/src/features/service-apps/components/service-app-delete-dialog.tsx +2 -2
  252. package/src/features/service-apps/components/service-app-list-item.tsx +5 -4
  253. package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +1 -1
  254. package/src/features/settings/pages/providers-config-page.tsx +3 -2
  255. package/src/index.css +42 -8
  256. package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +2 -2
  257. package/src/shared/components/path-picker/server-path-picker-dialog.tsx +5 -3
  258. package/src/shared/components/ui/__tests__/dialog.test.tsx +37 -1
  259. package/src/shared/components/ui/actions/action-feedback.ts +1 -8
  260. package/src/shared/components/ui/actions/icon-action-button.tsx +1 -1
  261. package/src/shared/components/ui/confirm-dialog.tsx +1 -2
  262. package/src/shared/components/ui/context-menu/context-menu-items.tsx +2 -2
  263. package/src/shared/components/ui/dialog.tsx +29 -7
  264. package/src/shared/components/ui/popover.tsx +14 -3
  265. package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +2 -2
  266. package/src/shared/components/ui/tooltip.tsx +2 -1
  267. package/src/shared/components/workbench/__tests__/workbench-surface.test.tsx +21 -0
  268. package/src/shared/components/workbench/workbench-surface-toolbar.tsx +4 -0
  269. package/src/shared/components/workbench/workbench-surface.tsx +4 -1
  270. package/src/shared/lib/i18n/locales/en-US/chat.json +13 -7
  271. package/src/shared/lib/i18n/locales/en-US/core.json +5 -1
  272. package/src/shared/lib/i18n/locales/en-US/doc-browser.json +10 -5
  273. package/src/shared/lib/i18n/locales/en-US/inbox.json +1 -0
  274. package/src/shared/lib/i18n/locales/zh-CN/chat.json +13 -7
  275. package/src/shared/lib/i18n/locales/zh-CN/core.json +5 -1
  276. package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +11 -6
  277. package/src/shared/lib/i18n/locales/zh-CN/inbox.json +1 -0
  278. package/src/shared/lib/theme/index.test.ts +28 -1
  279. package/src/shared/lib/theme/index.ts +14 -3
  280. package/dist/assets/account-panel-BAH7FW6z.js +0 -1
  281. package/dist/assets/api-DjiZvIa0.js +0 -20
  282. package/dist/assets/app-presenter-provider-CCRFsFYr.js +0 -232
  283. package/dist/assets/appearance-settings-page-CdP86QJ7.js +0 -1
  284. package/dist/assets/architecture-TIHT7OUA-CvnC-LeA.js +0 -1
  285. package/dist/assets/channel-CpMstUPF.js +0 -1
  286. package/dist/assets/channels-list-page-5qGagKuE.js +0 -8
  287. package/dist/assets/chunk-2Q5K7J3B-Djp3VF0s.js +0 -1
  288. package/dist/assets/chunk-VAUOI2AC-BrbiIC1Q.js +0 -1
  289. package/dist/assets/chunk-XXDRQBXY-Cx9N40wF.js +0 -1
  290. package/dist/assets/classDiagram-OUVF2IWQ-DFN1v3PQ.js +0 -1
  291. package/dist/assets/classDiagram-v2-EOCWNBFH-DRvglADa.js +0 -1
  292. package/dist/assets/config-split-page-CuEGQL8Z.js +0 -1
  293. package/dist/assets/confirm-dialog-CxfecBzO.js +0 -1
  294. package/dist/assets/context-menu-BsCj2fRs.js +0 -1
  295. package/dist/assets/cynefin-VYW2F7L2-DXUGnpJH.js +0 -1
  296. package/dist/assets/desktop-update-config-e-zhkJuS.js +0 -1
  297. package/dist/assets/dialog-QjQoKbIV.js +0 -5
  298. package/dist/assets/doc-browser-CLEdkH9z.js +0 -1
  299. package/dist/assets/es2015-Bp6cuSGh.js +0 -41
  300. package/dist/assets/eventmodeling-45OFAUF4-ZBfVS3ZC.js +0 -1
  301. package/dist/assets/extensions-CgShSIkd.js +0 -1
  302. package/dist/assets/eye-kisejBFH.js +0 -1
  303. package/dist/assets/flowDiagram-23GEKE2U-CqdsKk6x.js +0 -1
  304. package/dist/assets/gitGraph-TEB2WS4Q-fHYFd9Es.js +0 -1
  305. package/dist/assets/info-DKCQHKI2-CSaOL_bb.js +0 -1
  306. package/dist/assets/katex-B4FQSo9k.js +0 -1
  307. package/dist/assets/loader-circle-Bd1fTm-x.js +0 -1
  308. package/dist/assets/login-page-D99JjH9F.js +0 -1
  309. package/dist/assets/main-Bt5r6b21.js +0 -2
  310. package/dist/assets/main-DXd_aKJV.css +0 -1
  311. package/dist/assets/main-i18n-catalog.config-D0Ll36J_.js +0 -1
  312. package/dist/assets/mcp-marketplace-page-DUoGfSmY.js +0 -1
  313. package/dist/assets/model-config-page-9NNf-mzK.js +0 -1
  314. package/dist/assets/packet-7NZHBO7P-D-YFTczs.js +0 -1
  315. package/dist/assets/panel-app-BYfQu_TS.js +0 -1
  316. package/dist/assets/panel-app-i18n-catalog.config-Ddf2Kv8A.js +0 -1
  317. package/dist/assets/panelStandalone-BRg7B1EI.css +0 -1
  318. package/dist/assets/panelStandalone-BaUzY8Wy.js +0 -2
  319. package/dist/assets/pie-RZYD4A2V-VEnYu9s5.js +0 -1
  320. package/dist/assets/privacy-settings-page-CVMBFuak.js +0 -1
  321. package/dist/assets/projects-BEsU3box.js +0 -1
  322. package/dist/assets/provider-models-Dm-pmWAA.js +0 -1
  323. package/dist/assets/provider-scoped-model-input-CzrXg4cX.js +0 -1
  324. package/dist/assets/providers-config-page-839uUADZ.js +0 -1
  325. package/dist/assets/puzzle-BGvD2DPZ.js +0 -1
  326. package/dist/assets/pwa-DNNK_8E9.js +0 -1
  327. package/dist/assets/radar-I7S5WNFK-BFNIekC1.js +0 -1
  328. package/dist/assets/railroad-3IZDKUUU-lVqJ3Hak.js +0 -1
  329. package/dist/assets/railroad-abnf-AHOZXSZD-DYaefdFC.js +0 -1
  330. package/dist/assets/railroad-ebnf-EBAXGLYW-CTAk6lVq.js +0 -1
  331. package/dist/assets/railroad-peg-LSFZ7HO6-Cob294tg.js +0 -1
  332. package/dist/assets/remote-B5qIuUbT.js +0 -1
  333. package/dist/assets/runtime-config-page-Bf-4JYxQ.js +0 -1
  334. package/dist/assets/search-config-page-C0qA3j-T.js +0 -1
  335. package/dist/assets/secrets-config-page-DxfZWpnk.js +0 -3
  336. package/dist/assets/security-config-CItfIQZ4.js +0 -1
  337. package/dist/assets/select-CWyjnar7.js +0 -1
  338. package/dist/assets/service-apps-panel-D3SOkRVv.js +0 -1
  339. package/dist/assets/stateDiagram-v2-6OUMAXLB-BrNv-raG.js +0 -1
  340. package/dist/assets/swimlanesDiagram-G3AALYLV-ntcxaPXp.js +0 -8
  341. package/dist/assets/tag-chip-BIuavK2K.js +0 -1
  342. package/dist/assets/theme-provider-CWUz4yO9.js +0 -1
  343. package/dist/assets/trash-2-hAbJh9VZ.js +0 -1
  344. package/dist/assets/treeView-QDETBFTQ-DbFmr-gw.js +0 -1
  345. package/dist/assets/treemap-6X3UGDF4-C8aY96pi.js +0 -1
  346. package/dist/assets/use-viewport-layout-D_9XWGDV.js +0 -1
  347. package/dist/assets/wardley-OPB4EBWU-D8d6DbbJ.js +0 -1
  348. package/dist/assets/x-ChPbNv39.js +0 -1
  349. package/src/features/apps/components/app-marketplace-dialog.tsx +0 -168
  350. /package/dist/assets/{array-BV9OtnO8.js → array-DstOKG9P.js} +0 -0
  351. /package/dist/assets/{chunk-KEIR6QF5-Cx-8EJ4_.js → chunk-KEIR6QF5-0TA8nwgf.js} +0 -0
  352. /package/dist/assets/{chunk-Y2CYZVJY-Dy1ufvjf.js → chunk-Y2CYZVJY-rfGCG6pM.js} +0 -0
  353. /package/dist/assets/{config-hints-DbmiyTKg.js → config-hints-BfGoD7-o.js} +0 -0
  354. /package/dist/assets/{cytoscape.esm-CSCjuT4Z.js → cytoscape.esm-DdIcNEda.js} +0 -0
  355. /package/dist/assets/{defaultLocale-DWTiNsbT.js → defaultLocale-CzXix2iJ.js} +0 -0
  356. /package/dist/assets/{dist-BVCSkfWY.js → dist-D5dwMwKA.js} +0 -0
  357. /package/dist/assets/{graphlib-B1yb1Wl8.js → graphlib-BKOe0eFe.js} +0 -0
  358. /package/dist/assets/{host-capabilities-DuIFVsvM.js → host-capabilities-CnSVTaot.js} +0 -0
  359. /package/dist/assets/{init-BF6GH5oe.js → init-OCFb3zgY.js} +0 -0
  360. /package/dist/assets/{jszip.min-D12teKzP.js → jszip.min-B2uhSxvV.js} +0 -0
  361. /package/dist/assets/{katex-CsAM73R9.js → katex-dBrYsE7B.js} +0 -0
  362. /package/dist/assets/{middleware-B--6mAUM.js → middleware-CAXxl-af.js} +0 -0
  363. /package/dist/assets/{path-C56XkznJ.js → path-T5eoIRSJ.js} +0 -0
  364. /package/dist/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
  365. /package/dist/assets/{rough.esm-CGfeEbtE.js → rough.esm-DmGXmZEB.js} +0 -0
  366. /package/dist/assets/{xlsx-sds5nUpL.js → xlsx-CoYacou7.js} +0 -0
@@ -0,0 +1,211 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-B7ufoXgq.js","assets/preload-helper-DWTEM3RW.js","assets/chunk-HOUHSVGY-i3MDyUY5.js","assets/src-CI2AvEMj.js","assets/chunk-DF37yw5_.js","assets/chunk-Y2CYZVJY-rfGCG6pM.js","assets/chunk-WYO6CB5R-DPDGhyF6.js","assets/chunk-ICXQ74PX-F_pmNX6t.js","assets/dist-D5dwMwKA.js","assets/chunk-Q4XR5HBZ-GE0v_E5y.js","assets/chunk-52WLFC77-ZXIcYPYs.js","assets/line-BboM0HLF.js","assets/path-T5eoIRSJ.js","assets/array-DstOKG9P.js","assets/chunk-7BUUIJ7U-CvSeJlKZ.js","assets/chunk-C7G6YPKG-BTL0-xL3.js","assets/chunk-OGEWGWER-DuSw54VR.js","assets/chunk-ZGVPDNZ5-BuNKD836.js","assets/rough.esm-DmGXmZEB.js","assets/chunk-FWX5IMBZ-DUuJUrXJ.js","assets/chunk-VAUOI2AC-GYimZYx9.js","assets/chunk-ZIRB5QZD-DyHzq8jH.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,t as n}from"./chunk-DF37yw5_.js";import{_n as r,cr as i,gn as a,vn as o,vr as s,yn as c,yr as l}from"./api-CG22BskB.js";import{t as u}from"./preload-helper-DWTEM3RW.js";import{t as d}from"./createLucideIcon-Lnt-4LMC.js";import{n as f,t as p}from"./search-U9C0oTQJ.js";import{A as m,B as h,C as g,D as _,E as v,F as y,I as b,L as x,M as S,N as C,O as w,P as T,R as ee,S as te,T as E,_ as ne,a as D,b as re,c as O,d as ie,f as ae,g as oe,h as se,i as ce,j as le,k as ue,l as de,m as fe,n as pe,o as me,p as he,r as ge,s as _e,t as ve,u as ye,v as be,w as xe,x as Se,y as Ce,z as we}from"./dist-Cuiqqp1O.js";import{t as Te}from"./external-link-CbVlnlNy.js";import{n as Ee,t as De}from"./inbox-Bna8iUy0.js";import{a as Oe,i as ke,n as Ae,r as je,t as Me}from"./x-BqGj6_Vq.js";import{t as Ne}from"./plus-CywSlIbG.js";import{c as Pe}from"./katex-dBrYsE7B.js";var Fe=d(`AppWindow`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Ie=d(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Le=d(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Re=d(`Blocks`,[[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`path`,{d:`M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3`,key:`1fpvtg`}]]),ze=d(`BookOpenText`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),Be=d(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ve=d(`Brain`,[[`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`}]]),He=d(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Ue=d(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),We=d(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ge=d(`CircleAlert`,[[`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`}]]),Ke=d(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),qe=d(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Je=d(`Command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Ye=d(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Xe=d(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ze=d(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Qe=d(`Expand`,[[`path`,{d:`m21 21-6-6m6 6v-4.8m0 4.8h-4.8`,key:`1c15vz`}],[`path`,{d:`M3 16.2V21m0 0h4.8M3 21l6-6`,key:`1fsnz2`}],[`path`,{d:`M21 7.8V3m0 0h-4.8M21 3l-6 6`,key:`hawz9i`}],[`path`,{d:`M3 7.8V3m0 0h4.8M3 3l6 6`,key:`u9ee12`}]]),$e=d(`FileArchive`,[[`path`,{d:`M10 12v-1`,key:`v7bkov`}],[`path`,{d:`M10 18v-2`,key:`1cjy8d`}],[`path`,{d:`M10 7V6`,key:`dljcrl`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01`,key:`gkbcor`}],[`circle`,{cx:`10`,cy:`20`,r:`2`,key:`1xzdoj`}]]),et=d(`FileAudio2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2`,key:`17k7jt`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`3`,cy:`17`,r:`1`,key:`vo6nti`}],[`path`,{d:`M2 17v-3a4 4 0 0 1 8 0v3`,key:`1ggdre`}],[`circle`,{cx:`9`,cy:`17`,r:`1`,key:`bc1fq4`}]]),tt=d(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),nt=d(`FileImage`,[[`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`}]]),rt=d(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),it=d(`FileSpreadsheet`,[[`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:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),at=d(`FileText`,[[`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 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ot=d(`FileVideo2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`6`,x:`2`,y:`12`,rx:`1`,key:`1a6c1e`}],[`path`,{d:`m10 15.5 4 2.5v-6l-4 2.5`,key:`t7cp39`}]]),st=d(`File`,[[`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`}]]),ct=d(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),lt=d(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),ut=d(`FolderTree`,[[`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`}]]),dt=d(`Folder`,[[`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`}]]),ft=d(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),pt=d(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),mt=d(`ListCollapse`,[[`path`,{d:`m3 10 2.5-2.5L3 5`,key:`i6eama`}],[`path`,{d:`m3 19 2.5-2.5L3 14`,key:`w2gmor`}],[`path`,{d:`M10 6h11`,key:`c7qv1k`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 18h11`,key:`11hvi2`}]]),ht=d(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),gt=d(`MessageSquarePlus`,[[`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`}],[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]),_t=d(`MessageSquareQuote`,[[`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`}],[`path`,{d:`M8 12a2 2 0 0 0 2-2V8H8`,key:`1jfesj`}],[`path`,{d:`M14 12a2 2 0 0 0 2-2V8h-2`,key:`1dq9mh`}]]),vt=d(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),yt=d(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),bt=d(`Pencil`,[[`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`}]]),xt=d(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),St=d(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Ct=d(`RotateCcw`,[[`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`}]]),wt=d(`Send`,[[`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`}]]),Tt=d(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Et=d(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Dt=d(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Ot=d(`TextQuote`,[[`path`,{d:`M17 6H3`,key:`16j9eg`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 18H8`,key:`1wfozv`}],[`path`,{d:`M3 12v6`,key:`fv4c87`}]]),kt=d(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),At=d(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),jt=d(`Wrench`,[[`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`}]]),k=e(l(),1);function Mt(e,t){return k.useReducer((e,n)=>t[e][n]??e,e)}var Nt=e=>{let{present:t,children:n}=e,r=Pt(t),i=typeof n==`function`?n({present:r.isPresent}):k.Children.only(n),a=b(r.ref,It(i));return typeof n==`function`||r.isPresent?k.cloneElement(i,{ref:a}):null};Nt.displayName=`Presence`;function Pt(e){let[t,n]=k.useState(),r=k.useRef(null),i=k.useRef(e),a=k.useRef(`none`),[o,s]=Mt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return k.useEffect(()=>{let e=Ft(r.current);a.current=o===`mounted`?e:`none`},[o]),ue(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ft(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),ue(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ft(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ft(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:k.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ft(e){return e?.animationName||`none`}function It(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A=i(),[Lt,Rt]=y(`Tooltip`,[_]),zt=_(),Bt=`TooltipProvider`,Vt=700,Ht=`tooltip.open`,[Ut,Wt]=Lt(Bt),Gt=e=>{let{__scopeTooltip:t,delayDuration:n=Vt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=k.useRef(!0),s=k.useRef(!1),c=k.useRef(0);return k.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,A.jsx)(Ut,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:k.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:k.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Gt.displayName=Bt;var Kt=`Tooltip`,[qt,Jt]=Lt(Kt),Yt=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Wt(Kt,e.__scopeTooltip),l=zt(t),[u,d]=k.useState(null),f=w(),p=k.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=k.useRef(!1),[_,y]=Se({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ht))):c.onClose(),a?.(e)},caller:Kt}),b=k.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=k.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return k.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,A.jsx)(v,{...l,children:(0,A.jsx)(qt,{scope:t,contentId:f,open:_,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:k.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};Yt.displayName=Kt;var Xt=`TooltipTrigger`,Zt=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Jt(Xt,n),a=Wt(Xt,n),o=zt(n),s=b(t,k.useRef(null),i.onTriggerChange),c=k.useRef(!1),l=k.useRef(!1),u=k.useCallback(()=>c.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,A.jsx)(g,{asChild:!0,...o,children:(0,A.jsx)(le.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:x(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:x(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:x(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:x(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:x(e.onBlur,i.onClose),onClick:x(e.onClick,i.onClose)})})});Zt.displayName=Xt;var Qt=`TooltipPortal`,[$t,en]=Lt(Qt,{forceMount:void 0}),tn=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Jt(Qt,t);return(0,A.jsx)($t,{scope:t,forceMount:n,children:(0,A.jsx)(Nt,{present:n||a.open,children:(0,A.jsx)(te,{asChild:!0,container:i,children:r})})})};tn.displayName=Qt;var nn=`TooltipContent`,rn=k.forwardRef((e,t)=>{let n=en(nn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Jt(nn,e.__scopeTooltip);return(0,A.jsx)(Nt,{present:r||o.open,children:o.disableHoverableContent?(0,A.jsx)(ln,{side:i,...a,ref:t}):(0,A.jsx)(an,{side:i,...a,ref:t})})}),an=k.forwardRef((e,t)=>{let n=Jt(nn,e.__scopeTooltip),r=Wt(nn,e.__scopeTooltip),i=k.useRef(null),a=b(t,i),[o,s]=k.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=k.useCallback(()=>{s(null),d(!1)},[d]),p=k.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=pn(r,fn(r,n.getBoundingClientRect())),a=mn(t.getBoundingClientRect());s(gn([...i,...a])),d(!0)},[d]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),k.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!hn(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,A.jsx)(ln,{...e,ref:a})}),[on,sn]=Lt(Kt,{isInside:!1}),cn=C(`TooltipContent`),ln=k.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Jt(nn,n),l=zt(n),{onClose:u}=c;return k.useEffect(()=>(document.addEventListener(Ht,u),()=>document.removeEventListener(Ht,u)),[u]),k.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,A.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,A.jsxs)(E,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,A.jsx)(cn,{children:r}),(0,A.jsx)(on,{scope:n,isInside:!0,children:(0,A.jsx)(re,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});rn.displayName=nn;var un=`TooltipArrow`,dn=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=zt(n);return sn(un,n).isInside?null:(0,A.jsx)(xe,{...i,...r,ref:t})});dn.displayName=un;function fn(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function pn(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function mn(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function hn(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function gn(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),_n(t)}function _n(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vn=Gt,yn=Yt,bn=Zt,xn=tn,Sn=rn,Cn={key:`slash`,marker:`/`};function wn(){return`composer-${Math.random().toString(36).slice(2,10)}`}function Tn(e=``){return{id:wn(),type:`text`,text:e}}function En(e){let{data:t,label:n,previewUrl:r,tokenKey:i,tokenKind:a}=e;return{id:wn(),type:`token`,tokenKind:a,tokenKey:i,label:n,previewUrl:r,data:t}}function Dn(e){return e.type===`text`?e.text.length:1}function On(){return[Tn(``)]}function kn(e){return[Tn(e)]}function An(e){let t=[];for(let n of e){if(n.type===`text`){if(n.text.length===0)continue;let e=t[t.length-1];if(e?.type===`text`){t[t.length-1]={...e,text:e.text+n.text};continue}}t.push(n)}return t.length===0?On():t}function jn(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function Mn(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Nn(e,t){let n=[],r=new Set;for(let i of e)i.type!==`token`||i.tokenKind!==t||r.has(i.tokenKey)||(r.add(i.tokenKey),n.push(i.tokenKey));return n}function Pn(e,t,n,r){let i=Math.max(0,n-t),a=Math.max(0,t+e.text.length-r);return[i>0?{...e,text:e.text.slice(0,i)}:null,a>0?{...e,text:e.text.slice(e.text.length-a)}:null]}function Fn(e,t,n,r){return t<=n||e>=r}function In(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function Ln(e,t,n,r,i,a,o){let s=Pn(t,n,r,i);s[0]&&e.push(s[0]);let c=o;return c||=(e.push(...a),!0),s[1]&&e.push(s[1]),c}function Rn(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function zn(e,t,n,r){let i=Math.max(0,t),a=Math.max(i,n),o=[],s=0,c=!1;for(let t of e){let e=Dn(t),n=s,l=s+e;if(Fn(n,l,i,a)){c=In(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?Ln(o,t,n,i,a,r,c):Rn(o,t,r,c,i,n),s=l}return c||o.push(...r),An(o)}function Bn(e,t){return An(e.filter(e=>e.type!==`token`||!t(e)))}function Vn(e,t){return t===0||/\s/.test(e[t-1]??``)}function Hn(e,t,n){if(!t||t.start!==t.end)return null;let r=jn(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!Vn(a,o))return null;let s=a.slice(o+n.marker.length);return/[\s\uFFFC]/.test(s)?null:{key:n.key,marker:n.marker,query:s.trim().toLowerCase(),start:o,end:i}}function Un(e,t,n=[Cn]){let r=null;for(let i of n){let n=Hn(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function Wn(e,t){let n=Hn(e,t,Cn);return n?{query:n.query,start:n.start,end:n.end}:null}var Gn=e=>`[data-item-index="${e}"]`;function Kn(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??Gn;(0,k.useEffect)(()=>{if(!i||a===0)return;let e=n.current;if(!e)return;let r=e.querySelector(o(t));typeof r?.scrollIntoView==`function`&&r.scrollIntoView({block:`nearest`,inline:`nearest`})},[t,n,o,i,a])}function qn(){let e=(0,k.useRef)(null),[t,n]=(0,k.useState)(null);return(0,k.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=()=>{n(t.getBoundingClientRect().width)};r();let i=new ResizeObserver(()=>r());return i.observe(t),()=>i.disconnect()},[]),{elementRef:e,width:t}}function j(...e){return o(c(e))}var Jn=k.forwardRef(({className:e,type:t,...n},r)=>(0,A.jsx)(`input`,{type:t,className:j(`flex h-9 w-full rounded-xl border border-border bg-card px-3.5 py-2 text-sm text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/55 placeholder:font-normal focus:outline-none focus:ring-0 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,`max-md:min-h-[var(--control-touch-size,2.75rem)] max-md:text-base`,e),ref:r,...n}));Jn.displayName=`ChatInput`;var Yn=`Dialog`,[Xn,Zn]=y(Yn),[Qn,$n]=Xn(Yn),er=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=k.useRef(null),c=k.useRef(null),[l,u]=Se({prop:r,defaultProp:i??!1,onChange:a,caller:Yn});return(0,A.jsx)(Qn,{scope:t,triggerRef:s,contentRef:c,contentId:w(),titleId:w(),descriptionId:w(),open:l,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};er.displayName=Yn;var tr=`DialogTrigger`,nr=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=$n(tr,n),a=b(t,i.triggerRef);return(0,A.jsx)(le.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Sr(i.open),...r,ref:a,onClick:x(e.onClick,i.onOpenToggle)})});nr.displayName=tr;var rr=`DialogPortal`,[ir,ar]=Xn(rr,{forceMount:void 0}),or=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$n(rr,t);return(0,A.jsx)(ir,{scope:t,forceMount:n,children:k.Children.map(r,e=>(0,A.jsx)(Nt,{present:n||a.open,children:(0,A.jsx)(te,{asChild:!0,container:i,children:e})}))})};or.displayName=rr;var sr=`DialogOverlay`,cr=k.forwardRef((e,t)=>{let n=ar(sr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$n(sr,e.__scopeDialog);return a.modal?(0,A.jsx)(Nt,{present:r||a.open,children:(0,A.jsx)(ur,{...i,ref:t})}):null});cr.displayName=sr;var lr=S(`DialogOverlay.RemoveScroll`),ur=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=$n(sr,n);return(0,A.jsx)(ne,{as:lr,allowPinchZoom:!0,shards:[i.contentRef],children:(0,A.jsx)(le.div,{"data-state":Sr(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),dr=`DialogContent`,fr=k.forwardRef((e,t)=>{let n=ar(dr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$n(dr,e.__scopeDialog);return(0,A.jsx)(Nt,{present:r||a.open,children:a.modal?(0,A.jsx)(pr,{...i,ref:t}):(0,A.jsx)(mr,{...i,ref:t})})});fr.displayName=dr;var pr=k.forwardRef((e,t)=>{let n=$n(dr,e.__scopeDialog),r=k.useRef(null),i=b(t,n.contentRef,r);return k.useEffect(()=>{let e=r.current;if(e)return oe(e)},[]),(0,A.jsx)(hr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault())})}),mr=k.forwardRef((e,t)=>{let n=$n(dr,e.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return(0,A.jsx)(hr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),hr=k.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$n(dr,n),c=k.useRef(null),l=b(t,c);return be(),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ce,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(m,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Sr(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Er,{titleId:s.titleId}),(0,A.jsx)(Or,{contentRef:c,descriptionId:s.descriptionId})]})]})}),gr=`DialogTitle`,_r=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=$n(gr,n);return(0,A.jsx)(le.h2,{id:i.titleId,...r,ref:t})});_r.displayName=gr;var vr=`DialogDescription`,yr=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=$n(vr,n);return(0,A.jsx)(le.p,{id:i.descriptionId,...r,ref:t})});yr.displayName=vr;var br=`DialogClose`,xr=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=$n(br,n);return(0,A.jsx)(le.button,{type:`button`,...r,ref:t,onClick:x(e.onClick,()=>i.onOpenChange(!1))})});xr.displayName=br;function Sr(e){return e?`open`:`closed`}var Cr=`DialogTitleWarning`,[wr,Tr]=T(Cr,{contentName:dr,titleName:gr,docsSlug:`dialog`}),Er=({titleId:e})=>{let t=Tr(Cr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
3
+
4
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
5
+
6
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Dr=`DialogDescriptionWarning`,Or=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tr(Dr).contentName}}.`;return k.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},kr=er,Ar=nr,jr=or,Mr=cr,Nr=fr,Pr=_r,Fr=yr,Ir=xr,Lr=kr,Rr=Pr,zr=Fr,Br=k.forwardRef(({className:e,children:t,closeLabel:n,...r},i)=>(0,A.jsxs)(jr,{children:[(0,A.jsx)(Mr,{className:`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,A.jsxs)(Nr,{ref:i,className:j(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid max-h-[min(42rem,calc(100vh-2rem))] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-6 text-foreground shadow-xl outline-none duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...r,children:[t,(0,A.jsxs)(Ir,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,A.jsx)(Me,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));Br.displayName=Nr.displayName;var Vr=({className:e,...t})=>(0,A.jsx)(`div`,{className:j(`flex flex-col gap-2 text-center sm:text-left`,e),...t}),Hr=`Popover`,[Ur,Wr]=y(Hr,[_]),Gr=_(),[Kr,qr]=Ur(Hr),Jr=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Gr(t),c=k.useRef(null),[l,u]=k.useState(!1),[d,f]=Se({prop:r,defaultProp:i??!1,onChange:a,caller:Hr});return(0,A.jsx)(v,{...s,children:(0,A.jsx)(Kr,{scope:t,contentId:w(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:n})})};Jr.displayName=Hr;var Yr=`PopoverAnchor`,Xr=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qr(Yr,n),a=Gr(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return k.useEffect(()=>(o(),()=>s()),[o,s]),(0,A.jsx)(g,{...a,...r,ref:t})});Xr.displayName=Yr;var Zr=`PopoverTrigger`,Qr=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qr(Zr,n),a=Gr(n),o=b(t,i.triggerRef),s=(0,A.jsx)(le.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":pi(i.open),...r,ref:o,onClick:x(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,A.jsx)(g,{asChild:!0,...a,children:s})});Qr.displayName=Zr;var $r=`PopoverPortal`,[ei,ti]=Ur($r,{forceMount:void 0}),ni=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=qr($r,t);return(0,A.jsx)(ei,{scope:t,forceMount:n,children:(0,A.jsx)(Nt,{present:n||a.open,children:(0,A.jsx)(te,{asChild:!0,container:i,children:r})})})};ni.displayName=$r;var ri=`PopoverContent`,ii=k.forwardRef((e,t)=>{let n=ti(ri,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=qr(ri,e.__scopePopover);return(0,A.jsx)(Nt,{present:r||a.open,children:a.modal?(0,A.jsx)(oi,{...i,ref:t}):(0,A.jsx)(si,{...i,ref:t})})});ii.displayName=ri;var ai=S(`PopoverContent.RemoveScroll`),oi=k.forwardRef((e,t)=>{let n=qr(ri,e.__scopePopover),r=k.useRef(null),i=b(t,r),a=k.useRef(!1);return k.useEffect(()=>{let e=r.current;if(e)return oe(e)},[]),(0,A.jsx)(ne,{as:ai,allowPinchZoom:!0,children:(0,A.jsx)(ci,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),si=k.forwardRef((e,t)=>{let n=qr(ri,e.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return(0,A.jsx)(ci,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ci=k.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=qr(ri,n),p=Gr(n);return be(),(0,A.jsx)(Ce,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(m,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,A.jsx)(E,{"data-state":pi(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),li=`PopoverClose`,ui=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qr(li,n);return(0,A.jsx)(le.button,{type:`button`,...r,ref:t,onClick:x(e.onClick,()=>i.onOpenChange(!1))})});ui.displayName=li;var di=`PopoverArrow`,fi=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Gr(n);return(0,A.jsx)(xe,{...i,...r,ref:t})});fi.displayName=di;function pi(e){return e?`open`:`closed`}var mi=Jr,hi=Xr,gi=Qr,_i=ni,vi=ii,yi=`w-max min-w-52 max-w-[min(18rem,calc(100vw-16px))] overflow-y-auto rounded-xl border border-border/40 bg-popover p-1 text-popover-foreground shadow-floating outline-none`,bi=`flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1 text-left text-[13px] leading-5 font-medium outline-none transition-colors disabled:pointer-events-none disabled:opacity-45`,xi={icon:`hover:before:bg-[var(--interaction-hover)] active:before:bg-[var(--interaction-hover)] disabled:hover:before:bg-transparent disabled:active:before:bg-transparent`,item:`hover:bg-[var(--interaction-hover)] focus-visible:bg-[var(--interaction-hover)] active:bg-[var(--interaction-hover)] disabled:hover:bg-transparent disabled:active:bg-transparent`,destructive:`text-destructive hover:bg-destructive/10 focus-visible:bg-destructive/10 disabled:hover:bg-transparent`},Si=`2rem`;function Ci(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${Si})))`}var wi=Ci(`24rem`),Ti=mi,Ei=gi,Di=hi,Oi=k.forwardRef(({className:e,variant:t=`default`,sideOffset:n=8,align:r=`start`,collisionPadding:i=12,style:a,...o},s)=>(0,A.jsx)(_i,{children:(0,A.jsx)(vi,{ref:s,"data-theme-overlay":t===`menu`?`menu`:`popover`,sideOffset:n,align:r,collisionPadding:i,className:j(`z-[var(--z-popover,50)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2`,e,t===`menu`&&`w-max min-w-52 max-w-[min(18rem,calc(100vw-16px))] overflow-y-auto rounded-xl border border-border/40 bg-popover p-1 text-popover-foreground shadow-floating outline-none`),style:{maxHeight:wi,...a},...o})}));Oi.displayName=vi.displayName;var ki=de,Ai=pe,ji=fe,Mi=`2rem`;function Ni(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${Mi})))`}var Pi=Ni(`24rem`),Fi=k.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(he,{ref:r,className:j(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,A.jsx)(ge,{asChild:!0,children:(0,A.jsx)(we,{className:`h-4 w-4 opacity-50`})})]}));Fi.displayName=he.displayName;var Ii=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(ie,{ref:n,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,A.jsx)(ee,{className:`h-4 w-4`})}));Ii.displayName=ie.displayName;var Li=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(ye,{ref:n,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,A.jsx)(we,{className:`h-4 w-4`})}));Li.displayName=ye.displayName;var Ri=k.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,A.jsx)(O,{children:(0,A.jsxs)(ve,{ref:s,className:j(`relative z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),collisionPadding:n,position:r,style:{maxHeight:Pi,...i},...o,children:[(0,A.jsx)(Ii,{}),(0,A.jsx)(se,{className:j(`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,r===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`,a),children:t}),(0,A.jsx)(Li,{})]})}));Ri.displayName=ve.displayName;var zi=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(_e,{ref:n,className:j(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));zi.displayName=_e.displayName;var Bi=k.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(ce,{ref:r,className:j(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,e),...n,children:[(0,A.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(D,{children:(0,A.jsx)(h,{className:`h-4 w-4`})})}),(0,A.jsx)(me,{children:t})]}));Bi.displayName=ce.displayName;var Vi=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(ae,{ref:n,className:j(`-mx-1 my-1 h-px bg-border`,e),...t}));Vi.displayName=ae.displayName;var Hi=vn,Ui=yn,Wi=bn,Gi=k.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,A.jsx)(xn,{children:(0,A.jsx)(Sn,{ref:r,sideOffset:t,className:j(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Gi.displayName=Sn.displayName;var Ki={Dialog:Lr,DialogContent:Br,DialogDescription:zr,DialogHeader:Vr,DialogTitle:Rr,Popover:Ti,PopoverAnchor:Di,PopoverContent:Oi,PopoverTrigger:Ei,Input:Jn,Select:ki,SelectContent:Ri,SelectGroup:Ai,SelectItem:Bi,SelectLabel:zi,SelectSeparator:Vi,SelectTrigger:Fi,SelectValue:ji,Tooltip:Ui,TooltipContent:Gi,TooltipProvider:Hi,TooltipTrigger:Wi};function qi({pathPreview:e}){return(0,A.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-gray-50/70 px-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-gray-600`,children:[(0,A.jsx)(dt,{"aria-hidden":`true`,className:`h-4 w-4 text-gray-400`}),(0,A.jsx)(`span`,{className:`truncate`,children:e.rootLabel})]}),(0,A.jsx)(`div`,{className:`mt-2`,children:e.segments.map((e,t)=>{let n=e.kind===`directory`?dt:st;return(0,A.jsxs)(`div`,{className:`relative flex min-w-0 items-center gap-2 py-1 text-xs text-gray-700`,style:{paddingLeft:`${(t+1)*18}px`},children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-1/2 top-[-0.25rem] w-px bg-gray-200`,style:{left:`${t*18+7}px`}}),(0,A.jsx)(n,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-gray-400`}),(0,A.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]},`${t}:${e.label}`)})})]})}var Ji=680,Yi=.82,Xi=560,Zi=Ci(`24rem`),Qi={back:f,agent:Be,mcp:St,work:ht,"calendar-clock":He,command:Je,file:st,files:ct,folder:dt,inbox:De,"list-collapse":mt,"message-square-plus":gt,"panel-app":Fe,project:lt,skill:Tt};function $i(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}function ea(e,t){return e?.length?e.some(e=>e.key===t)?t:e[0].key:null}function ta({icon:e}){let t=Qi[e];return(0,A.jsx)(`span`,{"aria-hidden":`true`,"data-input-surface-icon":e,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-gray-100 text-gray-500`,children:(0,A.jsx)(t,{className:`h-3.5 w-3.5`})})}function na({item:e,texts:t}){return e?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.subtitle?(0,A.jsx)(`span`,{className:`inline-flex rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary`,children:e.subtitle}):null,(0,A.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:e.title})]}),(0,A.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description}),e.pathPreview?(0,A.jsx)(qi,{pathPreview:e.pathPreview}):null,(0,A.jsx)(`div`,{className:`space-y-1`,children:e.detailLines.map(e=>(0,A.jsx)(`div`,{className:`min-w-0 break-all rounded-md bg-gray-50 px-2 py-1 text-[11px] leading-5 text-gray-600`,children:e},e))}),(0,A.jsx)(`div`,{className:`pt-1 text-[11px] text-gray-500`,children:e.hintLabel??t.itemHintLabel})]}):(0,A.jsx)(`div`,{className:`text-xs text-gray-500`,children:t.hintLabel})}function ra(e){let{activeIndex:t,event:n,isOpen:r,items:i,onOpenChange:a,onSelectItem:o,setActiveIndex:s}=e;return r?n.key===`Escape`?(n.preventDefault(),a(!1),!0):i.length===0?!1:n.key===`ArrowDown`?(n.preventDefault(),s(e=>(e+1)%i.length),!0):n.key===`ArrowUp`?(n.preventDefault(),s(e=>(e-1+i.length)%i.length),!0):n.key===`Enter`&&!n.shiftKey||n.key===`Tab`?(n.preventDefault(),o(i[t]),!0):!1:!1}var ia=(0,k.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=Ki,{elementRef:a,width:o}=qn(),s=(0,k.useRef)(null),[c,l]=(0,k.useState)({index:0,itemsSignature:``}),{isOpen:u,isLoading:d,filterOptions:f,items:p,notice:m,texts:h,onSelectItem:g,onOpenChange:_,onDetailsPointerDown:v}=e,[y,b]=(0,k.useState)(f?.[0]?.key??null),x=(0,k.useMemo)(()=>ea(f,y),[y,f]),S=(0,k.useMemo)(()=>f?.find(e=>e.key===x)??null,[f,x]),C=(0,k.useMemo)(()=>f?.map(e=>({...e,count:p.filter(t=>$i(t,e)).length}))??[],[f,p]),w=(0,k.useMemo)(()=>S?p.filter(e=>$i(e,S)):p,[S,p]),T=(0,k.useMemo)(()=>w.map(e=>e.key).join(``),[w]),ee=(0,k.useMemo)(()=>w.some(e=>!!e.sectionLabel?.trim()),[w]),te=c.itemsSignature===T?c.index:0,E=w.length===0?0:Math.min(te,w.length-1),ne=w[E]??null,D=(0,k.useCallback)(e=>{b(e),l({index:0,itemsSignature:``})},[]),re=(0,k.useCallback)(e=>{l(t=>{let n=t.itemsSignature===T?t.index:0;return{index:typeof e==`function`?e(n):e,itemsSignature:T}})},[T]),O=(0,k.useCallback)(e=>{e.selectionBehavior===`navigate`&&l({index:0,itemsSignature:``}),g(e)},[g]),ie=(0,k.useMemo)(()=>{if(o)return Math.min(o>Xi?o*Yi:o,Ji)},[o]);return(0,k.useImperativeHandle)(t,()=>({handleKeyDown:e=>ra({activeIndex:E,event:e,isOpen:u,items:w,onOpenChange:_,onSelectItem:O,setActiveIndex:re})}),[E,u,_,O,re,w]),Kn({containerRef:s,activeIndex:E,itemCount:w.length,isEnabled:u&&!d,getItemSelector:e=>`[data-input-surface-index="${e}"]`}),(0,A.jsxs)(n,{open:u,onOpenChange:_,children:[(0,A.jsx)(r,{asChild:!0,children:(0,A.jsx)(`div`,{ref:a,className:`pointer-events-none absolute bottom-0 left-3 right-3 top-0`})}),(0,A.jsx)(i,{side:`top`,align:`start`,sideOffset:10,className:`z-[70] flex max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white/95 p-0 shadow-2xl backdrop-blur-md`,onOpenAutoFocus:e=>e.preventDefault(),style:{height:Zi,maxHeight:Zi,width:ie?`${ie}px`:void 0},children:(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(220px,300px)_minmax(0,1fr)]`,children:[(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-col border-r border-gray-200`,children:[!d&&C.length>0?(0,A.jsx)(`div`,{className:`flex shrink-0 gap-0.5 overflow-x-auto px-2 pb-1.5 pt-2`,children:C.map(({count:e,key:t,label:n})=>{let r=t===x;return(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":r,onPointerDown:e=>e.preventDefault(),onClick:()=>D(t),className:`inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${r?`bg-gray-100 text-gray-900`:`text-gray-600 hover:bg-gray-100 hover:text-gray-900`}`,children:[(0,A.jsx)(`span`,{children:n}),(0,A.jsx)(`span`,{className:r?`text-gray-500`:`text-gray-400`,children:e})]},t)})}):null,!d&&m?(0,A.jsxs)(`div`,{className:`mx-2 mb-1.5 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-2.5 py-2 text-xs leading-4 text-red-700`,children:[(0,A.jsx)(Ge,{"aria-hidden":`true`,className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,A.jsx)(`span`,{children:m.message})]}):null,(0,A.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":h.sectionLabel,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain ${!d&&C.length>0?`px-2 pb-2`:`p-2`}`,children:d?(0,A.jsx)(`div`,{className:`p-2 text-xs text-gray-500`,children:h.loadingLabel}):(0,A.jsxs)(A.Fragment,{children:[ee?null:(0,A.jsx)(`div`,{className:`mb-1 px-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:h.sectionLabel}),w.length===0?(0,A.jsx)(`div`,{className:`px-1.5 text-xs text-gray-400`,children:h.emptyLabel}):(0,A.jsx)(`div`,{children:w.map((e,t)=>{let{icon:n,key:r,sectionKey:i,sectionLabel:a,title:o,subtitle:s}=e,c=t===E,l=w[t-1];return(0,A.jsxs)(`div`,{children:[ee&&a?.trim()&&l?.sectionKey!==i?(0,A.jsx)(`div`,{className:`px-1.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:a}):null,(0,A.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,"data-input-surface-index":t,onPointerMove:e=>{e.pointerType!==`touch`&&re(t)},onPointerDown:t=>{t.button>0||(t.preventDefault(),O(e))},onClick:t=>{t.detail===0&&O(e)},className:`flex w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-left leading-4 transition-colors ${c?`bg-gray-100 text-gray-900`:`text-gray-700 hover:bg-gray-100`}`,children:[n?(0,A.jsx)(ta,{icon:n}):null,(0,A.jsx)(`span`,{className:`truncate text-xs font-medium`,children:o}),(0,A.jsx)(`span`,{className:`truncate text-xs text-gray-500`,children:s})]})]},r)})})]})})]}),(0,A.jsx)(`div`,{className:`custom-scrollbar min-h-0 min-w-0 select-text overflow-y-auto overscroll-contain p-2.5`,onPointerDown:v,children:(0,A.jsx)(na,{item:ne,texts:h})})]})})]})});function aa(e){return`${e.key}:${e.marker}:${e.start}`}function oa(e,t){return t.type===`insert-text`&&e.query===``&&e.end===e.start+e.marker.length}function sa(e,t,n){if(!t)return null;let r=aa(t);return e===r?e:oa(t,n)?r:null}function ca(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[Cn]}=e,o=(0,k.useRef)(null),s=(0,k.useRef)(!1),c=(0,k.useRef)(null),[l,u]=(0,k.useState)(null),d=!!n&&l!==null,f=(0,k.useCallback)((e,t)=>{c.current=e,u(e),r?.(e?t:null)},[r]),p=(0,k.useCallback)((e,t,n)=>{let r=Un(e,t,a),i=sa(c.current,r,n);f(i,i?r:null)},[f,a]),m=(0,k.useCallback)(e=>o.current?.handleKeyDown(e)??!1,[]),h=(0,k.useCallback)(e=>{!e&&!s.current&&f(null,null)},[f]);return(0,A.jsxs)(A.Fragment,{children:[t((0,k.useMemo)(()=>({onInputSurfaceKeyDown:m,onInputSurfaceOpenChange:h,onInputSurfaceSnapshotChange:p}),[m,h,p])),n&&d?(0,A.jsx)(ia,{ref:o,isOpen:d,isLoading:n.isLoading,filterOptions:n.filterOptions,items:n.items,notice:n.notice,texts:n.texts,onSelectItem:e=>{e.selectionBehavior!==`navigate`&&f(null,null),i(e)},onOpenChange:h,onDetailsPointerDown:()=>{s.current=!0,requestAnimationFrame(()=>{s.current=!1})}},l):null]})}var la=a(`inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-card text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,secondary:`bg-muted text-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,ghost:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,primary:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,subtle:`bg-muted text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"primary-outline":`border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3 text-xs`,lg:`h-11 px-5 text-[14px]`,xl:`h-12 px-6 text-[15px]`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),ua=k.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,A.jsx)(`button`,{className:j(la({variant:t,size:n,className:e}),n!==`icon`&&`max-md:min-h-[var(--control-touch-size,2.75rem)]`),ref:i,...r}));ua.displayName=`ChatButton`;function da(){return(0,A.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`chat-stop-icon`,className:`block h-3 w-3 rounded-[2px] bg-foreground shadow-[inset_0_0_0_1px_hsl(var(--border))]`})}function fa({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=Ki,a=Math.max(0,Math.min(1,e.ratio)),o=Math.round(a*360);return(0,A.jsx)(r,{delayDuration:0,children:(0,A.jsxs)(t,{children:[(0,A.jsx)(i,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"aria-label":e.label,title:e.label,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[7px] rounded-full`,style:{background:`conic-gradient(hsl(var(--muted-foreground)) ${o}deg, hsl(var(--border)) 0deg)`}}),(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[10px] rounded-full bg-card`})]})}),(0,A.jsx)(n,{side:`top`,className:`max-w-[18rem]`,children:(0,A.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-5 font-semibold text-foreground`,children:[(0,A.jsx)(`span`,{children:e.label}),(0,A.jsx)(`span`,{children:e.percentLabel})]}),e.details.map(e=>(0,A.jsxs)(k.Fragment,{children:[e.dividerBefore?(0,A.jsx)(`div`,{"aria-hidden":`true`,className:`my-2 border-t border-border/70`,"data-testid":`context-window-detail-divider`}):null,(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-5 text-muted-foreground`,children:[(0,A.jsx)(`span`,{children:e.label}),(0,A.jsx)(`span`,{className:`font-medium text-foreground`,children:e.value})]})]},e.label))]})})]})})}function pa({children:e,label:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=Ki;return(0,A.jsx)(i,{delayDuration:250,children:(0,A.jsxs)(n,{children:[(0,A.jsx)(a,{asChild:!0,children:(0,A.jsx)(`span`,{className:`inline-flex`,children:e})}),(0,A.jsx)(r,{side:`top`,className:`text-xs`,children:t})]})})}function ma({isSending:e,canStopGeneration:t,sendDisabled:n,stopDisabled:r,stopHint:i,sendButtonLabel:a,sendIcon:o=`send`,stopButtonLabel:s,contextWindow:c,onSend:l,onStop:u}){return(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c?(0,A.jsx)(fa,{contextWindow:c}):null,!e||!n?(0,A.jsx)(pa,{label:a,children:(0,A.jsx)(ua,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void l(),disabled:n,children:o===`continue`?(0,A.jsx)(xt,{"data-testid":`chat-continue-input-icon`,className:`h-4 w-4`}):(0,A.jsx)(Le,{className:`h-5 w-5`})})}):t?(0,A.jsx)(pa,{label:s,children:(0,A.jsx)(ua,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,onClick:()=>void u(),disabled:r,children:(0,A.jsx)(da,{})})}):(0,A.jsx)(pa,{label:i,children:(0,A.jsx)(ua,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,disabled:!0,children:(0,A.jsx)(da,{})})})]})}function ha(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.label,e.key,e.description].filter(e=>typeof e==`string`&&e.trim().length>0).join(` `).toLowerCase().includes(n)):e}var ga=Ci(`20rem`),_a=`${bi} text-foreground ${xi.item}`;function va(e){let{Input:t}=Ki,{onBack:n,picker:r}=e,i=(0,k.useRef)(null),a=(0,k.useId)(),[o,s]=(0,k.useState)(``),[c,l]=(0,k.useState)(0),u=(0,k.useMemo)(()=>new Set(r.selectedKeys),[r.selectedKeys]),d=(0,k.useMemo)(()=>r.groups?.filter(e=>e.options.length>0)??[],[r.groups]),f=(0,k.useMemo)(()=>d.length===0?null:d.map(e=>({...e,options:ha(e.options,o)})).filter(e=>e.options.length>0),[d,o]),m=(0,k.useMemo)(()=>f===null?ha(r.options,o):f.flatMap(e=>e.options),[f,r.options,o]),g=m.length===0?0:Math.min(c,m.length-1);Kn({containerRef:i,activeIndex:g,itemCount:m.length,isEnabled:m.length>0,getItemSelector:e=>`[data-skill-index="${e}"]`});let _=e=>{if(u.has(e)){r.onSelectedKeysChange(r.selectedKeys.filter(t=>t!==e));return}r.onSelectedKeysChange([...r.selectedKeys,e])};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`shrink-0 space-y-1.5 p-2`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex h-7 items-center gap-1 rounded-md pr-2 text-sm font-medium text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:[(0,A.jsx)(Ue,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{children:r.title})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(p,{className:`pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground/60`}),(0,A.jsx)(t,{value:o,onChange:e=>{s(e.target.value),l(0)},onKeyDown:e=>{if(m.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),l(Math.min(g+1,m.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),l(Math.max(g-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=m[g];t&&_(t.key)}}},placeholder:r.searchPlaceholder,role:`combobox`,"aria-controls":a,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-activedescendant":m[g]?`${a}-option-${g}`:void 0,className:`h-8 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]})]}),(0,A.jsx)(`div`,{ref:i,id:a,role:`listbox`,"aria-multiselectable":`true`,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-1`,children:r.isLoading?(0,A.jsx)(`div`,{className:`p-4 text-xs text-muted-foreground`,children:r.loadingLabel}):m.length===0?(0,A.jsx)(`div`,{className:`p-4 text-center text-xs text-muted-foreground`,children:r.emptyLabel}):(0,A.jsx)(`div`,{children:(()=>{let e=f??[{key:`all-skills`,options:m}],t=0;return e.map(e=>(0,A.jsxs)(`div`,{children:[e.label?(0,A.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-medium text-muted-foreground/80`,children:e.label}):null,e.options.map(e=>{let n=t;t+=1;let r=u.has(e.key),i=n===g;return(0,A.jsxs)(`button`,{type:`button`,id:`${a}-option-${n}`,role:`option`,"aria-selected":r,"aria-label":e.label,"data-skill-index":n,onMouseEnter:()=>l(n),onClick:()=>_(e.key),className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors ${i?`bg-[var(--interaction-hover)]`:`hover:bg-[var(--interaction-hover)]`}`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label}),(0,A.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description||e.key})]}),r?(0,A.jsx)(h,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]},e.key)})]},e.key))})()})}),r.manageHref&&r.manageLabel?(0,A.jsx)(`div`,{className:`shrink-0 px-2 pb-2 pt-1`,children:(0,A.jsxs)(`a`,{href:r.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[r.manageLabel,(0,A.jsx)(Te,{className:`h-3 w-3`})]})}):null]})}function ya(e){let{Popover:t,PopoverContent:n,PopoverTrigger:r,Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=Ki,{accessories:c,label:l,picker:u}=e,[d,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(`actions`);return(0,A.jsxs)(t,{open:d,onOpenChange:e=>{f(e),e||m(`actions`)},children:[(0,A.jsx)(o,{children:(0,A.jsxs)(i,{children:[(0,A.jsx)(s,{asChild:!0,children:(0,A.jsx)(`span`,{className:`inline-flex`,children:(0,A.jsx)(r,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":l,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:(0,A.jsx)(Ne,{className:`h-4 w-4`})})})})}),(0,A.jsx)(a,{side:`top`,children:(0,A.jsx)(`p`,{className:`text-xs`,children:l})})]})}),(0,A.jsx)(n,{side:`top`,align:`start`,variant:p===`actions`?`menu`:`default`,className:p===`skills`?`flex w-[min(340px,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md`:void 0,style:{maxHeight:ga},children:p===`actions`?(0,A.jsxs)(A.Fragment,{children:[c.map(e=>(0,A.jsxs)(`button`,{type:`button`,"aria-label":e.label,disabled:e.disabled,onClick:()=>{e.onClick?.(),f(!1)},className:_a,children:[e.icon===`paperclip`?(0,A.jsx)(yt,{className:`h-4 w-4`}):null,(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.key)),u?(0,A.jsxs)(`button`,{type:`button`,onClick:()=>m(`skills`),className:_a,children:[(0,A.jsx)(Tt,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:u.title}),(0,A.jsx)(We,{className:`h-4 w-4 shrink-0 text-muted-foreground/60`})]}):null]}):u?(0,A.jsx)(va,{picker:u,onBack:()=>m(`actions`)}):null})]})}function ba(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1,n===e.length))return!0;return e.length===0}function xa(e,t){let n=e.filter(Boolean).join(` `).toLowerCase(),r=n.replace(/[\s/_.-]+/g,``);return t.split(/\s+/).filter(Boolean).every(e=>{let t=e.replace(/[\s/_.-]+/g,``);return n.includes(e)||ba(t,r)})}function Sa(e,t,n){let r=n.trim().toLowerCase();return e.groups.filter(e=>e.options.length>0).filter(e=>t===`all`||e.key===t).map(e=>({...e,options:r?e.options.filter(e=>xa([e.label,e.value,e.description],r)):e.options})).filter(e=>e.options.length>0)}function Ca({discovery:e,onOpen:t}){return(0,A.jsx)(`div`,{className:`shrink-0 border-t border-border/60 px-1.5 py-1`,children:(0,A.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:t,children:[(0,A.jsx)(Tt,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.summaryLabel}),(0,A.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:e.viewLabel})]})})}function wa({discovery:e,open:t,onOpenChange:n,renderOption:r,restoreFocusRef:i}){let{Dialog:a,DialogContent:o,DialogDescription:s,DialogHeader:c,DialogTitle:l,Input:u}=Ki,[d,f]=(0,k.useState)(``),[m,h]=(0,k.useState)(`all`),[g,_]=(0,k.useState)(null),[v,y]=(0,k.useState)(()=>new Set),b=(0,k.useMemo)(()=>e.groups.filter(e=>e.options.length>0),[e.groups]),x=m===`all`||b.some(e=>e.key===m)?m:`all`,S=(0,k.useMemo)(()=>Sa(e,x,d),[e,d,x]),C=e=>{n(e),e||(f(``),h(`all`),_(null),y(new Set))},w=async t=>{if(!(g||v.has(t))){_(t);try{await e.onSelect(t),y(e=>new Set(e).add(t))}catch{return}finally{_(null)}}};return(0,A.jsx)(a,{open:t,onOpenChange:C,children:(0,A.jsxs)(o,{closeLabel:e.closeLabel,className:`flex h-[calc(100vh-1rem)] max-h-[42rem] w-[calc(100%-1rem)] max-w-2xl flex-col gap-0 overflow-hidden p-0 sm:h-[min(42rem,calc(100vh-2rem))]`,onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()},children:[(0,A.jsxs)(c,{className:`shrink-0 gap-1 border-b border-border/70 px-5 pb-4 pt-5 text-left`,children:[(0,A.jsx)(l,{className:`pr-8 text-lg font-semibold text-foreground`,children:e.groupLabel}),(0,A.jsx)(s,{className:`text-sm text-muted-foreground`,children:e.summaryLabel}),(0,A.jsxs)(`div`,{className:`relative pt-3`,children:[(0,A.jsx)(p,{className:`pointer-events-none absolute left-3 top-[1.375rem] h-4 w-4 text-muted-foreground/60`}),(0,A.jsx)(u,{autoFocus:!0,value:d,onChange:e=>f(e.currentTarget.value),placeholder:e.searchPlaceholder,className:`h-9 rounded-xl border-0 bg-muted/45 pl-9 text-sm shadow-none`})]}),(0,A.jsxs)(`div`,{role:`tablist`,"aria-label":e.groupLabel,className:`custom-scrollbar flex gap-1 overflow-x-auto overscroll-contain pt-2`,children:[(0,A.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":x===`all`,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${x===`all`?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>h(`all`),children:e.allGroupLabel}),b.map(e=>(0,A.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":x===e.key,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${x===e.key?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>h(e.key),children:e.label},e.key))]})]}),(0,A.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-2`,children:[S.length===0?(0,A.jsx)(`p`,{className:`px-3 py-10 text-center text-sm text-muted-foreground`,children:e.searchEmptyLabel}):null,S.map(t=>(0,A.jsxs)(`div`,{children:[x===`all`?(0,A.jsx)(`div`,{className:`px-3 pb-1 pt-3 text-xs font-medium text-muted-foreground`,children:t.label}):null,t.options.map(t=>{let n=v.has(t.value);return(0,A.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-3 py-2 hover:bg-[var(--interaction-hover)]`,children:[(0,A.jsx)(`div`,{className:`min-w-0 overflow-hidden`,title:t.label,children:r(t)}),(0,A.jsxs)(`button`,{type:`button`,disabled:g!==null||n,className:`inline-flex h-8 min-w-16 shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-lg bg-primary/10 px-3 text-xs font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-default disabled:bg-muted disabled:text-muted-foreground`,onClick:()=>void w(t.value),children:[g===t.value?(0,A.jsx)(ke,{className:`h-3.5 w-3.5 animate-spin`}):null,n?e.addedLabel:e.actionLabel]})]},t.value)})]},t.key))]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-border/70 px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:()=>{e.onDismiss(),C(!1)},children:e.dismissLabel}),(0,A.jsx)(`button`,{type:`button`,className:`rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background transition-opacity hover:opacity-85`,onClick:()=>C(!1),children:e.doneLabel})]})]})})}function Ta({icon:e,className:t=``}){return e===`sparkles`?(0,A.jsx)(Tt,{className:`h-3.5 w-3.5 shrink-0 text-primary ${t}`}):e===`brain`?(0,A.jsx)(Ve,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground ${t}`}):null}var Ea={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},Da=`[@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 [@container_nextclaw-chat-input-bar_(max-width:440px)]:[&>svg]:hidden`,Oa={model:`w-[min(340px,calc(100vw-1rem))]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},ka=Ci(`18rem`),Aa=Ni(`18rem`);function ja(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function Ma(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function Na({item:e}){let t=ja(e);return e.selectedLabel?(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,A.jsx)(Ta,{icon:e.icon,className:e.key===`model`?`hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:block`:``}),(0,A.jsx)(`span`,{className:`nextclaw-chat-toolbar-mobile-label max-w-28 truncate sm:hidden ${e.icon?`[@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`:``}`,children:t}),(0,A.jsx)(`span`,{className:`nextclaw-chat-toolbar-label hidden truncate sm:inline ${e.icon?`[@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`:``}`,children:t})]}):e.loading?(0,A.jsx)(`div`,{className:`h-3 w-24 animate-pulse rounded bg-muted`}):(0,A.jsx)(`span`,{className:`truncate`,children:e.placeholder})}function Pa({option:e}){return e.description?(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label}),(0,A.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.description})]}):(0,A.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label})}function Fa({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Ki,[l,u]=(0,k.useState)(!1),[d,f]=(0,k.useState)(!1),[m,g]=(0,k.useState)(``),_=(0,k.useRef)(null),v=Ma(e),y=(0,k.useMemo)(()=>{let e=m.trim().toLowerCase();return e?v.map(t=>({...t,options:t.options.filter(t=>xa([t.label,t.value,t.description],e))})).filter(e=>e.options.length>0):v},[v,m]),b=v.some(e=>e.options.length>0),x=y.some(e=>e.options.length>0),{discovery:S,optionAction:C}=e,w=new Set(C?.activeValues??[]),T=t=>{if(u(t),t){e.onOpen?.();return}g(``)};return(0,A.jsxs)(n,{open:l,onOpenChange:T,children:[(0,A.jsx)(i,{asChild:!0,children:(0,A.jsxs)(`button`,{ref:_,type:`button`,"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,disabled:e.disabled,className:`nextclaw-chat-toolbar-select-trigger inline-flex h-8 w-auto items-center justify-between rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 ${Ea[e.key]??``} ${e.icon&&e.selectedLabel?Da:``}`,children:[(0,A.jsx)(Na,{item:e}),(0,A.jsx)(we,{className:`ml-1 h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,A.jsxs)(r,{className:`flex flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md ${Oa[e.key]??``}`,style:{maxHeight:ka},children:[(0,A.jsxs)(`div`,{className:`relative shrink-0 px-2 pb-1 pt-1.5`,children:[(0,A.jsx)(p,{className:`pointer-events-none absolute left-[18px] top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,A.jsx)(t,{value:m,onChange:e=>g(e.currentTarget.value),placeholder:e.search?.placeholder??e.placeholder,className:`h-7 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]}),(0,A.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[b?null:e.loading?(0,A.jsxs)(`div`,{className:`space-y-2 px-2 py-1`,children:[(0,A.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,A.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.emptyLabel}):null,b&&!x?(0,A.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.search?.emptyLabel??e.emptyLabel}):null,(0,A.jsx)(`div`,{className:`px-1.5 pb-0.5`,children:y.map(t=>(0,A.jsxs)(`div`,{children:[t.label?(0,A.jsx)(`div`,{className:`px-2 pb-0.5 pt-1.5 text-[11px] font-medium text-muted-foreground/80`,children:t.label}):null,t.options.map(t=>{let n=e.value===t.value,r=w.has(t.value),i=r?C?.activeLabel:C?.inactiveLabel;return(0,A.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-lg hover:bg-[var(--interaction-hover)]`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`flex min-w-0 min-h-8 flex-1 items-center gap-1.5 rounded-lg px-2 py-1 text-left leading-4`,onClick:()=>{e.onValueChange(t.value),T(!1)},children:[(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,A.jsx)(Pa,{option:t})}),n?(0,A.jsx)(h,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]}),C&&i?(0,A.jsx)(s,{children:(0,A.jsxs)(a,{children:[(0,A.jsx)(c,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,className:`mr-1 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-[background-color,color,opacity] hover:bg-[var(--interaction-hover)] hover:text-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 ${r?``:`md:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`}`,onClick:e=>{e.stopPropagation(),C.onToggle(t.value,!r)},children:(0,A.jsx)(Et,{className:`h-3.5 w-3.5 ${r?`fill-current text-foreground`:``}`})})}),(0,A.jsx)(o,{side:`left`,children:(0,A.jsx)(`p`,{className:`text-xs`,children:i})})]})}):null]},t.value)})]},t.key))})]}),S?(0,A.jsx)(Ca,{discovery:S,onOpen:()=>{T(!1),f(!0)}}):null,e.manageHref&&e.manageLabel?(0,A.jsx)(`div`,{className:`shrink-0 px-1.5 pb-1.5 pt-0.5`,children:(0,A.jsxs)(`a`,{href:e.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[e.manageLabel,(0,A.jsx)(Te,{className:`h-3 w-3`})]})}):null]}),S?(0,A.jsx)(wa,{discovery:S,open:d,onOpenChange:f,restoreFocusRef:_,renderOption:e=>(0,A.jsx)(Pa,{option:e})}):null]})}function Ia({item:e}){if(e.search)return(0,A.jsx)(Fa,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=Ki,l=Ma(e),u=l.some(e=>e.options.length>0);return(0,A.jsxs)(t,{value:e.value,onValueChange:e.onValueChange,disabled:e.disabled,children:[(0,A.jsx)(s,{"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,title:e.selectedLabel,className:`nextclaw-chat-toolbar-select-trigger h-8 max-md:min-h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:ring-0 sm:px-3 ${Ea[e.key]??``} ${e.icon&&e.selectedLabel?Da:``}`,children:e.selectedLabel||e.loading?(0,A.jsx)(Na,{item:e}):(0,A.jsx)(c,{placeholder:e.placeholder})}),(0,A.jsxs)(n,{className:Oa[e.key]??``,style:{maxHeight:Aa},children:[u?null:e.loading?(0,A.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,A.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.emptyLabel}):null,l.map((e,t)=>(0,A.jsxs)(`div`,{children:[t>0?(0,A.jsx)(o,{}):null,(0,A.jsxs)(r,{children:[e.label?(0,A.jsx)(a,{children:e.label}):null,e.options.map(e=>(0,A.jsx)(i,{value:e.value,className:`min-h-8 py-1 max-md:min-h-8`,children:(0,A.jsx)(Pa,{option:e})},e.value))]})]},e.key))]})]})}function La({leadingSlot:e,actions:t,accessories:n=[],addMenuLabel:r,selects:i,skillPicker:a,trailingSelects:o=[]}){let s=r??a?.title??n[0]?.label;return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-1 md:gap-2 px-3 pb-3 [--icon-control-size:2rem]`,children:[(0,A.jsxs)(`div`,{className:`nextclaw-chat-toolbar-leading-controls flex min-w-0 shrink-0 flex-wrap items-center gap-1`,children:[s?(0,A.jsx)(ya,{label:s,accessories:n,picker:a}):null,i.map(e=>(0,A.jsx)(Ia,{item:e},e.key)),e]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center justify-end gap-1`,children:[o.length>0?(0,A.jsx)(`div`,{className:`nextclaw-chat-toolbar-trailing-selects flex min-w-0 justify-end items-center gap-1`,children:o.map(e=>(0,A.jsx)(Ia,{item:e},e.key))}):null,(0,A.jsx)(ma,{...t})]})]})}var Ra=(0,k.createContext)(null);function za(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function Ba(){let e=(0,k.useContext)(Ra);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function M(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Va(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Ha=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ua=Ha&&`documentMode`in document?document.documentMode:null,Wa=Ha&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ga=Ha&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ka=!(!Ha||!(`InputEvent`in window)||Ua)&&`getTargetRanges`in new window.InputEvent(`input`),qa=Ha&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ja=Ha&&/Android/.test(navigator.userAgent),Ya=Ha&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Ja,Xa=Ha&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Za=Ha&&Ja&&Xa,Qa=Ha&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Wa&&!Xa,$a=0,eo=1,to=2,no=1,ro=2,io=3,ao=4,oo=5,so=6,co=Ya||qa||Qa?`\xA0`:`​`,lo=`
7
+
8
+ `,uo=Ga?`\xA0`:co,fo={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},po={directionless:1,unmergeable:2},mo={center:2,end:6,justify:4,left:1,right:3,start:5},ho={[ro]:`center`,[so]:`end`,[ao]:`justify`,[no]:`left`,[io]:`right`,[oo]:`start`},go={normal:0,segmented:2,token:1},_o={[$a]:`normal`,[to]:`segmented`,[eo]:`token`},vo=`$config`;function yo(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(L(o)&&yo(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var bo=!1,xo=0;function So(e){xo=e.timeStamp}function Co(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&xd(e,n)!==void 0}function wo(e,t,n){let r=df(nf(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&Pd(t,o,i,a,!1)}function To(e,t,n){if(F(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return ud(t)&&n.isAttached()}function Eo(e,t,n,r){for(let i=e;i&&!Ef(i);i=Xd(i)){let e=xd(i,t);if(e!==void 0){let t=yd(e,n);if(t)return ju(t)||!pf(i)?void 0:[i,t]}else if(i===r)return[r,Ed(n)]}}function Do(e,t,n){bo=!0;let r=performance.now()-xo>100;try{Tu(e,()=>{let i=I()||function(e){return e.getEditorState().read(()=>{let e=I();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Eo(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&P(g)&&ud(p)&&To(i,p,g)&&wo(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=bd(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Co(r,a,e)){if(Ga){let e=(pf(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Co(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Co(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&Dd(i),Ga&&Jd(e)&&i.insertRawText(u))})}finally{bo=!1}}function Oo(e){let t=e._observer;t!==null&&Do(e,t.takeRecords(),t)}function ko(e){(function(e){xo===0&&nf(e).addEventListener(`textInput`,So,!0)})(e),e._observer=new MutationObserver((t,n)=>{Do(e,t,n)})}var Ao=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Lo).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function jo(e,t){return new Ao(e,t)}function Mo(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Of(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var No=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState;this.size=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Io(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=Io(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Po(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new No(t,Fo(t));return t.__state=n,n}function Fo(e){return e.__state?e.__state.sharedNodeState:$u(yf(),e.getType()).sharedNodeState}function Io(e){if(e)for(let t in e)return e}function Lo(e){return e}function Ro(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function zo(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function Bo(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Vo(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&Ro(n,e,t)||t&&Ro(n,t,e)||e&&zo(n,e,t)||t&&zo(n,t,e))}(c,l))}function Ho(e,t){let n=e.mergeWithSibling(t),r=fu()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Uo(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(Vo(t,r)){r=Ho(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&P(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(Vo(r,n)){r=Ho(r,n);break}break}n.remove()}}else r.remove()}function Wo(e){return Go(e.anchor),Go(e.focus),e}function Go(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),P(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!L(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns=``,rs=null,is=null,as=!1,os=!1;function ss(e,t){let n=Qo.get(e);if(t!==null){let n=Ts(e);n.parentNode===t&&t.removeChild(n)}if($o.has(e)||qo._keyToDOMMap.delete(e),L(n)){let e=ys(n,Qo);cs(e,0,e.length-1,null)}n!==void 0&&Gd(ts,Jo,Yo,n,`destroyed`)}function cs(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&ss(t,r)}}function ls(e,t){e.setProperty(`text-align`,t)}var us=`40px`;function ds(e,t){let n=Ko.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(qo._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||us;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function fs(e,t){let n=e.style;t===0?ls(n,``):t===1?ls(n,`left`):t===2?ls(n,`center`):t===3?ls(n,`right`):t===4?ls(n,`justify`):t===5?ls(n,`start`):t===6&&ls(n,`end`)}function ps(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Nu(e))return null;let n=e.getParentOrThrow();return Nu(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function ms(e,t){let n=$o.get(e);n===void 0&&M(60);let r=n.createDOM(Ko,qo);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,qo),P(n)?r.setAttribute(`data-lexical-text`,`true`):ju(n)&&r.setAttribute(`data-lexical-decorator`,`true`),L(n)){let e=n.__indent,t=n.__size;if(ps(r,n),e!==0&&ds(r,e),t!==0){let e=t-1;hs(ys(n,$o),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&fs(r,i),n.isInline()||_s(null,n,r)}else{let t=n.getTextContent();if(ju(n)){let t=n.decorate(qo,Ko);t!==null&&xs(e,t),r.contentEditable=`false`}ns+=t}return t!==null&&t.insertChild(r),Gd(ts,Jo,Yo,n,`created`),r}function hs(e,t,n,r,i){let a=ns;ns=``;let o=n;for(;o<=r;++o){ms(e[o],i);let t=$o.get(e[o]);t!==null&&P(t)?rs===null&&(rs=t.getFormat(),is=t.getStyle()):L(t)&&o<r&&!t.isInline()&&(ns+=lo)}i.element.__lexicalTextContent=ns,ns=a+ns}function gs(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return rl(e)?`line-break`:ju(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function _s(e,t,n){let r=gs(e,Qo),i=gs(t,$o);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function vs(e,t,n){var r;rs=null,is=null,function(e,t,n){let r=ns,i=e.__size,a=t.__size;ns=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)bs(n,o);else{let e=Ts(n),t=ms(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}ss(n,null)}let i=$o.get(r);P(i)&&rs===null&&(rs=i.getFormat(),is=i.getStyle())}else{let r=ys(e,Qo),s=ys(t,$o);if(r.length!==i&&M(227),s.length!==a&&M(228),i===0)a!==0&&hs(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;cs(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Ss(bs(r,a.element)),d++,f++;else{if(l===void 0&&(l=Cs(n,f)),c===void 0)c=Cs(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Ss(Ts(e)),ss(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=Yd(qo,r);e!==u&&a.withBefore(u).insertChild(e),u=Ss(bs(r,a.element)),d++,f++}else ms(r,a.withBefore(u)),f++}let i=$o.get(r);i!==null&&P(i)?rs===null&&(rs=i.getFormat(),is=i.getStyle()):L(i)&&f<=s&&!i.isInline()&&(ns+=lo)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:qo.getElementByKey(e);hs(n,0,f,s,a.withBefore(t))}else m&&!p&&cs(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=ns,ns=r+ns}(e,t,t.getDOMSlot(n)),r=t,rs==null||rs===r.__textFormat||os||r.setTextFormat(rs),function(e){is==null||is===e.__textStyle||os||e.setTextStyle(is)}(t)}function ys(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&M(101),n.push(r),r=e.__next}return n}function bs(e,t){let n=Qo.get(e),r=$o.get(e);n!==void 0&&r!==void 0||M(61);let i=as||Zo.has(e)||Xo.has(e),a=Yd(qo,e);if(n===r&&!i){let e;if(L(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return ns+=e,a}if(n!==r&&i&&Gd(ts,Jo,Yo,r,`updated`),r.updateDOM(n,a,Ko)){let n=ms(e,null);return t===null&&M(62),t.replaceChild(n,a),ss(e,null),n}if(L(n)){L(r)||M(334,e);let t=r.__indent;(as||t!==n.__indent)&&ds(a,t);let o=r.__format;if((as||o!==n.__format)&&fs(a,o),i)vs(n,r,a),Nu(r)||r.isInline()||_s(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),ns+=t}if((as||r.__dir!==n.__dir)&&(ps(a,r),Nu(r)&&!as))for(let e of r.getChildren())L(e)&&ps(Yd(qo,e.getKey()),e)}else{let t=r.getTextContent();if(ju(r)){let t=r.decorate(qo,Ko);t!==null&&xs(e,t)}ns+=t}if(!os&&Nu(r)&&r.__cachedText!==ns){let e=r.getWritable();e.__cachedText=ns,r=e}return a}function xs(e,t){let n=qo._pendingDecorators,r=qo._decorators;if(n===null){if(r[e]===t)return;n=Cd(qo)}n[e]=t}function Ss(e){let t=e.nextSibling;return t!==null&&t===qo._blockCursorElement&&(t=t.nextSibling),t}function Cs(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function ws(e,t,n,r,i,a){ns=``,as=r===2,qo=n,Ko=n._config,Jo=n._nodes,Yo=qo._listeners.mutation,Xo=i,Zo=a,Qo=e._nodeMap,$o=t._nodeMap,os=t._readOnly,es=new Map(n._keyToDOMMap);let o=new Map;return ts=o,bs(`root`,null),qo=void 0,Jo=void 0,Xo=void 0,Zo=void 0,Qo=void 0,$o=void 0,Ko=void 0,es=void 0,ts=void 0,o}function Ts(e){let t=es.get(e);return t===void 0&&M(75,e),t}function N(e){return{type:e}}var Es=N(`SELECTION_CHANGE_COMMAND`),Ds=N(`CLICK_COMMAND`),Os=N(`BEFORE_INPUT_COMMAND`),ks=N(`INPUT_COMMAND`),As=N(`COMPOSITION_START_COMMAND`),js=N(`COMPOSITION_END_COMMAND`),Ms=N(`DELETE_CHARACTER_COMMAND`),Ns=N(`INSERT_LINE_BREAK_COMMAND`),Ps=N(`INSERT_PARAGRAPH_COMMAND`),Fs=N(`CONTROLLED_TEXT_INSERTION_COMMAND`),Is=N(`PASTE_COMMAND`),Ls=N(`REMOVE_TEXT_COMMAND`),Rs=N(`DELETE_WORD_COMMAND`),zs=N(`DELETE_LINE_COMMAND`),Bs=N(`FORMAT_TEXT_COMMAND`),Vs=N(`UNDO_COMMAND`),Hs=N(`REDO_COMMAND`),Us=N(`KEYDOWN_COMMAND`),Ws=N(`KEY_ARROW_RIGHT_COMMAND`),Gs=N(`MOVE_TO_END`),Ks=N(`KEY_ARROW_LEFT_COMMAND`),qs=N(`MOVE_TO_START`),Js=N(`KEY_ARROW_UP_COMMAND`),Ys=N(`KEY_ARROW_DOWN_COMMAND`),Xs=N(`KEY_ENTER_COMMAND`),Zs=N(`KEY_SPACE_COMMAND`),Qs=N(`KEY_BACKSPACE_COMMAND`),$s=N(`KEY_ESCAPE_COMMAND`),ec=N(`KEY_DELETE_COMMAND`),tc=N(`KEY_TAB_COMMAND`),nc=N(`DROP_COMMAND`),rc=N(`DRAGSTART_COMMAND`),ic=N(`DRAGOVER_COMMAND`),ac=N(`DRAGEND_COMMAND`),oc=N(`COPY_COMMAND`),sc=N(`CUT_COMMAND`),cc=N(`SELECT_ALL_COMMAND`),lc=N(`FOCUS_COMMAND`),uc=N(`BLUR_COMMAND`),dc=N(`KEY_MODIFIER_COMMAND`),fc=Object.freeze({}),pc=[[`keydown`,function(e,t){mc=e.timeStamp,hc=e.key,!t.isComposing()&&R(t,Us,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;mf(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Tu(t,()=>{nd(n)||(xc=!0)})}],[`compositionstart`,function(e,t){R(t,As,e)}],[`compositionend`,function(e,t){Ga?Cc=!0:qa||!Ya&&!Qa?R(t,js,e):(wc=!0,Tc=e.data)}],[`input`,function(e,t){e.stopPropagation(),Tu(t,()=>{t.dispatchCommand(ks,e)},{event:e}),_c=null}],[`click`,function(e,t){Tu(t,()=>{let n=I(),r=df(nf(t)),i=Gl();if(r){if(F(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!Nu(a)&&Td().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=Af(a,e=>L(e)&&!e.isInline());L(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(pf(n)||ud(n))&&Dd(Wl(i,r,t,e))}}R(t,Ds,e)})}],[`cut`,fc],[`copy`,fc],[`dragstart`,fc],[`dragover`,fc],[`dragend`,fc],[`paste`,fc],[`focus`,fc],[`blur`,fc],[`drop`,fc]];Ka&&pc.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||Ga&&Jd(t)||n!==`insertCompositionText`&&R(t,Os,e)}(e,t)]);var mc=0,hc=null,gc=0,_c=null,vc=new WeakMap,yc=new WeakMap,bc=!1,xc=!1,Sc=!1,Cc=!1,wc=!1,Tc=``,Ec=null,Dc=[0,``,0,`root`,0];function Oc(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=fu(),l=df(nf(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!P(s)||(!i&&(!Ka||gc<r+50)||s.isDirty()&&p<2||kd(n))&&a.offset!==o.offset&&!s.isComposing()||ld(s)||s.isDirty()&&p>1||(i||!Ka)&&f!==null&&!s.isComposing()&&u!==fd(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=cd(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(P(t)||L(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function kc(e,t){return ud(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Ac(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;bc&&(bc=!1,kc(r,i)&&kc(a,o)&&!Ec)||Tu(t,()=>{if(!n)return void Dd(null);if(!id(t,r,a))return;let s=I();if(Ec&&F(s)&&s.isCollapsed()){let e=s.anchor,t=Ec.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=Ec.clone(),Dd(s))}if(Ec=null,F(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=nf(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=Dc,f=Td(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)jc(s,o,c);else if(n.type===`text`)P(r)||M(141),Mc(s,r);else if(n.type===`element`&&!p){L(r)||M(259);let e=n.getNode();e.isEmpty()?function(e,t){jc(e,t.getTextFormat(),t.getTextStyle())}(s,e):jc(s,s.format,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(P(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}R(t,Es,void 0)})}function jc(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Mc(e,t){jc(e,t.getFormat(),t.getStyle())}function Nc(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Pc(e){let t=e.inputType,n=Nc(e),r=fu(),i=I();if(t===`deleteContentBackward`){if(i===null){let e=Gl();if(!F(e))return!0;Dd(e.clone())}if(F(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,hc===`MediaLast`&&a<mc+30&&r.isComposing()&&t){if(_d(null),mc=0,setTimeout(()=>{Tu(r,()=>{_d(null)})},30),F(i)){let e=i.anchor.getNode();e.markDirty(),P(e)||M(142),Mc(i,e)}}else{_d(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=Za&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!ju(qd(i.anchor,!0))),!c){R(r,Ms,!0);let e=I();Za&&F(e)&&e.isCollapsed()&&(Ec=e,setTimeout(()=>Ec=null))}}return!0}}var a;if(!F(i))return!0;let o=e.data;_c!==null&&Nd(!1,r,_c),i.dirty&&_c===null||!i.isCollapsed()||Nu(i.anchor.getNode())||n===null||i.applyDOMRange(n),_c=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
9
+ `)e.preventDefault(),R(r,Ns,!1);else if(o===lo)e.preventDefault(),R(r,Ps,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&Oc(i,n,o,e.timeStamp,!0)?(e.preventDefault(),R(r,Fs,o)):_c=o;return gc=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:R(r,Fs,e);break;case`insertFromComposition`:_d(null),R(r,Fs,e);break;case`insertLineBreak`:_d(null),R(r,Ns,!1);break;case`insertParagraph`:_d(null),Sc&&!qa?(Sc=!1,R(r,Ns,!1)):R(r,Ps,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:R(r,Is,e);break;case`deleteByComposition`:(function(e,t){return e!==t||L(e)||L(t)||!cd(e)||!cd(t)})(l,u)&&R(r,Ls,e);break;case`deleteByDrag`:case`deleteByCut`:R(r,Ls,e);break;case`deleteContent`:R(r,Ms,!1);break;case`deleteWordBackward`:R(r,Rs,!0);break;case`deleteWordForward`:R(r,Rs,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:R(r,zs,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:R(r,zs,!1);break;case`formatStrikeThrough`:R(r,Bs,`strikethrough`);break;case`formatBold`:R(r,Bs,`bold`);break;case`formatItalic`:R(r,Bs,`italic`);break;case`formatUnderline`:R(r,Bs,`underline`);break;case`historyUndo`:R(r,Vs,void 0);break;case`historyRedo`:R(r,Hs,void 0)}return!0}function Fc(e){if(pf(e.target)&&nd(e.target))return!0;let t=fu(),n=I(),r=e.data,i=Nc(e);if(r!=null&&F(n)&&Oc(n,i,r,e.timeStamp,!1)){Cc&&=(Rc(t,r),!1);let i=n.anchor.getNode(),a=df(nf(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;Ka&&!n.isCollapsed()&&P(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===Md(a.anchorNode)||R(t,Fs,r);let l=r.length;Ga&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),Za&&t.isComposing()&&(mc=0,_d(null))}else Nd(!1,t,r===null?void 0:r),Cc&&=(Rc(t,r||void 0),!1);return function(){lu(),Oo(fu())}(),!0}function Ic(e){let t=fu(),n=I();if(F(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();_d(r.key),Qd(Qc),(e.timeStamp<mc+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||P(i)&&i.getStyle()!==n.style)&&R(t,Fs,uo)}return!0}function Lc(e){return Rc(fu(),e.data),Qd($c),!0}function Rc(e,t){let n=e._compositionKey;if(_d(null),n!==null&&t!=null){if(t===``){let t=yd(n),r=fd(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&P(t)){let n=df(nf(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),Pd(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
10
+ `){let t=I();if(F(t)||jl(t)){if(F(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}R(e,Xs,null);return}}}Nd(!0,e,t)}function zc(e){let t=fu();if(e.key==null)return!0;if(wc){if(Vd(e))return Tu(t,()=>{Rc(t,Tc)}),wc=!1,Tc=``,!0;wc=!1,Tc=``}if(function(e){return Rd(e,`ArrowRight`,{shiftKey:`any`})}(e))R(t,Ws,e);else if(function(e){return Rd(e,`ArrowRight`,zd)}(e))R(t,Gs,e);else if(function(e){return Rd(e,`ArrowLeft`,{shiftKey:`any`})}(e))R(t,Ks,e);else if(function(e){return Rd(e,`ArrowLeft`,zd)}(e))R(t,qs,e);else if(function(e){return Rd(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))R(t,Js,e);else if(function(e){return Rd(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))R(t,Ys,e);else if(function(e){return Rd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))Sc=!0,R(t,Xs,e);else if(function(e){return e.key===` `}(e))R(t,Zs,e);else if(function(e){return Wa&&Rd(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),Sc=!0,R(t,Ns,!0);else if(function(e){return Rd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))Sc=!1,R(t,Xs,e);else if(function(e){return Rd(e,`Backspace`,{shiftKey:`any`})||Wa&&Rd(e,`h`,{ctrlKey:!0})}(e))Vd(e)?R(t,Qs,e):(e.preventDefault(),R(t,Ms,!0));else if(function(e){return e.key===`Escape`}(e))R(t,$s,e);else if(function(e){return Rd(e,`Delete`,{})||Wa&&Rd(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?R(t,ec,e):(e.preventDefault(),R(t,Ms,!1));else if(function(e){return Rd(e,`Backspace`,Bd)}(e))e.preventDefault(),R(t,Rs,!0);else if(function(e){return Rd(e,`Delete`,Bd)}(e))e.preventDefault(),R(t,Rs,!1);else if(function(e){return Wa&&Rd(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),R(t,zs,!0);else if(function(e){return Wa&&(Rd(e,`Delete`,{metaKey:!0})||Rd(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),R(t,zs,!1);else if(function(e){return Rd(e,`b`,zd)}(e))e.preventDefault(),R(t,Bs,`bold`);else if(function(e){return Rd(e,`u`,zd)}(e))e.preventDefault(),R(t,Bs,`underline`);else if(function(e){return Rd(e,`i`,zd)}(e))e.preventDefault(),R(t,Bs,`italic`);else if(function(e){return Rd(e,`Tab`,{shiftKey:`any`})}(e))R(t,tc,e);else if(function(e){return Rd(e,`z`,zd)}(e))e.preventDefault(),R(t,Vs,void 0);else if(function(e){return Wa?Rd(e,`z`,{metaKey:!0,shiftKey:!0}):Rd(e,`y`,{ctrlKey:!0})||Rd(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),R(t,Hs,void 0);else{let n=t._editorState._selection;n===null||F(n)?Hd(e)&&(e.preventDefault(),R(t,cc,e)):function(e){return Rd(e,`c`,zd)}(e)?(e.preventDefault(),R(t,oc,e)):function(e){return Rd(e,`x`,zd)}(e)?(e.preventDefault(),R(t,sc,e)):Hd(e)&&(e.preventDefault(),R(t,cc,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(dc,e),!0}function Bc(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Vc=new Map;function Hc(e){let t=ff(e.target);if(t===null)return;let n=od(t.anchorNode);if(n===null)return;xc&&(xc=!1,Tu(n,()=>{let r=Gl(),i=t.anchorNode;(pf(i)||ud(i))&&Dd(Wl(r,t,n,e))}));let r=Ad(n),i=r[r.length-1],a=i._key,o=Vc.get(a),s=o||i;s!==n&&Ac(t,s,!1),Ac(t,n,!0),n===i?o&&Vc.delete(a):Vc.set(a,n)}function Uc(e){e._lexicalHandled=!0}function Wc(e){return!0===e._lexicalHandled}function Gc(e){let t=vc.get(e);if(t===void 0)return;let n=yc.get(t);if(n===void 0)return;let r=n-1;r>=0||M(164),vc.delete(e),yc.set(t,r),r===0&&t.removeEventListener(`selectionchange`,Hc);let i=sd(e);ad(i)?(function(e){if(e._parentEditor!==null){let t=Ad(e),n=t[t.length-1]._key;Vc.get(n)===e&&Vc.delete(n)}else Vc.delete(e._key)}(i),e.__lexicalEditor=null):i&&M(198);let a=Bc(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function Kc(e,t,n){lu();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=I();if(!F(t)||!L(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return ef(i,e)&&n.set(e.__key,0,`element`),ef(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(F(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Jl(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Jl(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else jl(a)&&t&&e.isSelected()&&e.selectPrevious();if(F(a)&&t&&!o){let t=e.getIndexWithinParent();hd(e),Kl(a,i,t,-1)}else hd(e);n||af(i)||i.canBeEmpty()||!i.isEmpty()||Kc(i,t),t&&a&&Nu(i)&&i.isEmpty()&&i.selectEnd()}var qc=Symbol.for(`ephemeral`);function Jc(e){return e[qc]||!1}var Yc=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Of(this);return e===void 0&&M(64,this.name),e}static clone(e){M(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),md(this,e)}getType(){return this.__type}isInline(){M(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=yd(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||I();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(P(this))return n;if(F(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(ju(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:yd(e)}getParentOrThrow(){let e=this.getParent();return e===null&&M(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(af(t))return L(e)||e===this&&ju(e)||M(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&M(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:yd(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:yd(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=L(this)?this:this.getParent(),n=L(e)?e:e.getParent(),r=t&&n?cp(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=cp(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?ap(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&M(279),!1)))}isParentOf(e){let t=cp(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=L(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&M(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=fu()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Jc(this))return this;let e=yd(this.__key);return e===null&&M(113),e}getWritable(){if(Jc(this))return this;lu();let e=du(),t=fu(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=I();if(o!==null&&o.setCachedNodes(null),a.has(r))return gd(i),i;let s=Cf(i);return a.add(r),gd(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){M(70)}updateDOM(e,t,n){M(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){M(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Fo(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Po(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Kc(this,!0,e)}replace(e,t){lu();let n=I();n!==null&&(n=n.clone()),sf(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;hd(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(Kc(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(L(this)&&L(o)||M(139),this.getChildren().forEach(e=>{o.append(e)})),F(n)){Dd(n);let e=n.anchor,t=n.focus;e.key===i&&Ol(e,o),t.key===i&&Ol(t,o)}return vd()===i&&_d(a),o}insertAfter(e,t=!0){lu(),sf(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=I(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(hd(r),F(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&F(a)){let e=this.getIndexWithinParent();Kl(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){lu(),sf(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;hd(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=I();return t&&F(l)&&Kl(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Hu()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){lu();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(L(n))return n.select();if(!P(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){lu();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(L(n))return n.select(0,0);if(!P(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},Xc=`history-merge`,Zc=`skip-dom-selection`,Qc=`composition-start`,$c=`composition-end`,el=class e extends Yc{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
11
+ `}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&_f(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&il(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&il(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&_f(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&il(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&il(r))return!0}return!1}(e)?null:{conversion:tl,priority:0}}}static importJSON(e){return nl().updateFromJSON(e)}};function tl(e){return{node:nl()}}function nl(){return of(new el)}function rl(e){return e instanceof el}function il(e){return ud(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function al(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function ol(e,t){return 1&t?`strong`:2&t?`em`:`span`}function sl(e,t,n,r,i){let a=r.classList,o=Wd(i,`base`);o!==void 0&&a.add(...o),o=Wd(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in fo){let r=fo[e];if(o=Wd(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}function cl(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?co:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||Ga){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function ll(e,t,n,r,i,a){cl(i,e,t);let o=a.theme.text;o!==void 0&&sl(0,0,r,e,o)}function ul(e,t){let n=document.createElement(t);return n.appendChild(e),n}var dl=class e extends Yc{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return _o[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===vd()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=fo[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return pd(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=al(0,n),i=ol(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),ll(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=al(0,i),s=al(0,a),c=ol(0,i),l=ol(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??M(48);let i=document.createElement(l);return ll(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??M(49)),cl(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&sl(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:gl,priority:0}),b:()=>({conversion:pl,priority:0}),code:()=>({conversion:yl,priority:0}),em:()=>({conversion:yl,priority:0}),i:()=>({conversion:yl,priority:0}),mark:()=>({conversion:yl,priority:0}),s:()=>({conversion:yl,priority:0}),span:()=>({conversion:fl,priority:0}),strong:()=>({conversion:yl,priority:0}),sub:()=>({conversion:yl,priority:0}),sup:()=>({conversion:yl,priority:0}),u:()=>({conversion:yl,priority:0})}}static importJSON(e){return bl().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return pf(t)||M(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=ul(t,`b`)),this.hasFormat(`italic`)&&(t=ul(t,`i`)),this.hasFormat(`strikethrough`)&&(t=ul(t,`s`)),this.hasFormat(`underline`)&&(t=ul(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?fo[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?po[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=pd(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=go[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){lu();let n=e,r=t,i=I(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!F(i))return Vl(o,n,o,r,`text`,`text`);{let e=vd();e!==i.anchor.key&&e!==i.focus.key||_d(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=I();if(r&&F(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){lu();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=vd(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=I();if(F(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=bl(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=Bo(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=bl(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=Bo(t,n);let a=n.__key;i===r&&_d(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&gd(t),n!==null&&gd(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),F(v)&&Kl(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||M(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;vd()===r&&_d(n);let o=I();if(F(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Yl(i,t,n,e,a),s!==null&&s.key===r&&Yl(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function fl(e){return{forChild:xl(e.style),node:null}}function pl(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:xl(t.style,n?void 0:`bold`),node:null}}var ml=new WeakMap;function hl(e){if(!pf(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function gl(e){let t=e;e.parentElement===null&&M(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ml.get(n))===void 0&&!hl(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ml.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
12
+ `||r===`\r
13
+ `?t.push(nl()):r===` `?t.push(Cl()):r!==``&&t.push(bl(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=_l(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=_l(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:bl(n)}}function _l(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,pf(n)){let e=n.style.display;if(e===``&&!gf(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(ud(n))return n;if(n.nodeName===`BR`)return null}}var vl={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function yl(e){let t=vl[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:xl(e.style,t),node:null}}function bl(e=``){return of(new dl(e))}function P(e){return e instanceof dl}function xl(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>P(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var Sl=class e extends dl{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=Wd(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return Cl().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&Va(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||M(286),this}setDetail(e){return e!==2&&M(127),this}setMode(e){return e!==`normal`&&M(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Cl(){return of(new Sl)}function wl(e){return e instanceof Sl}var Tl=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:ip(vp(lp(this,`next`)),vp(lp(e,`next`)))<0}getNode(){let e=yd(this.key);return e===null&&M(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,cu()||(vd()===a&&_d(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function El(e,t,n){return new Tl(e,t,n)}function Dl(e,t){let n=t.__key,r=e.offset,i=`element`;if(P(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!L(t)){let e=t.getNextSibling();if(P(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Ol(e,t){if(L(t)){let n=t.getLastDescendant();L(n)||P(n)?Dl(e,n):Dl(e,t)}else Dl(e,t)}var kl=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!jl(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(P(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=yd(e);t!==null&&n.push(t)}return cu()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((I()||Gl())===this&&e[0]){let t=Gf(e[0],`next`);dp(np(t,t))}for(let t of e)t.remove()}};function F(e){return e instanceof Al}var Al=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!F(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(Vf(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;L(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Bf(e.focus)&&L(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=Yf(e.focus.origin,`previous`);Vf(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Zf(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!L(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=vp(e.anchor),r=vp(e.anchor.getFlipped()),i=e=>zf(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(xp(pp(this),`next`));return cu()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Nl(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(L(d)&&!d.isInline())l||(c+=`
14
+ `),l=!d.isEmpty();else if(l=!1,P(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !ju(d)&&!rl(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=fu(),n=t.getEditorState()._selection,r=Bl(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),Wo(this)}clone(){let t=this.anchor,n=this.focus;return new e(El(t.key,t.offset,t.type),El(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=pd(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=fo[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
15
+ `||r===`\r
16
+ `?n.push(nl()):r===` `?n.push(Cl()):n.push(bl(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=bl();if(o.setFormat(n),o.setStyle(r),Uu(a))a.splice(0,0,[o]);else{let e=Nu(i)?Hu().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&up(o,vp(lp(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];P(d)||M(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(ld(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(P(t)&&t.canInsertTextBefore()&&!ld(t)||(t=bl(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(ld(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(P(t)&&!ld(t)||(t=bl(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=bl(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||L(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),zl(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(cd(d)){let t=bl(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(wl(d)){let t=bl(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=bl(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=L(d)?d:d.getParentOrThrow(),r=L(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(P(m)&&!cd(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=bl(m.getTextContent());m.replace(e),m=e}Nu(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||L(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(cd(d))if(s===f)d.select();else{let t=bl(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=I()===this;fp(this,_p(pp(this))),e&&I()!==this&&Dd(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void _d(null);let n=this.getNodes(),r=[];for(let e of n)P(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(L(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),_d(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(ld(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||ld(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||ld(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=I();return F(t)||M(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Af(t,vf),r=e[e.length-1];if(L(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=$l(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(L(e)||ju(e))&&!e.isInline())){L(n)||M(211,t.constructor.name,t.getType());let i=$l(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=Hu(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=rl(i);if(a||ju(i)&&i.isInline()||L(i)&&i.isInline()||P(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!L(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;L(u=l)&&vf(u)&&!u.isEmpty()&&L(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(L(n)||M(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&M(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||M(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=Af(a,vf);s&&L(d)&&(s.canMergeWhenEmpty()||vf(c))&&(d.append(...s.getChildren()),s.remove()),L(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=L(n)?n.getLastChild():null;rl(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=Hu();return Td().splice(this.anchor.offset,0,[e]),e.select(),e}let e=$l(this),t=Af(this.anchor.getNode(),vf);L(t)||M(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=nl();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Nl(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(P(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(P(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),P(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(tu(this,e,t,n))return;let r=e===`move`,i=fu(),a=df(nf(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!L(c)||c.isInline()||c.canBeEmpty()||uf(o,i,s),this.dirty){let e=Yd(i,this.anchor.key),t=Yd(i,this.focus.key);this.anchor.type===`text`&&(e=fd(e)),this.focus.type===`text`&&(t=fd(t)),e&&t&&Xl(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=Nu(n)?n:rf(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];ef(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];L(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];L(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&tu(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&L(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(L(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=ep(lp(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(Vf(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(L(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=vp(t);fp(this,np(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Bf(t)){if(L(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(ju(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&L(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Ul();e.add(t.origin.getKey()),Dd(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return fp(this,np(!t.origin.isEmpty()&&n.isEmpty()?mp(Gf(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&Pl(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Il(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Il(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(kd(e)||Fl(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&Nu(e.getParent())&&e.getPreviousSibling()===null&&Pl(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function jl(e){return e instanceof kl}function Ml(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Nl(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Ml(n),Ml(r)]}function Pl(e,t){for(let n=t;n;n=n.getParent()){if(L(n)){if(n.collapseAtStart(e))return!0;if(af(n))break}if(n.getPreviousSibling())break}return!1}var Fl=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Il(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Ll(e,t,n,r){let i,a=t;if(pf(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=Od(u),P(i))a=qf(i,o?`next`:`previous`);else{let s=Od(e);if(s===null)return null;if(L(s)){let c=r.getElementByKey(s.getKey());c===null&&M(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),L(s)||M(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(L(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=L(u)?u:u.getParentOrThrow()),a=0}P(u)?(i=u,s=null,a=qf(u,o?`next`:`previous`)):u!==s&&o&&!d&&(L(s)||M(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&ju(s)&&Od(e)===s?n:n+1,s=s.getParentOrThrow()}if(L(s))return El(s.__key,a,`element`)}}else i=Od(e);return P(i)?El(i.__key,qf(i,a,`clamp`),`text`):null}function Rl(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&L(a)&&a.isInline()){let t=a.getPreviousSibling();P(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else L(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):P(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&L(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&L(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();P(t)&&e.set(t.__key,0,`text`)}}}function zl(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Rl(e,n,r),Rl(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Bl(e,t,n,r,i,a){if(e===null||n===null||!id(i,e,n))return null;let o=Ll(e,t,F(a)?a.anchor:null,i);if(o===null)return null;let s=Ll(n,r,F(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=Od(e),r=Od(n);if(ju(t)&&ju(r))return null}return zl(o,s),[o,s]}function Vl(e,t,n,r,i,a){let o=du(),s=new Al(El(e,t,i),El(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Hl(){return new Al(El(`root`,0,`element`),El(`root`,0,`element`),0,``)}function Ul(){return new kl(new Set)}function Wl(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!bo&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(F(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&F(e)&&!id(n,l,u))return e.clone();let p=Bl(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(F(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();P(e)?(g=e.getFormat(),_=e.getStyle()):L(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new Al(m,h,g,_)}function I(){return du()._selection}function Gl(){return fu()._editorState._selection}function Kl(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),ql(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}ql(e)}function ql(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!L(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(P(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(L(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(P(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(L(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(P(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function Jl(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,P(i)?s=`text`:L(i)&&(s=`element`)):(a=r.__key,P(r)?(o=r.getTextContentSize(),s=`text`):L(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Yl(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function Xl(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Zl(e,t,n){let r=Yd(e,t.getKey());if(L(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function Ql(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&rd(d))return;if(!F(t))return void(e!==null&&id(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=Zl(n,m,f.offset),[v,y]=Zl(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=v,T=!1;var ee,te,E,ne,D;if((f.type===`text`?(C=fd(g),T=m.getFormat()!==b||m.getStyle()!==x):F(e)&&e.anchor.type===`text`&&(T=!0),p.type===`text`&&(w=fd(v)),C!==null&&w!==null)&&(S&&(e===null||T||F(e)&&(e.format!==b||e.style!==x))&&(ee=b,te=x,E=_,ne=f.key,D=performance.now(),Dc=[ee,te,E,ne,D]),l!==_||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(Xl(r,C,_,w,y),!Ga||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=F(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=Zd(n),i=tf(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t){s=0,c=nf(e).innerHeight;let t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),a=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(s+=n),isFinite(a)&&(c-=a)}else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=Xd(l)}})(n,t,a)}}bc=!0}}function $l(e){let t=e;e.isCollapsed()||t.removeText();let n=I();F(n)&&(t=n),F(t)||M(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!vf(i);){let e=i;if([i,a]=eu(i,a),e.is(i))break}return a}function eu(e,t){let n=e.getParent();if(!n){let e=Hu();return Td().append(e),e.select(),[Td(),0]}if(P(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!L(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Al(El(e.__key,t,`element`),El(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function tu(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=lp(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!yp(c)){for(let e of c){l=!1;let{origin:t}=e;if(!ju(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of ep(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Vf(e))e.origin.isInline()||(c=e);else{if(L(e.origin))continue;ju(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&ju(c.origin)&&c.origin.isKeyboardSelectable()){let e=Ul();return e.add(c.origin.getKey()),Dd(e),!0}return c=vp(c),s&&up(e.anchor,c),up(e.focus,c),l||!o}var nu=null,ru=null,iu=!1,au=!1,ou=0,su={characterData:!0,childList:!0,subtree:!0};function cu(){return iu||nu!==null&&nu._readOnly}function lu(){iu&&M(13)}function uu(){ou>99&&M(14)}function du(){return nu===null&&M(195,pu()),nu}function fu(){return ru===null&&M(196,pu()),ru}function pu(){let e=0,t=new Set,n=Yu.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=sd(r);if(ad(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function mu(){return ru}function hu(e,t,n){let r=t.__type,i=$u(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function gu(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function _u(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function vu(e,t){let n=e.type,r=t.get(n);r===void 0&&M(17,n);let i=r.klass;e.type!==i.getType()&&M(18,i.name);let a=i.importJSON(e),o=e.children;if(L(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=vu(o[e],t);a.append(n)}return a}function yu(e,t,n){let r=nu,i=iu,a=ru;nu=t,iu=!0,ru=e;try{return n()}finally{nu=r,iu=i,ru=a}}function bu(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=nu,u=iu,d=ru,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){ru=e,nu=n,iu=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=ws(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),au)throw t;Wu(e,null,r,n),ko(e),e._dirtyType=2,au=!0,bu(e,a),au=!1;return}finally{p.observe(r,su),e._updating=f,nu=l,iu=u,ru=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Cd(e)),delete r[a])}(e,n);let b=i?null:df(nf(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){ru=e,nu=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&uf(t,e,r),Ql(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(F(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())lf(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&lf(t)){let n=t.getPreviousSibling();(n===null||lf(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Ep(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&uf(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,su),ru=d,nu=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),F(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Es,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,xu(`decorator`,e,!0,x)),function(e,t,n){let r=wd(t),i=wd(n);r!==i&&xu(`textcontent`,e,!0,i)}(e,t||a,n),xu(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;wu(e,t,r)}}}(e)}function xu(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function Su(e,t,n,r){let i=Ad(e),a;for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t!==void 0){let e=Array.from(t),i=e.length,a=!1;if(Tu(s,()=>{for(let t=0;t<i;t++)if(e[t](n,r))return void(a=!0)}),a)return a}}}return a&&a.update(()=>{Su(a,t,n,r)}),!1}function Cu(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&M(191),a._flushSync=!0),o&&e._deferred.push(o),_u(e,i.tag)),a==null?wu(e,n,i):n()}}return r}function wu(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,_u(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Pu(c||s),l=!0),c._flushSync=o;let u=nu,d=iu,f=ru,p=e._updating;nu=c,iu=!1,e._updating=!0,ru=e;let m=e._headless||e.getRootElement()===null;Zu(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=df(nf(e));return F(n)||n==null?Wl(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=Cu(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(F(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);P(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Uo(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=vd(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);P(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Uo(r),r!==void 0&&gu(r,a)&&hu(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){ou++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&gu(c,a)&&hu(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,ou++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Cu(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(L(t)&&yo(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(F(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||M(19)}else jl(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),bu(e);return}finally{nu=u,iu=d,ru=f,e._updating=p,ou=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,bu(e)):l&&td(()=>{bu(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Tu(e,t,n){ru===e&&n===void 0?t():wu(e,t,n)}var Eu=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&M(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&M(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&M(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(Qa||qa||Ya);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=Du(t,n);i.push(r);let a=Du(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Du(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&M(225),n.reverse()}var Ou=class extends Yc{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return ho[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=fu()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(P(t)&&e.push(t),L(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;L(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;L(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return L(e)&&e.getLastDescendant()||e||null}let r=t[e];return L(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:yd(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&M(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:yd(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&M(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),L(i)&&r!==n-1&&!i.isInline()&&(e+=lo)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),L(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=mo[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=fo[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return pd(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){lu();let n=I(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(P(e)||L(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(P(e)||L(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return F(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Vl(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:mo[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Jc(this)&&M(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||M(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0)if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&M(100);let t=e.getNextSibling(),n=e.__key;hd(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,hd(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&M(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=I();if(F(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;ku(r,t,n)&&Jl(r,r.getNode(),this,l,c),ku(i,t,n)&&Jl(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||af(this)||this.remove()}}return i}getDOMSlot(e){return new Eu(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(pf(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||af(this)||this.getChildren().some(P)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function L(e){return e instanceof Ou}function ku(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Au=class extends Yc{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function ju(e){return e instanceof Au}var Mu=class e extends Ou{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){M(51)}getTextContent(){let e=this.__cachedText;return!cu()&&fu()._dirtyType!==0||e===null?super.getTextContent():e}remove(){M(52)}replace(e){M(53)}insertBefore(e){M(54)}insertAfter(e){M(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)L(e)||ju(e)||M(282);return super.splice(e,t,n)}static importJSON(e){return Td().updateFromJSON(e)}collapseAtStart(){return!0}};function Nu(e){return e instanceof Mu}function Pu(e){return new Ru(new Map(e._nodeMap))}function Fu(){return new Ru(new Map([[`root`,new Mu]]))}function Iu(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&M(130,n.name),L(e)){let r=t.children;Array.isArray(r)||M(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Iu(i[e]);r.push(t)}}return t}function Lu(e){return e instanceof Ru}var Ru=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return yu(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return yu(null,this,()=>({root:Iu(Td())}))}},zu=class extends Ou{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},Bu=class e extends Ou{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=Wd(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Vu,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(pf(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return Hu().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(P);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=Hu();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||P(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Vu(e){let t=Hu();if(e.style&&(t.setFormat(e.style.textAlign),Tf(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in mo&&t.setFormat(n)}return{node:t}}function Hu(){return of(new Bu)}function Uu(e){return e instanceof Bu}function Wu(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=Fu(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function Gu(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=Of(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof Yc&&e!==Yc?e:void 0}}return t}function Ku(e){let t=e||{},n=mu(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Fu(),s=t.namespace||(i===null?jd():i._config.namespace),c=t.editorState,l=[Mu,dl,el,Sl,Bu,zu,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}Of(t);let i=t.getType(),a=Gu(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:Mo(l[e]),transforms:a})}}let m=new Yu(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(Os,Pc,0),e.registerCommand(ks,Fc,0),e.registerCommand(As,Ic,0),e.registerCommand(js,Lc,0),e.registerCommand(Us,zc,0)}(m),m}function qu(e,t){let n=e.get(t);e.delete(t),n&&n()}function Ju(e,t,n){return e.set(t,n),qu.bind(null,e,t)}var Yu=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=jd(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return Ju(this._listeners.update,e)}registerEditableListener(e){return Ju(this._listeners.editable,e)}registerDecoratorListener(e){return Ju(this._listeners.decorator,e)}registerTextContentListener(e){return Ju(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Op(Ju(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&M(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&M(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&M(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Sf(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Sf(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=yd(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Xc}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return R(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Wd(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Wu(this,t,e,r),t!==null&&(this._config.disableEvents||Gc(t),n!=null&&t.classList.remove(...n)),e!==null){let t=tf(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,ko(this),this._updateTags.add(Xc),bu(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;vc.set(e,n);let r=yc.get(n)??0;r<1&&n.addEventListener(`selectionchange`,Hc),yc.set(n,r+1),e.__lexicalEditor=t;let i=Bc(e);for(let n=0;n<pc.length;n++){let[r,a]=pc[n],o=typeof a==`function`?e=>{Wc(e)||(Uc(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(Wc(e))return;Uc(e);let n=t.isEditable();switch(r){case`cut`:return n&&R(t,sc,e);case`copy`:return R(t,oc,e);case`paste`:return n&&R(t,Is,e);case`dragstart`:return n&&R(t,rc,e);case`dragover`:return n&&R(t,ic,e);case`dragend`:return n&&R(t,ac,e);case`focus`:return n&&R(t,lc,e);case`blur`:return n&&R(t,uc,e);case`drop`:return n&&R(t,nc,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Xc),bu(this);xu(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&M(38);let n=e;n._readOnly&&(n=Pu(e),n._selection=e._selection?e._selection.clone():null),Oo(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),bu(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||bu(this)}parseEditorState(e,t){return function(e,t,n){let r=Fu(),i=nu,a=iu,o=ru,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,nu=r,iu=!1,ru=t,Zu(null);try{let i=t._nodes;vu(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,nu=i,iu=a,ru=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return bu(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):wu(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Tu(this,()=>{let r=I(),i=Td();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Dd(r.clone()),Qd(`focus`),$d(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=df(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,xu(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};Yu.version=`0.43.0+prod.esm`;var Xu=null;function Zu(e){Xu=e}var Qu=1;function $u(e,t){let n=ed(e,t);return n===void 0&&M(30,t),n}function ed(e,t){return e._nodes.get(t)}var td=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function nd(e){return ju(Sd(e))}function rd(e){let t=document.activeElement;if(!pf(t))return!1;let n=t.nodeName;return ju(Sd(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&sd(t)==null)}function id(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!rd(t)&&od(t)===e}catch{return!1}}function ad(e){return e instanceof Yu}function od(e){let t=e;for(;t!=null;){let e=sd(t);if(ad(e))return e;t=Xd(t)}return null}function sd(e){return e?e.__lexicalEditor:null}function cd(e){return wl(e)||e.isToken()}function ld(e){return cd(e)||e.isSegmented()}function ud(e){return mf(e)&&e.nodeType===3}function dd(e){return mf(e)&&e.nodeType===9}function fd(e){let t=e;for(;t!=null;){if(ud(t))return t;t=t.firstChild}return null}function pd(e,t,n){let r=fo[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~fo.superscript:t===`superscript`?i&=~fo.subscript:t===`lowercase`?(i&=~fo.uppercase,i&=~fo.capitalize):t===`uppercase`?(i&=~fo.lowercase,i&=~fo.capitalize):t===`capitalize`&&(i&=~fo.lowercase,i&=~fo.uppercase),i}function md(e,t){let n=function(){let e=Xu;return Xu=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);lu(),uu();let r=fu(),i=du(),a=``+ Qu++;i._nodeMap.set(a,e),L(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function hd(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function gd(e){uu(),Jc(e)&&M(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=du(),i=fu(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,L(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function _d(e){lu();let t=fu(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=yd(n);e!==null&&e.getWritable()}if(e!==null){let t=yd(e);t!==null&&t.getWritable()}}}function vd(){return cu()?null:fu()._compositionKey}function yd(e,t){let n=(t||du())._nodeMap.get(e);return n===void 0?null:n}function bd(e,t){let n=xd(e,fu());return n===void 0?null:yd(n,t)}function xd(e,t){return e[`__lexicalKey_${t._key}`]}function Sd(e,t){let n=e;for(;n!=null;){let e=bd(n,t);if(e!==null)return e;n=Xd(n)}return null}function Cd(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function wd(e){return e.read(()=>Td().getTextContent())}function Td(){return Ed(du())}function Ed(e){return e._nodeMap.get(`root`)}function Dd(e){lu();let t=du();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Od(e){let t=fu(),n=function(e,t){let n=e;for(;n!=null;){let e=xd(n,t);if(e!==void 0)return e;n=Xd(n)}return null}(e,t);return n===null?e===t.getRootElement()?yd(`root`):null:yd(n)}function kd(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Ad(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function jd(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function Md(e){return ud(e)?e.nodeValue:null}function Nd(e,t,n){let r=df(nf(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=Md(i),r=Sd(i);if(t!==null&&P(r)){if((t===co||t===uo)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&Pd(r,t,a,o,e)}}}function Pd(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(co)&&(s=t.slice(0,-co.length)),i)){let e=uo,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(_d(null),Ya||qa||Qa)a.remove();else{let e=fu();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=Gl(),c=a.getTextContentSize(),l=vd(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||F(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=I();if(!F(d)||n===null||r===null)return void Fd(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=bl(a.getTextContent());a.replace(e),a=e}Fd(a,s,d)}}}function Fd(e,t,n){if(e.setTextContent(t),F(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=qf(e,i.offset,`clamp`))}}}function Id(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function Ld(e,t){return Id(e,t,`altKey`)&&Id(e,t,`ctrlKey`)&&Id(e,t,`shiftKey`)&&Id(e,t,`metaKey`)}function Rd(e,t,n){if(!Ld(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var zd={ctrlKey:!Wa,metaKey:Wa},Bd={altKey:Wa,ctrlKey:!Wa};function Vd(e){return e.key===`Backspace`}function Hd(e){return Rd(e,`a`,zd)}function Ud(e){let t=Td();if(F(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),Wo(e),e}{let e=t.select(0,t.getChildrenSize());return Dd(Wo(e)),e}}function Wd(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Ep(i);return n[t]=e,e}return i}function Gd(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&M(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Kd(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function qd(e,t){let n=e.offset;if(e.type===`element`)return Kd(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Kd(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Jd(e){let t=nf(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function R(e,t,n){return Su(e,t,n,e)}function Yd(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&M(75,t),n}function Xd(e){let t=e.assignedSlot||e.parentElement;return hf(t)?t.host:t}function Zd(e){return dd(e)?e:pf(e)?e.ownerDocument:null}function Qd(e){lu(),fu()._updateTags.add(e)}function $d(e){lu(),fu()._deferred.push(e)}function ef(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function tf(e){let t=Zd(e);return t?t.defaultView:null}function nf(e){let t=e._window;return t===null&&M(78),t}function rf(e){let t=e.getParentOrThrow();for(;t!==null;){if(af(t))return t;t=t.getParentOrThrow()}return t}function af(e){return Nu(e)||L(e)&&e.isShadowRoot()}function of(e){let t=fu(),n=e.getType(),r=ed(t,n);r===void 0&&M(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||M(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||M(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&M(203,e.constructor.name,n,r.name,r.getType()),t}return e}function sf(e,t){!Nu(e.getParent())||L(t)||ju(t)||M(99)}function cf(e){let t=yd(e);return t===null&&M(63,e),t}function lf(e){return(ju(e)||L(e)&&!e.canBeEmpty())&&!e.isInline()}function uf(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function df(e){return Ha?(e||window).getSelection():null}function ff(e){let t=tf(e);return t?t.getSelection():null}function pf(e){return mf(e)&&e.nodeType===1}function mf(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function hf(e){return mf(e)&&e.nodeType===11}function gf(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function _f(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function vf(e){if(ju(e)&&!e.isInline())return!0;if(!L(e)||af(e))return!1;let t=e.getFirstChild(),n=t===null||rl(t)||P(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function yf(){return fu()}var bf=new WeakMap,xf=new Map;function Sf(e){if(!e._readOnly&&e.isEmpty())return xf;e._readOnly||M(192);let t=bf.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),bf.set(e,t)),t}function Cf(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function wf(e){return(t=Cf(e))[qc]=!0,t;var t}function Tf(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Ef(e){return!0===e.__lexicalUnmanaged}function Df(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Yc[t]}function Of(e){let t=vo in e.prototype?e.prototype[vo]():void 0,n=function(e){if(!(e===Yc||e.prototype instanceof Yc)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{Yu.version&&(n=JSON.parse(Yu.version))}catch{}M(290,e.name,t,n)}return e===Au||e===Ou||e===Yc}(e),r=!n&&Df(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(Df(e,`getType`)||(e.getType=()=>a),Df(e,`clone`)||(e.clone=t=>(Zu(t),new e)),Df(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!Df(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function kf(e){let t=yf();return lu(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Af=(e,t)=>{let n=e;for(;n!=null&&!Nu(n);){if(t(n))return n;n=n.getParent()}return null},jf={next:`previous`,previous:`next`},Mf=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return rp({hasNext:Bf,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Gf(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Gf(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&M(263,Array.from(o).join(` `))}else i.insert(e);i=Gf(e,this.direction)}for(let e of o.values())e.remove();return this}},Nf=class e extends Mf{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Yf(e,this.direction)}getParentCaret(e=`root`){return Gf(If(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ff(this.direction);return Gf(this.getNodeAtCaret(),e)||Yf(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Pf={root:Nu,shadowRoot:af};function Ff(e){return jf[e]}function If(e,t=`root`){return Pf[t](e)?null:e}var Lf=class e extends Mf{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Gf(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return L(this.origin)?Yf(this.origin,this.direction):null}getParentCaret(e=`root`){return Gf(If(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ff(this.direction);return Gf(this.getNodeAtCaret(),e)||Yf(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Rf)&&this.direction===t.direction&&this.origin.is(t.origin)}},Rf=class e extends Mf{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Kf(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Gf(If(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Kf(this.origin,Ff(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Lf||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Gf(this.origin,this.direction)}};function zf(e){return e instanceof Rf}function Bf(e){return e instanceof Lf}function Vf(e){return e instanceof Nf}var Hf={next:class extends Rf{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Rf{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Uf={next:class extends Lf{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Lf{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Wf={next:class extends Nf{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Nf{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Gf(e,t){return e?new Uf[t](e):null}function Kf(e,t,n){return e?new Hf[t](e,qf(e,n)):null}function qf(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Va(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Jf(e,t){return new $f(e,t)}function Yf(e,t){return L(e)?new Wf[t](e):null}function Xf(e){return e&&e.getChildCaret()||e}function Zf(e){return e&&Xf(e.getAdjacentCaret())}var Qf=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return zf(t)?function(e,t){let{direction:n,origin:r}=e;return Jf(e,qf(r,t===`focus`?Ff(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Jf(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=zf(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=zf(n),i=t=>t.isSameNodeCaret(n)?null:Zf(t)||t.getParentCaret(e);return rp({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},$f=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Kf(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function ep(e){return np(e,Gf(Td(),e.direction))}function tp(e){return np(e,e)}function np(e,t){return e.direction!==t.direction&&M(265),new Qf(e,t,e.direction)}function rp(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function ip(e,t){let n=cp(e.origin,t.origin);switch(n===null&&M(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return ap(n)}}function ap(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function op(e,t){return t.is(e)}function sp(e){return L(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function cp(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=sp(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=sp(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(op(e,r)||M(276),{commonAncestor:r,type:`ancestor`}):i===null?(op(t,r)||M(277),{commonAncestor:r,type:`descendant`}):((L(a)||op(e,a))&&(L(i)||op(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||M(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function lp(e,t){let{type:n,key:r,offset:i}=e,a=cf(e.key);return n===`text`?(P(a)||M(266,a.getType(),r),Kf(a,t,i)):(L(a)||M(267,a.getType(),r),Sp(a,e.offset,t))}function up(e,t){let{origin:n,direction:r}=t,i=r===`next`;zf(t)?e.set(n.getKey(),t.offset,`text`):Bf(t)?P(n)?e.set(n.getKey(),qf(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),`element`):(Vf(t)&&L(n)||M(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function dp(e){let t=I(),n=F(t)?t:Hl();return fp(n,e),Dd(n),n}function fp(e,t){up(e.anchor,t.anchor),up(e.focus,t.focus)}function pp(e){let{anchor:t,focus:n}=e,r=lp(t,`next`),i=lp(n,`next`),a=ip(r,i)<=0?`next`:`previous`;return np(bp(r,a),bp(i,a))}function mp(e){let{direction:t,origin:n}=e,r=Gf(n,Ff(t)).getNodeAtCaret();return r?Gf(r,t):Yf(n.getParentOrThrow(),t)}function hp(e,t=`root`){let n=[e];for(let r=Vf(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(mp(r));return n}function gp(e){return!!e&&e.origin.isAttached()}function _p(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=xp(e,r),o=hp(a.anchor,n),s=hp(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(Vf(e))c.add(e.origin.getKey());else if(Bf(e)){let{origin:t}=e;L(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=mp(Gf(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=bl(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Kf(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(gp(e)){u=vp(e);break}for(let e of s)if(gp(e)){d=vp(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(af(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,vf),d=u&&l(o,e=>n.has(e.getKey())&&vf(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;Yf(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(gp);if(p)return tp(bp(vp(p),e.direction));M(269,JSON.stringify(o.map(e=>e.origin.__key)))}function vp(e){let t=function(e){let t=e;for(;Vf(t);){let e=Zf(t);if(!Vf(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(P(t.origin))return zf(t)?t:Kf(t.origin,n,n);let r=t.getAdjacentCaret();return Bf(r)&&P(r.origin)?Kf(r.origin,n,Ff(n)):t}function yp(e){return zf(e)&&e.offset!==qf(e.origin,e.direction)}function bp(e,t){return e.direction===t?e:e.getFlipped()}function xp(e,t){return e.direction===t?e:np(bp(e.focus,t),bp(e.anchor,t))}function Sp(e,t,n){let r=Yf(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return bp(r,n)}function Cp(e){return e}function wp(e){return e}function Tp(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Ep(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Dp(e,...t){let n=Ep(...t);n.length>0&&e.classList.add(...n)}function Op(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function kp(){return Td().getTextContent()}function Ap(e,t=!0){if(e)return!1;let n=kp();return t&&(n=n.trim()),n===``}function jp(e){if(!Ap(e,!1))return!1;let t=Td().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(ju(n))return!1;if(L(n)){if(!Uu(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!P(n))return!1}}}return!0}function Mp(e){return()=>jp(e)}function Np(e){let t=yf().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Pp(e){return Np(Nu(e)?e:e.getParentOrThrow())}function Fp(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!ld(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Nl(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=wf(t)),t.__text=p)}}return t}function Ip(e){let t=Lp(e);return t!==null&&t.writingMode===`vertical-rl`}function Lp(e){let t=e.anchor.getNode();return L(t)?Np(t):Pp(t)}function Rp(e,t){let n=Ip(e)?!t:t;Bp(e)&&(n=!n);let r=lp(e.focus,n?`previous`:`next`);if(yp(r))return!1;for(let e of ep(r)){if(Vf(e))return!e.origin.isInline();if(!L(e.origin)){if(ju(e.origin))return!0;break}}return!1}function zp(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Bp(e){let t=Lp(e);return t!==null&&t.direction===`rtl`}function Vp(e,t,n){let r=Bp(e),i;i=Ip(e)||r?!n:n,zp(e,t,i,`character`)}var Hp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Up=Hp&&`documentMode`in document?document.documentMode:null;Hp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Hp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!Hp||!(`InputEvent`in window)||Up)&&`getTargetRanges`in new window.InputEvent(`input`),Hp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Hp&&/Android/.test(navigator.userAgent),Hp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Hp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Hp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function Wp(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}var Gp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?k.useLayoutEffect:k.useEffect;function Kp({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,k.useState)(e.isEditable()),T=(0,k.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),ee=(0,k.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return Gp(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,A.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:ee,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var qp=(0,k.forwardRef)(Kp);function Jp(e){return e.getEditorState().read(Mp(e.isComposing()))}var Yp=(0,k.forwardRef)(Xp);function Xp(e,t){let{placeholder:n,...r}=e,[i]=Ba();return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(qp,{editor:i,...r,ref:t}),n!=null&&(0,A.jsx)(Zp,{editor:i,content:n})]})}function Zp({content:e,editor:t}){let n=function(e){let[t,n]=(0,k.useState)(()=>Jp(e));return Gp(()=>{function t(){n(Jp(e))}return t(),Op(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,k.useState)(t.isEditable());if((0,k.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,A.jsx)(`div`,{"aria-hidden":!0,children:a})}var Qp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,$p=Qp?k.useLayoutEffect:k.useEffect,em={tag:Xc};function tm({initialConfig:e,children:t}){let n=(0,k.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,editorState:a,html:o}=e,s=za(null,t),c=Ku({editable:e.editable,html:o,namespace:n,nodes:r,onError:e=>i(e,c),theme:t});return function(e,t){if(t!==null){if(t===void 0)e.update(()=>{let t=Td();if(t.isEmpty()){let n=Hu();t.append(n);let r=Qp?document.activeElement:null;(I()!==null||r!==null&&r===e.getRootElement())&&n.select()}},em);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,em);break}case`object`:e.setEditorState(t,em);break;case`function`:e.update(()=>{Td().isEmpty()&&t(e)},em)}}}(c,a),[c,s]},[]);return $p(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,A.jsx)(Ra.Provider,{value:n,children:t})}var nm=(0,k.createContext)(null),rm={didCatch:!1,error:null},im=class extends k.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=rm}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(rm))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&am(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(rm))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,k.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,k.createElement)(nm.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function am(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function om({children:e,onError:t}){return(0,A.jsx)(im,{fallback:(0,A.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var sm=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?k.useLayoutEffect:k.useEffect;function cm(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function lm(){return function(e){let[t]=Ba(),n=(0,k.useMemo)(()=>e(t),[t,e]),[r,i]=(0,k.useState)(()=>n.initialValueFn()),a=(0,k.useRef)(r);return sm(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(cm)}var um=Symbol.for(`preact-signals`);function dm(){if(gm>1)return void gm--;let e,t=!1;for(function(){let e=hm;for(hm=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();pm!==void 0;){let n=pm;for(pm=void 0,_m++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Sm(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(_m=0,gm--,t)throw e}var fm,pm;function mm(e){let t=fm;fm=void 0;try{return e()}finally{fm=t}}var hm,gm=0,_m=0,vm=0,ym=0;function bm(e){if(fm===void 0)return;let t=e.n;return t===void 0||t.t!==fm?(t={i:0,S:e,p:fm.s,n:void 0,t:fm,e:void 0,x:void 0,r:t},fm.s!==void 0&&(fm.s.n=t),fm.s=t,e.n=t,32&fm.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=fm.s,t.n=void 0,fm.s.n=t,fm.s=t),t):void 0}function xm(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Sm(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Cm(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function wm(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Tm(e,t){xm.call(this,void 0),this.x=e,this.s=void 0,this.g=ym-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Em(e){let t=e.m;if(e.m=void 0,typeof t==`function`){gm++;let n=fm;fm=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Dm(e),t}finally{fm=n,dm()}}}function Dm(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Em(e)}function Om(e){if(fm!==this)throw Error(`Out-of-order effect`);wm(this),fm=e,this.f&=-2,8&this.f&&Dm(this),dm()}function km(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function Am(e,t){let n=new km(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}xm.prototype.brand=um,xm.prototype.h=function(){return!0},xm.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?mm(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},xm.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&mm(()=>{var e;(e=this.Z)==null||e.call(this)}))}},xm.prototype.subscribe=function(e){return Am(()=>{let t=this.value,n=fm;fm=void 0;try{e(t)}finally{fm=n}},{name:`sub`})},xm.prototype.valueOf=function(){return this.value},xm.prototype.toString=function(){return this.value+``},xm.prototype.toJSON=function(){return this.value},xm.prototype.peek=function(){let e=fm;fm=void 0;try{return this.value}finally{fm=e}},Object.defineProperty(xm.prototype,`value`,{get(){let e=bm(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(_m>100)throw Error(`Cycle detected`);(function(e){gm!==0&&_m===0&&e.l!==vm&&(e.l=vm,hm={S:e,v:e.v,i:e.i,o:hm})})(this),this.v=e,this.i++,ym++,gm++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{dm()}}}}),Tm.prototype=new xm,Tm.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ym))return!0;if(this.g=ym,this.f|=1,this.i>0&&!Sm(this))return this.f&=-2,!0;let e=fm;try{Cm(this),fm=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return fm=e,wm(this),this.f&=-2,!0},Tm.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}xm.prototype.S.call(this,e)},Tm.prototype.U=function(e){if(this.t!==void 0&&(xm.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Tm.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Tm.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=bm(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),km.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},km.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Em(this),Cm(this),gm++;let e=fm;return fm=this,Om.bind(this,e)},km.prototype.N=function(){2&this.f||(this.f|=2,this.u=pm,pm=this)},km.prototype.d=function(){this.f|=8,1&this.f||Dm(this)},km.prototype.dispose=function(){this.d()};function jm(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}jo(`format`,{parse:e=>typeof e==`number`?e:0});function Mm(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nm(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=Nm(n[e],r[e]);return e}return t}var Pm=0,Fm=1,Im=2,Lm=3,Rm=4,zm=5,Bm=6,Vm=7;function Hm(e){return e.id===Pm}function Um(e){return e.id===Im}function Wm(e){return function(e){return e.id===Fm}(e)||Mm(305,String(e.id),String(Fm)),Object.assign(e,{id:Im})}var Gm=new Set,Km=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Pm}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Tp;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;Um(t)||Mm(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:Lm,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:Rm,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==Rm&&Mm(307,String(t.id),String(zm)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:zm,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==zm&&Mm(308,String(n.id),String(zm));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:Bm})}(n),()=>{let e=this.state;e.id!==Vm&&Mm(309,String(n.id),String(Vm)),this.state=function(e){return Object.assign(e,{id:zm})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==Bm&&Mm(310,String(t.id),String(Bm)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:Vm})}(t),n}getSignal(){return this._signal===void 0&&Mm(311),this._signal}getInitResult(){this.extension.init===void 0&&Mm(312,this.extension.name);let e=this.state;return function(e){return e.id>=Rm}(e)||Mm(313,String(e.id),String(Rm)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=Lm}(e)||Mm(314,String(e.id),String(Lm)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Mm(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Mm(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=Vm}(e)||Mm(316,String(e.id),String(Vm)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Gm}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=zm})(e)||Mm(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},qm={tag:Xc};function Jm(){let e=Td();e.isEmpty()&&e.append(Hu())}var Ym=Cp({config:wp({setOptions:qm,updateOptions:qm}),init:({$initialEditorState:e=Jm})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Lu(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[Mu,dl,el,Sl,Bu]}),Xm=Symbol.for(`@lexical/extension/LexicalBuilder`);function Zm(){}function Qm(e){throw e}function $m(e){return Array.isArray(e)?e:[e]}var eh=`0.43.0+prod.esm`,th=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=eh,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[$m(Ym)];for(let e of t)n.push($m(e));return new e(n)}static maybeFromEditor(t){let n=t[Xm];return n&&(n.PACKAGE_VERSION!==eh&&Mm(292,n.PACKAGE_VERSION,eh),n instanceof e||Mm(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Mm(294),n}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(Ku({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[Xm]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=Zm;function t(){try{e()}finally{e=Zm}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Op(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Mm(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Mm(296);let[t]=$m(e);typeof t.name!=`string`&&Mm(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Mm(298,t.name),!n){n=new Km(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Mm(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Mm(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=$m(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(Um(i))return;let a=n.extension.name;var o;Hm(i)||Mm(300,a,r||`[unknown]`),Hm(o=i)||Mm(304,String(o.id),String(Pm)),i=Object.assign(o,{id:Fm}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=Wm(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Hm(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Mm(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Op(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of jm(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Mm(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&Nm(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=Qm,e}},nh=class e extends Au{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return ih().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:rh,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return Dp(t,e.theme.hr),t}getTextContent(){return`
17
+ `}isInline(){return!1}updateDOM(){return!1}};function rh(){return{node:ih()}}function ih(){return kf(nh)}var ah=Cp({name:`@lexical/react/ReactProvider`});function oh(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s]=t;e.update(()=>{let e=I();if(F(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(P(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),P(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}function sh(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=Td().getChildren();for(let i=0;i<r.length;i++)ch(e,r[i],n,t);return n.innerHTML}function ch(e,t,n,r=null){let i=r===null||t.isSelected(r),a=L(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&P(t)&&(o=Fp(r,t,`clone`));let s=L(o)?o.getChildren():[],c=ed(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=ch(e,a,f,r);!i&&L(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((pf(u)||hf(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(hf(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}function lh(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function uh(e,t=I()){return t??lh(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?``:sh(e,t)}function dh(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var fh=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ph=fh&&`documentMode`in document?document.documentMode:null,mh=fh&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),hh=!(!fh||!(`InputEvent`in window)||ph)&&`getTargetRanges`in new window.InputEvent(`input`),gh=fh&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_h=fh&&/Android/.test(navigator.userAgent),vh=fh&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!_h,yh=fh&&/^(?=.*Chrome).*/i.test(navigator.userAgent),bh=fh&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mh&&!yh;function xh(e,t){t.update(()=>{if(e!==null){let n=Wp(e,KeyboardEvent)?null:e.clipboardData,r=I();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=uh(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function Sh(e){return Op(e.registerCommand(Ms,e=>{let t=I();return!!F(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(Rs,e=>{let t=I();return!!F(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(zs,e=>{let t=I();return!!F(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Fs,e=>{let t=I();if(!F(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)dh(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(Ls,()=>{let e=I();return!!F(e)&&(e.removeText(),!0)},0),e.registerCommand(Ns,e=>{let t=I();return!!F(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Ps,()=>{let e=I();return!!F(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(Ks,e=>{let t=I();if(!F(t))return!1;let n=e,r=n.shiftKey;return!!Rp(t,!0)&&(n.preventDefault(),Vp(t,r,!0),!0)},0),e.registerCommand(Ws,e=>{let t=I();if(!F(t))return!1;let n=e,r=n.shiftKey;return!!Rp(t,!1)&&(n.preventDefault(),Vp(t,r,!1),!0)},0),e.registerCommand(Qs,t=>!!F(I())&&(!gh||navigator.language!==`ko-KR`)&&(t.preventDefault(),e.dispatchCommand(Ms,!0)),0),e.registerCommand(ec,t=>!!F(I())&&(t.preventDefault(),e.dispatchCommand(Ms,!1)),0),e.registerCommand(Xs,t=>{if(!F(I()))return!1;if(t!==null){if((gh||vh||bh)&&hh)return!1;t.preventDefault()}return e.dispatchCommand(Ns,!1)},0),e.registerCommand(cc,()=>(Ud(),!0),0),e.registerCommand(oc,t=>!!F(I())&&(xh(t,e),!0),0),e.registerCommand(sc,t=>!!F(I())&&(function(e,t){xh(e,t),t.update(()=>{let e=I();F(e)&&e.removeText()})}(t,e),!0),0),e.registerCommand(Is,t=>!!F(I())&&(function(e,t){e.preventDefault(),t.update(()=>{let t=I(),n=Wp(e,ClipboardEvent)?e.clipboardData:null;n!=null&&F(t)&&dh(n,t)},{tag:`paste`})}(t,e),!0),0),e.registerCommand(nc,e=>!!F(I())&&(e.preventDefault(),!0),0),e.registerCommand(rc,e=>!!F(I())&&(e.preventDefault(),!0),0))}var Ch=e(s(),1);function wh(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Th=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?k.useLayoutEffect:k.useEffect;function Eh({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,k.useState)(()=>e.getDecorators());return Th(()=>e.registerDecoratorListener(e=>{(0,Ch.flushSync)(()=>{r(e)})}),[e]),(0,k.useEffect)(()=>{r(e.getDecorators())},[e]),(0,k.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,A.jsx)(t,{onError:t=>e._onError(t),children:(0,A.jsx)(k.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,Ch.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function Dh({editor:e,ErrorBoundary:t}){return function(e){let t=th.maybeFromEditor(e);if(t&&t.hasExtensionByName(ah.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&wh(320,e);return!0}return!1}(e)?null:(0,A.jsx)(Eh,{editor:e,ErrorBoundary:t})}function Oh(e){return e.getEditorState().read(Mp(e.isComposing()))}function kh({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=Ba();return function(e){Th(()=>Op(Sh(e),oh(e)),[e])}(r),(0,A.jsxs)(A.Fragment,{children:[e,(0,A.jsx)(Ah,{content:t}),(0,A.jsx)(Dh,{editor:r,ErrorBoundary:n})]})}function Ah({content:e}){let[t]=Ba(),n=function(e){let[t,n]=(0,k.useState)(()=>Oh(e));return Th(()=>{function t(){n(Oh(e))}return t(),Op(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=lm();return n?typeof e==`function`?e(r):e:null}var jh=[`mx-[2px]`,`inline-flex`,`h-6`,`max-w-full`,`items-center`,`gap-1.5`,`rounded-[7px]`,`border`,`border-border/70`,`bg-background/80`,`px-1.5`,`align-middle`,`text-[11px]`,`font-medium`,`leading-none`,`text-foreground`].join(` `),Mh=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svelte`,`swift`,`ts`,`tsx`,`vue`]),Nh=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),Ph=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),Fh=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),Ih=new Set([`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]),Lh=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),Rh=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]),zh=new Set([`doc`,`docx`,`odt`,`pages`,`pdf`,`rtf`,`txt`]);function Bh(e){return/\.([a-z0-9]{1,16})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function Vh(e){let t=Bh(e);return Nh.has(t)?{icon:rt,name:`data-file`}:Ph.has(t)?{icon:nt,name:`image-file`}:Fh.has(t)?{icon:et,name:`audio-file`}:Ih.has(t)?{icon:ot,name:`video-file`}:Lh.has(t)?{icon:it,name:`sheet-file`}:Rh.has(t)?{icon:$e,name:`archive-file`}:Mh.has(t)?{icon:tt,name:`code-file`}:zh.has(t)?{icon:at,name:`document-file`}:{icon:st,name:`file`}}function Hh(e,t){return e===`skill`?{icon:Tt,name:`skill`}:e===`panel_app`?{icon:Fe,name:`panel-app`}:e===`ui_resource`?t.startsWith(`nextclaw://panel-app`)?{icon:Fe,name:`panel-app`}:t.startsWith(`nextclaw://docs`)?{icon:ze,name:`docs`}:t.startsWith(`nextclaw://apps`)?{icon:Re,name:`apps`}:{icon:Xe,name:`web-resource`}:e===`project`?{icon:lt,name:`project`}:e===`workspace_directory`?{icon:dt,name:`directory`}:e===`workspace_excerpt`?{icon:Ot,name:`excerpt`}:e===`conversation_excerpt`?{icon:_t,name:`conversation-excerpt`}:e===`workspace_file`||e===`file`?Vh(t):{icon:pt,name:`reference`}}function Uh({className:e,kind:t,source:n}){let r=Hh(t,n??``),i=r.icon;return(0,A.jsx)(i,{"aria-hidden":`true`,className:j(`h-3 w-3`,e),"data-reference-icon":r.name})}function Wh(e){return Array.from(e).length}function Gh(e){let{characterCountTemplate:t,endLine:n,excerpt:r,startLine:i}=e,a=i?i===n||!n?`L${i}`:`L${i}–${n}`:null,o=t?.replace(`{count}`,String(Wh(r)));return{characterCountLabel:o,location:a,metricLabel:a??o}}function Kh({excerpt:e,kind:t,label:n,metricLabel:r,source:i}){let a=e?.replace(/\s+/g,` `).trim()??``,o=Array.from(a),s=o.length>64?`${o.slice(0,64).join(``).trimEnd()}…`:a;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground`,"data-reference-kind":t,children:(0,A.jsx)(Uh,{kind:t,source:i??n})}),(0,A.jsx)(`span`,{className:e?`max-w-[10rem] shrink truncate`:`max-w-[16rem] truncate`,children:n}),r?(0,A.jsx)(`span`,{className:`shrink-0 text-[10px] font-normal text-muted-foreground`,children:r}):null,s?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-muted-foreground/60`,children:`·`}),(0,A.jsx)(`span`,{className:`min-w-[3rem] max-w-[14rem] truncate font-normal text-foreground/70`,children:s})]}):null]})}function qh({children:e,characterCountLabel:t,excerpt:n,kind:r=`workspace_file`,label:i,location:a,path:o}){let{Tooltip:s,TooltipContent:c,TooltipProvider:l,TooltipTrigger:u}=Ki;return(0,A.jsx)(l,{delayDuration:300,children:(0,A.jsxs)(s,{children:[(0,A.jsx)(u,{asChild:!0,children:e}),(0,A.jsxs)(c,{side:`top`,align:`start`,collisionPadding:12,className:`w-fit min-w-[min(14rem,calc(100vw-1.5rem))] max-w-[min(28rem,calc(100vw-1.5rem))] p-0 text-left`,children:[(0,A.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 border-b border-border/70 px-3 py-2`,children:[(0,A.jsx)(Uh,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,kind:r,source:o??i}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:o||i}),a?(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:a}):null,t?(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:t}):null]}),(0,A.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] font-normal leading-5 text-popover-foreground`,children:n})]})]})})}var Jh=(0,k.createContext)({});function Yh({children:e,excerptCharacterCountTemplate:t,removeTokenLabel:n}){return(0,A.jsx)(Jh.Provider,{value:{excerptCharacterCountTemplate:t,removeTokenLabel:n},children:e})}function Xh(e){let t=[`selection:bg-transparent`,`selection:text-current`,`group/composer-token`,`data-[composer-selected=true]:shadow-[0_0_0_2px_var(--interaction-selection,Highlight)]`];return e===`file`?[`mx-[2px] inline-flex h-6 items-center gap-1.5 rounded-[7px] border px-1.5 align-middle leading-none`,...t,`max-w-[min(100%,17rem)]`,`border-border`,`bg-muted`,`text-foreground`].join(` `):[jh,...t].join(` `)}function Zh({data:e,label:t}){let{excerptCharacterCountTemplate:n}=(0,k.useContext)(Jh),r=typeof e?.excerpt==`string`?e.excerpt:``,i=typeof e?.path==`string`?e.path:null,a=typeof e?.startLine==`number`?e.startLine:null,{characterCountLabel:o,location:s,metricLabel:c}=Gh({characterCountTemplate:n,endLine:typeof e?.endLine==`number`?e.endLine:null,excerpt:r,startLine:a}),l=(0,A.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:(0,A.jsx)(Kh,{excerpt:r,kind:`workspace_excerpt`,label:t,metricLabel:c,source:i})});return r?(0,A.jsx)(qh,{excerpt:r,characterCountLabel:o,label:t,location:s,path:i,children:l}):l}function Qh({data:e,label:t}){let n=typeof e?.excerpt==`string`?e.excerpt:``,r=(0,A.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:(0,A.jsx)(Kh,{excerpt:n,kind:`conversation_excerpt`,label:t})});return n?(0,A.jsx)(qh,{excerpt:n,kind:`conversation_excerpt`,label:t,children:r}):r}function $h({children:e,onRemove:t}){let{removeTokenLabel:n}=(0,k.useContext)(Jh),[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(!1);if(!n)return e;let s=r||a,{Tooltip:c,TooltipContent:l,TooltipProvider:u,TooltipTrigger:d}=Ki;return(0,A.jsxs)(`span`,{className:`relative -mx-1.5 inline-flex h-full min-w-0 items-center px-1.5`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)},onFocus:()=>i(!0),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,A.jsx)(`span`,{className:`inline-flex h-full min-w-0 items-center gap-1.5 ${s?`[mask-image:linear-gradient(to_right,black_calc(100%_-_2.5rem),transparent_calc(100%_-_1.25rem))] [-webkit-mask-image:linear-gradient(to_right,black_calc(100%_-_2.5rem),transparent_calc(100%_-_1.25rem))]`:``}`,"data-composer-token-content":`true`,children:e}),(0,A.jsx)(u,{delayDuration:300,children:(0,A.jsxs)(c,{children:[(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":n,className:`${s?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`} absolute right-0.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full border border-border/70 bg-transparent text-muted-foreground transition-[background-color,border-color,color,opacity] hover:border-border hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},children:(0,A.jsx)(Me,{"aria-hidden":`true`,className:`h-3 w-3`})})}),(0,A.jsx)(l,{side:`top`,className:`text-xs`,children:n})]})})]})}function eg({data:e,label:t,onRemove:n,previewUrl:r,tokenKey:i,tokenKind:a}){let[o,s]=(0,k.useState)(!1),c;if(a===`workspace_excerpt`)c=(0,A.jsx)(Zh,{data:e,label:t});else if(a===`conversation_excerpt`)c=(0,A.jsx)(Qh,{data:e,label:t});else if(a!==`file`){let n=e?.reference&&typeof e.reference==`object`?e.reference:null;c=(0,A.jsx)(Kh,{kind:a,label:t,source:typeof e?.path==`string`?e.path:a===`ui_resource`&&typeof n?.uri==`string`?n.uri:i})}else c=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`relative inline-flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden rounded-[4px] bg-card text-muted-foreground ring-1 ring-border`,children:[(0,A.jsx)(Uh,{className:`h-3 w-3`,kind:`file`,source:t}),r&&!o?(0,A.jsx)(`img`,{alt:``,className:`absolute inset-0 h-full w-full object-cover`,onError:()=>s(!0),src:r}):null]}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] font-medium text-foreground`,children:t})]});return(0,A.jsx)($h,{onRemove:n,children:c})}var tg=class e extends Au{static getType(){return`chat-composer-token`}static clone(t){return new e(t.__composerId,t.__tokenKind,t.__tokenKey,t.__label,t.__previewUrl,t.__data,t.__key)}static importJSON(e){return ng({composerId:e.composerId,data:e.data,label:e.label,previewUrl:e.previewUrl,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}constructor(e,t,n,r,i,a,o){super(o),this.applyTokenDom=e=>{e.contentEditable=`false`,e.dataset.composerNodeId=this.__composerId,e.dataset.composerNodeType=`token`,e.dataset.composerTokenKind=this.__tokenKind,e.dataset.composerTokenKey=this.__tokenKey,e.dataset.composerLabel=this.__label,this.__tokenKind===`workspace_excerpt`||this.__tokenKind===`conversation_excerpt`?e.removeAttribute(`title`):e.title=this.__label,e.className=Xh(this.__tokenKind)},this.createDOM=(e,t)=>{let n=document.createElement(`span`);return this.applyTokenDom(n),n},this.updateDOM=(e,t)=>(this.applyTokenDom(t),!1),this.decorate=e=>{let t=this.getKey();return(0,A.jsx)(eg,{data:this.__data,label:this.__label,onRemove:()=>{e.update(()=>{let e=yd(t);rg(e)&&(e.selectNext(),e.remove())}),e.focus()},previewUrl:this.__previewUrl,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind})},this.exportJSON=()=>({composerId:this.__composerId,data:this.__data,label:this.__label,previewUrl:this.__previewUrl,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind,type:`chat-composer-token`,version:1}),this.getComposerId=()=>this.getLatest().__composerId,this.getTokenKind=()=>this.getLatest().__tokenKind,this.getTokenKey=()=>this.getLatest().__tokenKey,this.getLabel=()=>this.getLatest().__label,this.getPreviewUrl=()=>this.getLatest().__previewUrl,this.getData=()=>this.getLatest().__data,this.getTextContent=()=>``,this.isInline=()=>!0,this.isIsolated=()=>!0,this.isKeyboardSelectable=()=>!1,this.__composerId=e,this.__tokenKind=t,this.__tokenKey=n,this.__label=r,this.__previewUrl=i,this.__data=a}};function ng(e){let{composerId:t,data:n,label:r,previewUrl:i,tokenKey:a,tokenKind:o}=e;return of(new tg(t,o,a,r,i,n))}function rg(e){return e instanceof tg}function ig(e,t){let n=t.selection?.start??0,r=t.selection?.end??0,i=new Set,a=0;for(let e of t.nodes){let t=e.type===`text`?e.text.length:1;e.type===`token`&&n<a+t&&r>a&&i.add(e.id),a+=t}e.querySelectorAll(`[data-composer-node-type="token"]`).forEach(e=>{let t=i.has(e.dataset.composerNodeId??``);if(e.dataset.composerSelected!==String(t)){if(e.dataset.composerSelected=String(t),t){e.style.setProperty(`background-color`,`var(--interaction-selection)`,`important`),e.style.setProperty(`border-color`,`var(--interaction-selection-border)`,`important`);return}e.style.removeProperty(`background-color`),e.style.removeProperty(`border-color`)}})}var ag=`nextclaw-chat-composer-external-update`;function og(){let e=Td(),t=e.getFirstChild();if(!L(t))return{descriptors:[],paragraphKey:e.getKey(),paragraphSize:0,totalLength:0};let n=t.getChildren(),r=[],i=0;for(let[e,t]of n.entries()){if(P(t)){let n=t.getTextContent();r.push({index:e,key:t.getKey(),length:n.length,node:t,start:i,text:n,type:`text`}),i+=n.length;continue}if(rg(t)){r.push({index:e,key:t.getKey(),length:1,node:t,start:i,type:`token`}),i+=1;continue}r.push({index:e,key:t.getKey(),length:t.getTextContent().length,node:t,start:i,type:`linebreak`}),i+=t.getTextContent().length}return{descriptors:r,paragraphKey:t.getKey(),paragraphSize:n.length,totalLength:i}}function sg(e){let{descriptors:t,paragraphKey:n,paragraphSize:r,totalLength:i}=og(),a=Math.max(0,Math.min(e,i));if(t.length===0)return{key:n,offset:0,type:`element`};for(let e of t){let r=e.start+e.length;if(e.type===`text`&&a>=e.start&&a<=r)return{key:e.key,offset:a-e.start,type:`text`};if(e.type!==`text`){if(a===e.start)return{key:n,offset:e.index,type:`element`};if(a===r){let r=t[e.index+1];return r?.type===`text`&&r.length===0?{key:r.key,offset:0,type:`text`}:{key:n,offset:e.index+1,type:`element`}}}}return{key:n,offset:r,type:`element`}}function cg(e){let{descriptors:t,paragraphKey:n,totalLength:r}=og();if(e.key===n){let n=t[e.offset-1];return n?n.start+n.length:0}let i=t.find(t=>t.key===e.key);return i?i.start+Math.min(e.offset,i.length):r}function lg(e){if(e.type===`element`)return cg(e);let{descriptors:t,totalLength:n}=og(),r=t.find(t=>t.key===e.key);return r?r.start+Math.min(e.offset,r.length):n}function ug(){let{descriptors:e}=og(),t=[],n=``,r=``,i=()=>{n.length!==0&&(t.push({id:r,type:`text`,text:n}),n=``,r=``)};for(let a of e){if(a.type===`text`){n.length===0&&(r=a.key),n+=a.text;continue}if(a.type===`linebreak`){n.length===0&&(r=a.key),n+=`
18
+ `;continue}i();let e=a.node;t.push({id:e.getComposerId(),data:e.getData(),label:e.getLabel(),previewUrl:e.getPreviewUrl(),tokenKey:e.getTokenKey(),tokenKind:e.getTokenKind(),type:`token`})}return i(),An(t)}function dg(e){return e.read(()=>{let e=I(),t=ug();return F(e)?{nodes:t,selection:{start:Math.min(lg(e.anchor),lg(e.focus)),end:Math.max(lg(e.anchor),lg(e.focus))}}:{nodes:t,selection:null}})}function fg(e){let t=I();if(!F(t))return!1;let n=[];for(let t of e){if(t.type===`token`){n.push(ng({composerId:t.id,data:t.data,label:t.label,previewUrl:t.previewUrl,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
19
+ `);for(let[t,r]of e.entries())r&&n.push(bl(r)),t<e.length-1&&n.push(nl())}return n.length===0?!1:(t.insertNodes(n),!0)}function pg(e,t){let n=Td();n.clear();let r=Hu();n.append(r);for(let t of An(e)){if(t.type===`token`){r.append(ng({composerId:t.id,data:t.data,label:t.label,previewUrl:t.previewUrl,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
20
+ `);for(let[t,n]of e.entries())n.length>0&&r.append(bl(n)),t<e.length-1&&r.append(nl())}if(rg(r.getLastChild())&&r.append(bl(``)),!t)return;let i=Hl(),a=sg(t.start),o=sg(t.end);i.anchor.set(a.key,a.offset,a.type),i.focus.set(o.key,o.offset,o.type),Dd(i)}function mg(e,t,n,r=!1,i){e.update(()=>{if(pg(t,n),i?.range){let{start:e,end:t}=i.range;for(let n of og().descriptors){if(!P(n.node)||n.start>=t||n.start+n.length<=e)continue;let r=Math.max(0,e-n.start),i=Math.min(n.length,t-n.start);n.node.splitText(r,i)[r>0?1:0]?.setStyle(`text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px`)}}},{...i?{discrete:!0}:{},tag:r?[ag,Zc]:ag})}function hg(e,t,n=!1){e.update(()=>{let e=Hl(),n=sg(t.start),r=sg(t.end);e.anchor.set(n.key,n.offset,n.type),e.focus.set(r.key,r.offset,r.type),Dd(e)},{tag:n?[ag,Zc]:ag})}function gg(e){return e.reduce((e,t)=>e+Dn(t),0)}function _g(e){let{data:t,label:n,nodes:r,previewUrl:i,selection:a,tokenKey:o,tokenKind:s,trigger:c}=e,l=gg(r),[u,d]=a?[Math.min(a.start,a.end),Math.max(a.start,a.end)]:[l,l],f=c?.start??u;return{nodes:zn(r,f,c?.end??d,[En({label:n,data:t,previewUrl:i,tokenKey:o,tokenKind:s})]),selection:{start:f+1,end:f+1}}}function vg(e){let{data:t,label:n,nodes:r,selection:i,tokenKey:a,tokenKind:o,triggerSpecs:s}=e;return Nn(r,o).includes(a)?{nodes:An(r),selection:i}:_g({label:n,data:t,nodes:r,selection:i,tokenKey:a,tokenKind:o,trigger:Un(r,i,s??[Cn])})}function yg(e){let{item:t,nodes:n,selection:r,triggerSpecs:i}=e,a=t.tokenKind??(t.value?`skill`:void 0),o=t.tokenKey??t.value;if(!a||!o){let e=Un(n,r,i??[Cn]);return e?{nodes:An(zn(n,e.start,e.end,[])),selection:{start:e.start,end:e.start}}:{nodes:An(n),selection:r}}return vg({data:t.data,label:t.title,nodes:n,selection:r,tokenKey:o,tokenKind:a,triggerSpecs:i})}function bg(e){return e.map(e=>e.type===`text`?`text:${e.text}`:`token:${e.tokenKind}:${e.tokenKey}:${e.label}:${e.previewUrl??``}:${JSON.stringify(e.data??null)}`).join(``)}function xg(e){let{nodes:t,selection:n,text:r}=e,i=gg(t),[a,o]=n?[Math.min(n.start,n.end),Math.max(n.start,n.end)]:[i,i],s=a+r.length;return{nodes:zn(t,a,o,[Tn(r)]),selection:{start:s,end:s}}}function Sg(e){let{label:t,nodes:n,previewUrl:r,selection:i,tokenKey:a}=e;return _g({label:t,nodes:n,previewUrl:r,selection:i,tokenKey:a,tokenKind:`file`})}function Cg(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return Nn(n,`skill`).includes(i)?{nodes:An(n),selection:r}:_g({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`skill`,trigger:Wn(n,r)})}function wg(e){let{nextKeys:t,nodes:n,options:r,selection:i}=e,a=Nn(n,`skill`),o=new Map(r.map(e=>[e.key,e])),s=t.find(e=>!a.includes(e));if(s)return Cg({label:o.get(s)?.label??s,nodes:n,selection:i,tokenKey:s});let c=a.find(e=>!t.includes(e));return c?{nodes:Bn(n,e=>e.tokenKind===`skill`&&e.tokenKey===c),selection:i}:{nodes:An(n),selection:i}}function Tg(e){if(e.key!==`Backspace`&&e.key!==`Delete`)return!1;let t=I();if(F(t)&&!t.isCollapsed())return!1;let n=null;if(F(t)){let{anchor:r}=t,i=r.getNode();if(r.type===`element`&&L(i)){let t=e.key===`Backspace`?r.offset-1:r.offset;n=i.getChildAtIndex(t)}else e.key===`Backspace`&&r.offset===0?n=i.getPreviousSibling():e.key===`Delete`&&r.offset===i.getTextContentSize()&&(n=i.getNextSibling())}else if(e.key===`Backspace`){let e=Td().getFirstChild();n=L(e)?e.getLastChild():null}return P(n)&&n.getTextContentSize()===0&&(n=e.key===`Backspace`?n.getPreviousSibling():n.getNextSibling()),rg(n)?(e.preventDefault(),n.remove(),!0):!1}function Eg(e){let{canStopGeneration:t,isComposing:n,isSending:r,key:i,metaKey:a=!1,ctrlKey:o=!1,shiftKey:s}=e;return n?{type:`noop`}:i===`Escape`?r&&t?{type:`stop-generation`}:{type:`noop`}:i===`Enter`&&!s?a||o?{type:`send-alternate`}:{type:`send-message`}:{type:`noop`}}function Dg(e){let{actions:t,isComposing:n,nativeEvent:r}=e,i=Eg({canStopGeneration:t.canStopGeneration,isComposing:n,isSending:t.isSending,key:r.key,metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey});switch(i.type!==`noop`&&r.preventDefault(),i.type){case`stop-generation`:return t.onStop(),!0;case`send-message`:return t.onSend(),!0;case`send-alternate`:return(t.onAlternateSend??t.onSend)(),!0;case`noop`:return!1}}var Og=`application/x-nextclaw-chat-composer+json`,kg=1,Ag=1e6,jg=1e3,Mg=1e5;function Ng(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Pg(e){return typeof e==`string`&&e.length>0&&e.length<=Mg?e:null}function Fg(e){return e===void 0?void 0:typeof e==`string`&&e.length<=Mg?e:null}function Ig(e){return En({data:e.data,label:e.label,previewUrl:e.previewUrl,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}function Lg(e,t,n){let r=Math.max(0,Math.min(t,n)),i=Math.max(r,Math.max(t,n)),a=[],o=0;for(let t of e){let e=o,n=e+Dn(t);if(o=n,n<=r||e>=i)continue;if(t.type===`token`){a.push(Ig(t));continue}let s=Math.max(0,r-e),c=Math.min(t.text.length,i-e);c>s&&a.push(Tn(t.text.slice(s,c)))}return a.length>0?An(a):[]}function Rg(e){return e.type===`text`?{type:`text`,text:e.text}:{type:`token`,tokenKind:e.tokenKind,tokenKey:e.tokenKey,label:e.label,previewUrl:e.previewUrl,data:e.data}}function zg(e){let t={version:kg,nodes:e.map(Rg)};return JSON.stringify(t)}function Bg(e){if(!Ng(e))return null;if(e.type===`text`){let t=Fg(e.text);return typeof t==`string`?Tn(t):null}if(e.type!==`token`)return null;let t=Pg(e.tokenKind),n=Pg(e.tokenKey),r=Pg(e.label),i=Fg(e.previewUrl),a=e.data===void 0?void 0:Ng(e.data)?e.data:null;return!t||!n||!r||i===null||a===null?null:En({data:a,label:r,previewUrl:i,tokenKey:n,tokenKind:t})}function Vg(e){if(!e||e.length>Ag)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Ng(t)||t.version!==kg||!Array.isArray(t.nodes)||t.nodes.length===0||t.nodes.length>jg)return null;let n=[];for(let e of t.nodes){let t=Bg(e);if(!t)return null;n.push(t)}return An(n)}function Hg(e){if(e.tokenKind!==`workspace_excerpt`||typeof e.data?.excerpt!=`string`)return null;let t=typeof e.data.startLine==`number`?e.data.startLine:null,n=typeof e.data.endLine==`number`?e.data.endLine:null,r=t?t===n||!n?` L${t}`:` L${t}–${n}`:``;return`[${e.label}${r}]\n${e.data.excerpt}`}function Ug(e){return e.tokenKind===`conversation_excerpt`&&typeof e.data?.excerpt==`string`?`[${e.label}]\n${e.data.excerpt}`:null}function Wg(e){return e.map(e=>e.type===`text`?e.text:Hg(e)??Ug(e)??`@${e.label}`).join(``)}function Gg(e){return!!(e&&`clipboardData`in e)}var Kg=class{constructor(e){this.editor=e,this.register=()=>Op(this.editor.registerCommand(oc,e=>this.handleCopy(e,!1),3),this.editor.registerCommand(sc,e=>this.handleCopy(e,!0),3),this.editor.registerCommand(Is,this.handlePaste,3)),this.handleCopy=(e,t)=>{if(!Gg(e)||!e.clipboardData)return!1;let n=dg(this.editor.getEditorState());if(!n.selection||n.selection.start===n.selection.end)return!1;let r=Lg(n.nodes,n.selection.start,n.selection.end);if(!r.some(e=>e.type===`token`))return!1;try{e.clipboardData.setData(`text/plain`,Wg(r)),e.clipboardData.setData(Og,zg(r))}catch{return e.preventDefault(),!0}if(e.preventDefault(),t){let e=I();F(e)&&e.removeText()}return!0},this.handlePaste=e=>{if(!Gg(e))return!1;let t=e.clipboardData?.getData(Og);if(!t)return!1;let n=Vg(t);return!n||!fg(n)?!1:(e.preventDefault(),!0)}}},qg=class{constructor(e,t,n,r){this.composer=e,this.onInterrupt=r,this.active=!0,this.text=``,this.isActive=()=>this.active,this.update=(e,t=``)=>this.write(e,t,!0),this.write=(e,t,n)=>{if(!this.active)return;let r=e+(e&&t?` `:``)+t;this.text=r;let i=r?xg({...this.original,text:r}):this.original,a=i.selection?.end??0;this.composer.publishSnapshot(i,this.callbacks,{preview:n,dictation:{range:t?{start:a-t.length,end:a}:null}})},this.commit=e=>{this.active&&(this.write(e??this.text,``,!1),this.active=!1,this.cleanup())},this.cancel=()=>{this.active&&(this.active=!1,this.cleanup(),this.composer.publishSnapshot(this.original,this.callbacks,{dictation:{range:null}}))},this.interrupt=()=>{this.active&&(this.commit(),this.onInterrupt())},this.abandon=()=>{this.active&&(this.active=!1,this.cleanup(),this.onInterrupt())},this.listen=e=>{let t=e=>{if(!(e.repeat||[`Alt`,`Control`,`Meta`,`Shift`].includes(e.key))){if(e.key===`Escape`){this.cancel(),this.onInterrupt(),e.preventDefault(),e.stopPropagation();return}this.interrupt(),e.key===`Enter`&&(e.preventDefault(),e.stopPropagation())}};e?.addEventListener(`keydown`,t,!0);let n=[`beforeinput`,`compositionstart`,`paste`,`cut`,`pointerdown`,`drop`];return n.forEach(t=>e?.addEventListener(t,this.interrupt,!0)),()=>{e?.removeEventListener(`keydown`,t,!0),n.forEach(t=>e?.removeEventListener(t,this.interrupt,!0))}};let i=e.selectionRef.current;this.original=e.readComposerSnapshot(n.fallbackNodes),this.original.selection??=i,this.callbacks=n.callbacks,this.cleanup=this.listen(t.getRootElement())}},Jg=class{constructor(){this.revision=0,this.pendingState=null,this.deferWhileComposing=(e,t,n)=>{let r=this.revision+1;return this.revision=r,e.isComposing()?(this.pendingState=bg(t)===n?null:{nodes:[...t],revision:r},!0):(this.pendingState=null,!1)},this.flushAfterCompositionEnd=(e,t,n)=>{let r=e?this.pendingState:null;return r?(this.pendingState=null,queueMicrotask(()=>{!t||this.revision!==r.revision||n(t,r.nodes)}),!0):!1},this.reset=()=>{this.revision+=1,this.pendingState=null}}};function Yg(e){return{current:e}}var Xg=class{constructor(){this.dictation=null,this.pendingOwnerSignatureRef=Yg(null),this.pendingSelectionRef=Yg(null),this.selectionRef=Yg(null),this.shouldFocusAfterSyncRef=Yg(!1),this.editorSignatureRef=Yg(``),this.externalStateOwner=new Jg,this.lastPublishedSignatureRef=Yg(``),this.pendingInputSurfaceReasonRef=Yg(null),this.editor=null,this.runtime=null,this.configureRuntime=e=>{this.runtime=e},this.bindEditor=e=>{this.editor=e;let t=bg(dg(e.getEditorState()).nodes);return this.editorSignatureRef.current=t,this.lastPublishedSignatureRef.current=t,()=>{this.editor===e&&(this.dictation?.cancel(),this.externalStateOwner.reset(),this.editor=null)}},this.registerEditorListeners=e=>Op(e.registerUpdateListener(({editorState:e,tags:t})=>{let n=this.getRuntime();this.handleEditorUpdate(e,n.callbacks,t)}),e.registerCommand(Es,()=>{let t=this.getRuntime();return this.handleSelectionChange(e,t.callbacks),!1},0),e.registerCommand(uc,()=>(this.getRuntime().callbacks.onInputSurfaceOpenChange?.(!1),!1),0),e.registerCommand(Us,e=>{let t=this.getRuntime();return this.handleKeyDown({actions:t.actions,callbacks:t.callbacks,event:e})},3),new Kg(e).register()),this.syncExternalState=(e,t)=>{if(this.externalStateOwner.deferWhileComposing(e,t,this.editorSignatureRef.current))return;let n=bg(t);this.dictation?.isActive()&&n!==this.editorSignatureRef.current&&n!==this.lastPublishedSignatureRef.current&&(this.dictation.abandon(),this.pendingOwnerSignatureRef.current=null);let r=this.pendingSelectionRef.current,i=this.pendingOwnerSignatureRef.current;if(i){if(n===i)this.pendingOwnerSignatureRef.current=null;else if(n!==this.editorSignatureRef.current)return}let a=n!==this.editorSignatureRef.current;if(!a&&!r)return;let o=e.getRootElement()!==document.activeElement;if(a?(this.dictation?.abandon(),this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,mg(e,t,r,o)):r&&hg(e,r,o),r&&(this.selectionRef.current=r,this.pendingSelectionRef.current=null),this.shouldFocusAfterSyncRef.current){this.shouldFocusAfterSyncRef.current=!1;let t=this.selectionRef.current;e.focus(()=>{t&&hg(e,t)})}},this.publishSnapshot=(e,t,{dictation:n,preview:r,focusAfterSync:i,inputSurfaceReason:a={type:`programmatic`}}={})=>{this.selectionRef.current=e.selection,this.pendingSelectionRef.current=e.selection,i&&(this.shouldFocusAfterSyncRef.current=!0);let o=bg(e.nodes),{editor:s}=this;if(this.pendingOwnerSignatureRef.current=o,s){this.editorSignatureRef.current=o;let t=s.getRootElement()!==document.activeElement;mg(s,e.nodes,e.selection,t,n)}r||(t.onInputSurfaceSnapshotChange?.(e.nodes,e.selection,a),o!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=o,t.onNodesChange(e.nodes)))},this.focusComposer=()=>{let{editor:e}=this;if(!e)return;e.getRootElement()?.focus({preventScroll:!0});let t=this.selectionRef.current;t&&hg(e,t),e.focus()},this.focusComposerAtEnd=e=>{let{editor:t}=this;if(!t)return;let n=e??dg(t.getEditorState()).nodes,r=gg(n),i={start:r,end:r};if(this.selectionRef.current=i,t.getRootElement()?.focus({preventScroll:!0}),e){let n=bg(e);this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,mg(t,e,i)}else hg(t,i);t.focus(()=>{let e=this.selectionRef.current;bg(dg(t.getEditorState()).nodes)!==bg(n)||e?.start!==i.start||e?.end!==i.end||hg(t,i)})},this.readComposerSnapshot=e=>{let{editor:t}=this;if(!t)return{nodes:e,selection:this.selectionRef.current};let n=dg(t.getEditorState());return this.selectionRef.current=n.selection,n},this.createHandle=()=>{let e=(e,t=[Cn])=>{let{callbacks:n}=this.getRuntime();n.onInputSurfaceItemSelect?.(e),this.publishRuntimeSnapshot(n=>yg({item:e,nodes:n.nodes,selection:n.selection,triggerSpecs:t}),{focusAfterSync:!0})};return{beginDictation:e=>!this.editor||this.editor.isComposing()?null:(this.dictation?.cancel(),this.dictation=new qg(this,this.editor,this.getRuntime(),e),this.dictation),insertToken:e=>{this.publishRuntimeSnapshot(t=>vg({data:e.data,label:e.label,nodes:t.nodes,selection:t.selection,tokenKey:e.tokenKey,tokenKind:e.tokenKind,triggerSpecs:[]}),{focusAfterSync:!0})},insertInputSurfaceItem:e,insertSlashItem:t=>{e(t)},insertFileToken:(e,t,n)=>{this.publishRuntimeSnapshot(r=>Sg({label:t,nodes:r.nodes,previewUrl:n,selection:r.selection,tokenKey:e}),{focusAfterSync:!0})},insertFileTokens:e=>{this.publishRuntimeSnapshot(t=>e.reduce((e,t)=>Sg({label:t.label,nodes:e.nodes,previewUrl:t.previewUrl,selection:e.selection,tokenKey:t.tokenKey}),t),{focusAfterSync:!0})},focusComposer:this.focusComposer,focusComposerAtEnd:this.focusComposerAtEnd,syncSelectedSkills:(e,t)=>{this.publishRuntimeSnapshot(n=>wg({nextKeys:e,nodes:n.nodes,options:t,selection:n.selection}),{})}}},this.handleKeyDown=e=>{let{actions:t,callbacks:n,event:r}=e,i=r.isComposing||(this.editor?.isComposing()??!1);return r.key.length===1&&!i&&!r.altKey&&!r.ctrlKey&&!r.metaKey?this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:r.key}:!i&&(r.key===`Backspace`||r.key===`Delete`)?this.pendingInputSurfaceReasonRef.current={type:`delete-content`}:!i&&r.key===`Enter`&&r.shiftKey&&(this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:`
21
+ `}),n.onInputSurfaceKeyDown?.(r)?(this.pendingInputSurfaceReasonRef.current=null,!0):!i&&Tg(r)?!0:Dg({actions:t,isComposing:i,nativeEvent:r})},this.handleEditorUpdate=(e,t,n)=>{if(this.dictation?.isActive())return;let r=dg(e),i=this.editor?.getRootElement();i&&ig(i,r);let a=bg(r.nodes),o=this.editorSignatureRef.current;this.editorSignatureRef.current=a,!this.externalStateOwner.flushAfterCompositionEnd(n.has(`composition-end`),this.editor,this.syncExternalState)&&(n.has(`nextclaw-chat-composer-external-update`)&&a===o||this.editor?.isComposing()&&!n.has(`composition-end`)||(this.selectionRef.current=r.selection,t.onInputSurfaceSnapshotChange?.(r.nodes,r.selection,this.consumeInputSurfaceReason()??{type:`sync`}),a!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=a,t.onNodesChange(r.nodes))))},this.handleSelectionChange=(e,t)=>{if(this.dictation?.isActive())return;let n=dg(e.getEditorState()),r=e.getRootElement();r&&ig(r,n),!e.isComposing()&&(this.selectionRef.current=n.selection,t.onInputSurfaceSnapshotChange?.(n.nodes,n.selection,{type:`selection`}))},this.consumeInputSurfaceReason=()=>{let e=this.pendingInputSurfaceReasonRef.current;return this.pendingInputSurfaceReasonRef.current=null,e},this.publishRuntimeSnapshot=(e,t)=>{this.dictation?.interrupt();let{callbacks:n,fallbackNodes:r}=this.getRuntime();this.publishSnapshot(e(this.readComposerSnapshot(r)),n,t)},this.getRuntime=()=>{if(!this.runtime)throw Error(`ChatComposerLexicalOwner runtime has not been configured.`);return this.runtime}}};function Zg({disabled:e,nodes:t,owner:n}){let[r]=Ba();return(0,k.useLayoutEffect)(()=>n.bindEditor(r),[r,n]),(0,k.useLayoutEffect)(()=>{r.setEditable(!e),n.syncExternalState(r,t)},[e,r,t,n]),(0,k.useEffect)(()=>n.registerEditorListeners(r),[r,n]),null}var Qg=(0,k.forwardRef)(function({actions:e,disabled:t,nodes:n,excerptCharacterCountTemplate:r,onFilesAdd:i,onInputSurfaceItemSelect:a,onInputSurfaceKeyDown:o,onInputSurfaceOpenChange:s,onInputSurfaceSnapshotChange:c,onNodesChange:l,placeholder:u,removeTokenLabel:d},f){let[p]=(0,k.useState)(()=>new Xg),m=(0,k.useMemo)(()=>({onInputSurfaceItemSelect:a,onInputSurfaceKeyDown:o,onInputSurfaceOpenChange:s,onInputSurfaceSnapshotChange:c,onNodesChange:l}),[a,o,s,c,l]);return p.configureRuntime({actions:e,callbacks:m,fallbackNodes:n}),(0,k.useImperativeHandle)(f,()=>p.createHandle(),[p]),(0,A.jsx)(tm,{initialConfig:(0,k.useMemo)(()=>({editable:!t,editorState:()=>{pg(n,null)},namespace:`NextClawChatComposerLexical`,nodes:[tg],onError:e=>{throw e},theme:{}}),[t,n]),children:(0,A.jsxs)(Yh,{excerptCharacterCountTemplate:r,removeTokenLabel:d,children:[(0,A.jsx)(`div`,{className:`px-3 py-2 sm:px-4 sm:py-2.5`,children:(0,A.jsx)(`div`,{className:`min-h-7 md:min-h-[60px]`,children:(0,A.jsx)(kh,{contentEditable:(0,A.jsx)(Yp,{className:`nextclaw-chat-composer min-h-7 max-h-[min(188px,35dvh)] w-full overflow-y-auto overscroll-contain whitespace-pre-wrap break-words bg-transparent py-0.5 text-base md:text-sm leading-6 text-foreground outline-none selection:bg-[var(--interaction-selection,Highlight)] selection:text-current`,onPaste:e=>{let t=Array.from(e.clipboardData.files??[]);t.length>0&&i&&(e.preventDefault(),i(t))}}),placeholder:(0,A.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-2 select-none text-sm leading-6 text-muted-foreground/60 sm:left-4 sm:top-2.5`,children:u}),ErrorBoundary:om})})}),(0,A.jsx)(Zg,{disabled:t,nodes:n,owner:p})]})})});Qg.displayName=`LexicalChatInputBarTokenizedComposer`;var $g=120;function e_(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=$g?t:`${t.slice(0,$g-1)}…`}function t_({hint:e}){return e?e.loading?(0,A.jsx)(`div`,{className:`px-4 pb-2`,children:(0,A.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`h-3 w-28 animate-pulse rounded bg-muted-foreground/20`}),(0,A.jsx)(`span`,{className:`h-3 w-16 animate-pulse rounded bg-muted-foreground/20`})]})}):(0,A.jsx)(`div`,{className:`px-4 pb-2`,children:(0,A.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs ${e.tone===`warning`?`border-amber-200 bg-amber-50 text-amber-800`:`border-border bg-muted text-muted-foreground`}`,children:[e.text?(0,A.jsx)(`span`,{children:e.text}):null,e.actionLabel&&e.onAction?(0,A.jsx)(`button`,{type:`button`,onClick:e.onAction,className:`font-semibold underline-offset-2 hover:underline`,children:e.actionLabel}):null]})}):null}function n_({sendError:e,sendErrorDetailsLabel:t}){let n=e?.trim()??``;if(!n)return null;let{Popover:r,PopoverContent:i,PopoverTrigger:a}=Ki,o=e_(n),s=t?.trim()||`Details`;return(0,A.jsx)(`div`,{className:`px-3 pb-2 sm:px-4`,children:(0,A.jsxs)(`div`,{"aria-live":`polite`,className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2 text-xs text-red-700`,role:`status`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate leading-5`,title:n,children:o}),(0,A.jsxs)(r,{children:[(0,A.jsx)(a,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`inline-flex h-7 shrink-0 items-center rounded-md border border-red-200/80 bg-background px-2 text-xs font-medium text-red-700 transition-colors hover:bg-red-100`,children:s})}),(0,A.jsxs)(i,{align:`end`,className:`w-[min(32rem,calc(100vw-1.5rem))] border-red-100/80 p-0`,children:[(0,A.jsx)(`div`,{className:`border-b border-red-100 bg-red-50/80 px-4 py-2 text-xs font-semibold text-red-700`,children:s}),(0,A.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words px-4 py-3 text-xs leading-relaxed text-red-700`,children:n})]})]})]})})}var r_=(0,k.forwardRef)(function({composer:e,hint:t,inputSurface:n,sendError:r,sendErrorDetailsLabel:i,slashMenu:a,surface:o,toolbar:s,topSlot:c,floatingSlot:l},u){let d=(0,k.useRef)(null),{Popover:f,PopoverAnchor:p,PopoverContent:m}=Ki,h=n??(a?{isLoading:a.isLoading,filterOptions:a.filterOptions,items:a.items,onSelectItem:a.onSelectItem,texts:{loadingLabel:a.texts.slashLoadingLabel,sectionLabel:a.texts.slashSectionLabel,emptyLabel:a.texts.slashEmptyLabel,hintLabel:a.texts.slashHintLabel,itemHintLabel:a.texts.slashSkillHintLabel}}:null),g=(0,k.useMemo)(()=>s.skillPicker?{...s,skillPicker:{...s.skillPicker,onSelectedKeysChange:e=>{d.current?.syncSelectedSkills(e,s.skillPicker?.options??[]),s.skillPicker?.onSelectedKeysChange(e)}}}:s,[s]);return(0,k.useImperativeHandle)(u,()=>({insertInputSurfaceToken:t=>d.current?.insertInputSurfaceItem({key:`resolved-token:${t.tokenKind}:${t.tokenKey}`,title:t.label,subtitle:``,description:``,detailLines:[],tokenKind:t.tokenKind,tokenKey:t.tokenKey,data:t.data},e.inputSurfaceTriggerSpecs),beginDictation:e=>d.current?.beginDictation(e)??null,insertToken:e=>d.current?.insertToken(e),insertFileToken:(e,t,n)=>d.current?.insertFileToken(e,t,n),insertFileTokens:e=>d.current?.insertFileTokens(e),focusComposer:()=>d.current?.focusComposer(),focusComposerAtEnd:e=>d.current?.focusComposerAtEnd(e)}),[e.inputSurfaceTriggerSpecs]),(0,A.jsx)(`div`,{className:`nextclaw-chat-input-bar-surface ${o===`embedded`?`bg-transparent px-0 py-0`:`bg-background px-3 pb-3 pt-2 sm:px-4 sm:pb-4 sm:pt-2`}`,children:(0,A.jsxs)(`div`,{className:`nextclaw-chat-input-bar-shell relative mx-auto w-full max-w-[min(1120px,100%)] [container:nextclaw-chat-input-bar/inline-size]`,children:[l?(0,A.jsxs)(f,{open:!0,children:[(0,A.jsx)(p,{asChild:!0,children:(0,A.jsx)(`span`,{className:`pointer-events-none absolute left-1/2 top-0 h-px w-px -translate-x-1/2`})}),(0,A.jsx)(m,{side:`top`,align:`center`,sideOffset:8,collisionPadding:12,className:`w-auto max-w-[calc(100vw-24px)] overflow-visible rounded-none border-0 bg-transparent p-0 shadow-none`,style:{maxHeight:`none`},onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:l})]}):null,(0,A.jsxs)(`div`,{className:`nextclaw-chat-composer-surface overflow-hidden rounded-2xl border border-border bg-card shadow-card`,children:[c?(0,A.jsx)(`div`,{className:`px-3 pb-0 pt-2 sm:px-4 sm:pt-2.5`,children:c}):null,(0,A.jsx)(`div`,{className:`relative`,children:(0,A.jsx)(ca,{inputSurface:h,onInputSurfaceTriggerChange:e.onInputSurfaceTriggerChange,onSelectItem:t=>{if(t.selectionBehavior===`navigate`||t.selectionBehavior===`action`){h?.onSelectItem?.(t);return}d.current?.insertInputSurfaceItem(t,e.inputSurfaceTriggerSpecs)},triggerSpecs:e.inputSurfaceTriggerSpecs,children:({onInputSurfaceKeyDown:t,onInputSurfaceOpenChange:n,onInputSurfaceSnapshotChange:r})=>(0,A.jsx)(Qg,{ref:d,nodes:e.nodes,placeholder:e.placeholder,excerptCharacterCountTemplate:e.excerptCharacterCountTemplate,removeTokenLabel:e.removeTokenLabel,disabled:e.disabled,onInputSurfaceItemSelect:h?.onSelectItem,actions:s.actions,onNodesChange:e.onNodesChange,onFilesAdd:e.onFilesAdd,onInputSurfaceSnapshotChange:r,onInputSurfaceOpenChange:n,onInputSurfaceKeyDown:t})})}),(0,A.jsx)(t_,{hint:t}),(0,A.jsx)(n_,{sendError:r,sendErrorDetailsLabel:i}),(0,A.jsx)(La,{...g})]})]})})});r_.displayName=`ChatInputBar`;function i_({assistantIcon:e,role:t,size:n=`default`}){let r=n===`compact`,i=r?`h-7 w-7`:`h-8 w-8`,a=r?`h-3.5 w-3.5`:`h-4 w-4`;return t===`user`?null:t===`tool`?(0,A.jsx)(`div`,{"data-testid":`chat-message-avatar-tool`,className:j(`flex shrink-0 items-center justify-center rounded-full bg-accent text-accent-foreground shadow-sm ring-1 ring-border`,i),children:(0,A.jsx)(jt,{className:a})}):(0,A.jsx)(`div`,{"data-testid":`chat-message-avatar-assistant`,className:j(`flex shrink-0 items-center justify-center rounded-full bg-muted text-foreground shadow-sm ring-1 ring-border`,i),children:e??(0,A.jsx)(Be,{className:j(r?`h-4 w-4`:`h-[18px] w-[18px]`,`text-current`),strokeWidth:2.5})})}var a_=(0,k.createContext)(null);function o_({renderIcon:e,children:t}){return(0,A.jsx)(a_.Provider,{value:e,children:t})}function s_(e){let t=(0,k.useContext)(a_);return e&&t?t(e):null}function c_(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function l_(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var u_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f_={};function p_(e,t){return((t||f_).jsx?d_:u_).test(e)}var m_=/[ \t\n\f\r]/g;function h_(e){return typeof e==`object`?e.type===`text`?g_(e.value):!1:g_(e)}function g_(e){return e.replace(m_,``)===``}var __=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};__.prototype.normal={},__.prototype.property={},__.prototype.space=void 0;function v_(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new __(n,r,t)}function y_(e){return e.toLowerCase()}var b_=class{constructor(e,t){this.attribute=t,this.property=e}};b_.prototype.attribute=``,b_.prototype.booleanish=!1,b_.prototype.boolean=!1,b_.prototype.commaOrSpaceSeparated=!1,b_.prototype.commaSeparated=!1,b_.prototype.defined=!1,b_.prototype.mustUseProperty=!1,b_.prototype.number=!1,b_.prototype.overloadedBoolean=!1,b_.prototype.property=``,b_.prototype.spaceSeparated=!1,b_.prototype.space=void 0;var x_=t({boolean:()=>z,booleanish:()=>C_,commaOrSpaceSeparated:()=>D_,commaSeparated:()=>E_,number:()=>B,overloadedBoolean:()=>w_,spaceSeparated:()=>T_}),S_=0,z=O_(),C_=O_(),w_=O_(),B=O_(),T_=O_(),E_=O_(),D_=O_();function O_(){return 2**++S_}var k_=Object.keys(x_),A_=class extends b_{constructor(e,t,n,r){let i=-1;if(super(e,t),j_(this,`space`,r),typeof n==`number`)for(;++i<k_.length;){let e=k_[i];j_(this,k_[i],(n&x_[e])===x_[e])}}};A_.prototype.defined=!0;function j_(e,t,n){n&&(e[t]=n)}function M_(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[y_(r)]=r,n[y_(a.attribute)]=r}return new __(t,n,e.space)}var N_=M_({properties:{ariaActiveDescendant:null,ariaAtomic:C_,ariaAutoComplete:null,ariaBusy:C_,ariaChecked:C_,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:T_,ariaCurrent:null,ariaDescribedBy:T_,ariaDetails:null,ariaDisabled:C_,ariaDropEffect:T_,ariaErrorMessage:null,ariaExpanded:C_,ariaFlowTo:T_,ariaGrabbed:C_,ariaHasPopup:null,ariaHidden:C_,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T_,ariaLevel:B,ariaLive:null,ariaModal:C_,ariaMultiLine:C_,ariaMultiSelectable:C_,ariaOrientation:null,ariaOwns:T_,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:C_,ariaReadOnly:C_,ariaRelevant:null,ariaRequired:C_,ariaRoleDescription:T_,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:C_,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function P_(e,t){return t in e?e[t]:t}function F_(e,t){return P_(e,t.toLowerCase())}var I_=M_({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E_,acceptCharset:T_,accessKey:T_,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:T_,autoFocus:z,autoPlay:z,blocking:T_,capture:null,charSet:null,checked:z,cite:null,className:T_,cols:B,colSpan:null,content:null,contentEditable:C_,controls:z,controlsList:T_,coords:B|E_,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:w_,draggable:C_,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:T_,height:B,hidden:w_,high:B,href:null,hrefLang:null,htmlFor:T_,httpEquiv:T_,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:T_,itemRef:T_,itemScope:z,itemType:T_,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:z,optimum:B,pattern:null,ping:T_,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:T_,required:z,reversed:z,rows:B,rowSpan:B,sandbox:T_,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:C_,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:C_,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T_,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:C_,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:z,disableRemotePlayback:z,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:F_}),L_=M_({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:D_,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:T_,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:E_,g2:E_,glyphName:E_,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:D_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,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:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T_,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D_,rev:D_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D_,requiredFeatures:D_,requiredFonts:D_,requiredFormats:D_,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:D_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D_,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:P_}),R_=M_({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()}}),z_=M_({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:F_}),B_=M_({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),V_={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`},H_=/[A-Z]/g,U_=/-[a-z]/g,W_=/^data[-\w.:]+$/i;function G_(e,t){let n=y_(t),r=t,i=b_;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&W_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(U_,q_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!U_.test(e)){let n=e.replace(H_,K_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A_}return new i(r,t)}function K_(e){return`-`+e.toLowerCase()}function q_(e){return e.charAt(1).toUpperCase()}var J_=v_([N_,I_,R_,z_,B_],`html`),Y_=v_([N_,L_,R_,z_,B_],`svg`);function X_(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Z_(e){return e.join(` `).trim()}var Q_=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
22
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function ee(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function te(){var e=[];w(e);for(var t;t=ee();)t!==!1&&(e.push(t),w(e));return e}return C(),te()}function _(e){return e?e.replace(l,p):p}t.exports=g})),$_=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Q_());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),ev=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),tv=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})($_()),r=ev();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),nv=iv(`end`),rv=iv(`start`);function iv(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function av(e){let t=rv(e),n=nv(e);if(t&&n)return{start:t,end:n}}function ov(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?cv(e.position):`start`in e||`end`in e?cv(e):`line`in e||`column`in e?sv(e):``}function sv(e){return lv(e&&e.line)+`:`+lv(e&&e.column)}function cv(e){return sv(e&&e.start)+`-`+sv(e&&e.end)}function lv(e){return e&&typeof e==`number`?e:1}var uv=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ov(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};uv.prototype.file=``,uv.prototype.name=``,uv.prototype.reason=``,uv.prototype.message=``,uv.prototype.stack=``,uv.prototype.column=void 0,uv.prototype.line=void 0,uv.prototype.ancestors=void 0,uv.prototype.cause=void 0,uv.prototype.fatal=void 0,uv.prototype.place=void 0,uv.prototype.ruleId=void 0,uv.prototype.source=void 0;var dv=e(tv(),1),fv={}.hasOwnProperty,pv=new Map,mv=/[A-Z]/g,hv=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),gv=new Set([`td`,`th`]),_v=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function vv(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=kv(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ov(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Y_:J_,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=yv(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function yv(e,t,n){if(t.type===`element`)return bv(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return xv(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Cv(e,t,n);if(t.type===`mdxjsEsm`)return Sv(e,t);if(t.type===`root`)return wv(e,t,n);if(t.type===`text`)return Tv(e,t)}function bv(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Y_,e.schema=i),e.ancestors.push(t);let a=Fv(e,t.tagName,!1),o=Av(e,t),s=Mv(e,t);return hv.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!h_(e):!0})),Ev(e,o,a,t),Dv(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function xv(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Iv(e,t.position)}function Sv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Iv(e,t.position)}function Cv(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Y_,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Fv(e,t.name,!0),o=jv(e,t),s=Mv(e,t);return Ev(e,o,a,t),Dv(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function wv(e,t,n){let r={};return Dv(r,Mv(e,t)),e.create(t,e.Fragment,r,n)}function Tv(e,t){return t.value}function Ev(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Dv(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ov(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function kv(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=rv(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Av(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&fv.call(t.properties,i)){let a=Nv(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&gv.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function jv(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Iv(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Iv(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Mv(e,t){let n=[],r=-1,i=e.passKeys?new Map:pv;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=yv(e,a,o);s!==void 0&&n.push(s)}return n}function Nv(e,t,n){let r=G_(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?l_(n):Z_(n)),r.property===`style`){let t=typeof n==`object`?n:Pv(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Lv(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?V_[r.property]||r.property:r.attribute,n]}}function Pv(e,t){try{return(0,dv.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new uv("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=_v+`#cannot-parse-style-attribute`,r}}function Fv(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=p_(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=p_(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return fv.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Iv(e)}function Iv(e,t){let n=new uv("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=_v+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Lv(e){let t={},n;for(n in e)fv.call(e,n)&&(t[Rv(n)]=e[n]);return t}function Rv(e){let t=e.replace(mv,zv);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function zv(e){return`-`+e.toLowerCase()}var Bv={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`]},Vv={};function Hv(e,t){let n=t||Vv;return Uv(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Uv(e,t,n){if(Gv(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 Wv(e.children,t,n)}return Array.isArray(e)?Wv(e,t,n):``}function Wv(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Uv(e[i],t,n);return r.join(``)}function Gv(e){return!!(e&&typeof e==`object`)}var Kv=document.createElement(`i`);function qv(e){let t=`&`+e+`;`;Kv.innerHTML=t;let n=Kv.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Jv(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Yv(e,t){return e.length>0?(Jv(e,e.length,0,t),e):t}var Xv={}.hasOwnProperty;function Zv(e){let t={},n=-1;for(;++n<e.length;)Qv(t,e[n]);return t}function Qv(e,t){let n;for(n in t){let r=(Xv.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Xv.call(r,a)||(r[a]=[]);let e=i[a];$v(r[a],Array.isArray(e)?e:e?[e]:[])}}}function $v(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Jv(e,0,0,r)}function ey(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function ty(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ny=fy(/[A-Za-z]/),ry=fy(/[\dA-Za-z]/),iy=fy(/[#-'*+\--9=?A-Z^-~]/);function ay(e){return e!==null&&(e<32||e===127)}var oy=fy(/\d/),sy=fy(/[\dA-Fa-f]/),cy=fy(/[!-/:-@[-`{-~]/);function V(e){return e!==null&&e<-2}function ly(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}var uy=fy(/\p{P}|\p{S}/u),dy=fy(/\s/);function fy(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function py(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ry(e.charCodeAt(n+1))&&ry(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var my={tokenize:hy};function hy(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return V(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var gy={tokenize:vy},_y={tokenize:yy};function vy(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Jv(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_y,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_y,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return V(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Jv(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yy(e,t,n){return U(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function by(e){if(e===null||ly(e)||dy(e))return 1;if(uy(e))return 2}function xy(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Sy={name:`attention`,resolveAll:Cy,tokenize:wy};function Cy(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ty(d,-c),Ty(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Yv(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Yv(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Yv(l,xy(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Yv(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Yv(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Jv(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function wy(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=by(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=by(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ty(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ey={name:`autolink`,tokenize:Dy};function Dy(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ny(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ry(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ry(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ay(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):iy(t)?(e.consume(t),l):n(t)}function u(e){return ry(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ry(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Oy={partial:!0,tokenize:ky};function ky(e,t,n){return r;function r(t){return H(t)?U(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||V(e)?t(e):n(e)}}var Ay={continuation:{tokenize:My},exit:Ny,name:`blockQuote`,tokenize:jy};function jy(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function My(e,t,n){let r=this;return i;function i(t){return H(t)?U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ay,t,n)(r)}}function Ny(e){e.exit(`blockQuote`)}var Py={name:`characterEscape`,tokenize:Fy};function Fy(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return cy(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Iy={name:`characterReference`,tokenize:Ly};function Ly(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ry,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=sy,u):(e.enter(`characterReferenceValue`),a=7,o=oy,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ry&&!qv(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Ry={partial:!0,tokenize:Vy},zy={concrete:!0,name:`codeFenced`,tokenize:By};function By(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||V(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Ry,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||V(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?U(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||V(t)?e.check(Ry,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||V(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?U(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||V(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Vy(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Hy={name:`codeIndented`,tokenize:Wy},Uy={partial:!0,tokenize:Gy};function Wy(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):V(t)?e.attempt(Uy,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||V(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Gy(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):V(e)?i(e):n(e)}}var Ky={name:`codeText`,previous:Jy,resolve:qy,tokenize:Yy};function qy(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 Jy(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Yy(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||V(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Xy=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Zy(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Zy(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zy(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Zy(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Zy(this.left,t.reverse())}}};function Zy(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 Qy(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Xy(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,$y(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Jv(e,0,1/0,u.slice(0)),!l}function $y(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var eb={resolve:nb,tokenize:rb},tb={partial:!0,tokenize:ib};function nb(e){return Qy(e),e}function rb(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):V(t)?e.check(tb,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ib(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,a,`linePrefix`)}function a(i){if(i===null||V(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ab(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ay(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||V(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||ly(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ay(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ob(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):V(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||V(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function sb(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||V(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function cb(e,t){let n;return r;function r(i){return V(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?U(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var lb={name:`definition`,tokenize:db},ub={partial:!0,tokenize:fb};function db(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ob.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ty(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return ly(t)?cb(e,l)(t):l(t)}function l(t){return ab(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ub,d,d)(t)}function d(t){return H(t)?U(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||V(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function fb(e,t,n){return r;function r(t){return ly(t)?cb(e,i)(t):n(t)}function i(t){return sb(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?U(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||V(e)?t(e):n(e)}}var pb={name:`hardBreakEscape`,tokenize:mb};function mb(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return V(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var hb={name:`headingAtx`,resolve:gb,tokenize:_b};function gb(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Jv(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _b(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||ly(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||V(n)?(e.exit(`atxHeading`),t(n)):H(n)?U(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||ly(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var vb=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),yb=[`pre`,`script`,`style`,`textarea`],bb={concrete:!0,name:`htmlFlow`,resolveTo:Cb,tokenize:wb},xb={partial:!0,tokenize:Eb},Sb={partial:!0,tokenize:Tb};function Cb(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 wb(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:se):ny(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ny(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:E:m):n(i)}function h(t){return ny(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||ly(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&yb.includes(l)?(i=1,r.interrupt?t(s):E(s)):vb.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):E(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ry(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:E):n(i)}function v(t){return H(t)?(e.consume(t),v):ee(t)}function y(t){return t===47?(e.consume(t),ee):t===58||t===95||ny(t)?(e.consume(t),b):H(t)?(e.consume(t),y):ee(t)}function b(t){return t===45||t===46||t===58||t===95||ry(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||V(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||ly(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||H(e)?y(e):n(e)}function ee(t){return t===62?(e.consume(t),te):n(t)}function te(t){return t===null||V(t)?E(t):H(t)?(e.consume(t),te):n(t)}function E(t){return t===45&&i===2?(e.consume(t),O):t===60&&i===1?(e.consume(t),ie):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):V(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(xb,le,ne)(t)):t===null||V(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),E)}function ne(t){return e.check(Sb,D,le)(t)}function D(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||V(t)?ne(t):(e.enter(`htmlFlowData`),E(t))}function O(t){return t===45?(e.consume(t),se):E(t)}function ie(t){return t===47?(e.consume(t),o=``,ae):E(t)}function ae(t){if(t===62){let n=o.toLowerCase();return yb.includes(n)?(e.consume(t),ce):E(t)}return ny(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):E(t)}function oe(t){return t===93?(e.consume(t),se):E(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):E(t)}function ce(t){return t===null||V(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function Tb(e,t,n){let r=this;return i;function i(t){return V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Eb(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Oy,t,n)}}var Db={name:`htmlText`,tokenize:Ob};function Ob(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ny(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ny(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):V(t)?(o=d,ie(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?O(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):V(t)?(o=h,ie(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?O(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?O(t):V(t)?(o=v,ie(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):V(t)?(o=y,ie(t)):(e.consume(t),y)}function b(e){return e===62?O(e):y(e)}function x(t){return ny(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ry(t)?(e.consume(t),S):C(t)}function C(t){return V(t)?(o=C,ie(t)):H(t)?(e.consume(t),C):O(t)}function w(t){return t===45||ry(t)?(e.consume(t),w):t===47||t===62||ly(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),O):t===58||t===95||ny(t)?(e.consume(t),ee):V(t)?(o=T,ie(t)):H(t)?(e.consume(t),T):O(t)}function ee(t){return t===45||t===46||t===58||t===95||ry(t)?(e.consume(t),ee):te(t)}function te(t){return t===61?(e.consume(t),E):V(t)?(o=te,ie(t)):H(t)?(e.consume(t),te):T(t)}function E(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):V(t)?(o=E,ie(t)):H(t)?(e.consume(t),E):(e.consume(t),D)}function ne(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):V(t)?(o=ne,ie(t)):(e.consume(t),ne)}function D(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||ly(t)?T(t):(e.consume(t),D)}function re(e){return e===47||e===62||ly(e)?T(e):n(e)}function O(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ie(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return H(t)?U(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var kb={name:`labelEnd`,resolveAll:Nb,resolveTo:Pb,tokenize:Fb},Ab={tokenize:Ib},jb={tokenize:Lb},Mb={tokenize:Rb};function Nb(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Jv(e,0,e.length,n),e}function Pb(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Yv(s,e.slice(a+1,a+r+3)),s=Yv(s,[[`enter`,u,t]]),s=Yv(s,xy(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Yv(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Yv(s,e.slice(o+1)),s=Yv(s,[[`exit`,c,t]]),Jv(e,a,e.length,s),e}function Fb(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(ty(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ab,u,o?u:d)(t):t===91?e.attempt(jb,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Mb,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Ib(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return ly(t)?cb(e,a)(t):a(t)}function a(t){return t===41?u(t):ab(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return ly(t)?cb(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?sb(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return ly(t)?cb(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Lb(e,t,n){let r=this;return i;function i(t){return ob.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ty(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Rb(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var zb={name:`labelStartImage`,resolveAll:kb.resolveAll,tokenize:Bb};function Bb(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Vb={name:`labelStartLink`,resolveAll:kb.resolveAll,tokenize:Hb};function Hb(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ub={name:`lineEnding`,tokenize:Wb};function Wb(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}}var Gb={name:`thematicBreak`,tokenize:Kb};function Kb(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||V(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?U(e,s,`whitespace`)(t):s(t))}}var qb={continuation:{tokenize:Zb},exit:$b,name:`list`,tokenize:Xb},Jb={partial:!0,tokenize:ex},Yb={partial:!0,tokenize:Qb};function Xb(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:oy(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Gb,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return oy(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Oy,r.interrupt?n:u,e.attempt(Jb,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Zb(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Oy,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Yb,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(qb,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Qb(e,t,n){let r=this;return U(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function $b(e){e.exit(this.containerState.type)}function ex(e,t,n){let r=this;return U(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var tx={name:`setextUnderline`,resolveTo:nx,tokenize:rx};function nx(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function rx(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?U(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||V(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ix={tokenize:ax};function ax(e){let t=this,n=e.attempt(Oy,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eb,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ox={resolveAll:ux()},sx=lx(`string`),cx=lx(`text`);function lx(e){return{resolveAll:ux(e===`text`?dx:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ux(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function dx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var fx=t({attentionMarkers:()=>bx,contentInitial:()=>mx,disable:()=>xx,document:()=>px,flow:()=>gx,flowInitial:()=>hx,insideSpan:()=>yx,string:()=>_x,text:()=>vx}),px={42:qb,43:qb,45:qb,48:qb,49:qb,50:qb,51:qb,52:qb,53:qb,54:qb,55:qb,56:qb,57:qb,62:Ay},mx={91:lb},hx={[-2]:Hy,[-1]:Hy,32:Hy},gx={35:hb,42:Gb,45:[tx,Gb],60:bb,61:tx,95:Gb,96:zy,126:zy},_x={38:Iy,92:Py},vx={[-5]:Ub,[-4]:Ub,[-3]:Ub,33:zb,38:Iy,42:Sy,60:[Ey,Db],91:Vb,92:[pb,Py],93:kb,95:Sy,96:Ky},yx={null:[Sy,ox]},bx={null:[42,95]},xx={null:[]};function Sx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Yv(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=xy(a,l.events,l),l.events):[]}function f(e,t){return wx(p(e),t)}function p(e){return Cx(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,ee()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){V(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,ee()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Jv(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,ee()}}function ee(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Cx(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function wx(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
23
+ `;break;case-3:o=`\r
24
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Tx(e){let t={constructs:Zv([fx,...(e||{}).extensions||[]]),content:n(my),defined:[],document:n(gy),flow:n(ix),lazy:{},string:n(sx),text:n(cx)};return t;function n(e){return n;function n(n){return Sx(t,e,n)}}}function Ex(e){for(;!Qy(e););return e}var Dx=/[\0\t\n\r]/g;function Ox(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Dx.lastIndex=u,c=Dx.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var kx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ax(e){return e.replace(kx,jx)}function jx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ey(n.slice(t?2:1),t?16:10)}return qv(n)||e}var Mx={}.hasOwnProperty;function Nx(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Px(n)(Ex(Tx(n).document().write(Ox()(e,t,!0))))}function Px(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ee),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Te),label:o,link:a(Ee),listItem:a(Oe),listItemValue:f,listOrdered:a(De,d),listUnordered:a(De),paragraph:a(ke),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Ae),thematicBreak:a(Me)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:ee,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:pe,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:ee,codeIndented:c(_),codeText:c(re),codeTextData:ee,data:ee,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(E),hardBreakTrailing:c(E),htmlFlow:c(ne),htmlFlowData:ee,htmlText:c(D),htmlTextData:ee,image:c(ie),label:oe,labelText:ae,lineEnding:te,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:se,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Ix(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Mx.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Rx).call(a,void 0,e[0])}for(r.position={start:Fx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Fx(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Fx(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Rx).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ov({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Fx(e.end)}function u(){return Hv(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=je(),n.position={start:Fx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function ee(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Fx(e.end)}function te(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Fx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),ee.call(this,e))}function E(){this.data.atHardBreak=!0}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function D(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ax(t),n.identifier=ty(t).toLowerCase()}function oe(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function fe(e){this.data.characterReferenceType=e.type}function pe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ey(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=qv(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=Fx(e.end)}function he(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Te(){return{type:`image`,title:null,url:``,alt:null}}function Ee(){return{type:`link`,title:null,url:``,children:[]}}function De(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Oe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ke(){return{type:`paragraph`,children:[]}}function Ae(){return{type:`strong`,children:[]}}function je(){return{type:`text`,value:``}}function Me(){return{type:`thematicBreak`}}}function Fx(e){return{line:e.line,column:e.column,offset:e.offset}}function Ix(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Ix(e,r):Lx(e,r)}}function Lx(e,t){let n;for(n in t)if(Mx.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Rx(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+ov({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ov({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+ov({start:t.start,end:t.end})+`) is still open`)}function zx(e){let t=this;t.parser=n;function n(n){return Nx(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Bx(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Vx(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
25
+ `}]}function Hx(e,t){let n=t.value?t.value+`
26
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Ux(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wx(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gx(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=py(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Kx(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qx(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Jx(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Yx(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Jx(e,t);let i={src:py(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Xx(e,t){let n={src:py(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Zx(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Qx(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Jx(e,t);let i={href:py(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function $x(e,t){let n={href:py(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eS(e,t,n){let r=e.all(t),i=n?tS(n):nS(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
27
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
28
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function tS(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nS(n[r])}return t}function nS(e){return e.spread??e.children.length>1}function rS(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function iS(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aS(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oS(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sS(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=rv(t.children[1]),o=nv(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function cS(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function lS(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var uS=9,dS=32;function fS(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(pS(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(pS(t.slice(i),i>0,!1)),a.join(``)}function pS(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===uS||t===dS;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===uS||t===dS;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function mS(e,t){let n={type:`text`,value:fS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function hS(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var gS={blockquote:Bx,break:Vx,code:Hx,delete:Ux,emphasis:Wx,footnoteReference:Gx,heading:Kx,html:qx,imageReference:Yx,image:Xx,inlineCode:Zx,linkReference:Qx,link:$x,listItem:eS,list:rS,paragraph:iS,root:aS,strong:oS,table:sS,tableCell:lS,tableRow:cS,text:mS,thematicBreak:hS,toml:_S,yaml:_S,definition:_S,footnoteDefinition:_S};function _S(){}var vS=typeof self==`object`?self:globalThis,yS=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new vS[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new vS[a](o),i)};return r},bS=e=>yS(new Map,e)(0),xS=``,{toString:SS}={},{keys:CS}=Object,wS=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=SS.call(e).slice(8,-1);switch(n){case`Array`:return[1,xS];case`Object`:return[2,xS];case`Date`:return[3,xS];case`RegExp`:return[4,xS];case`Map`:return[5,xS];case`Set`:return[6,xS];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},TS=([e,t])=>e===0&&(t===`function`||t===`symbol`),ES=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=wS(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of CS(r))(e||!TS(wS(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(TS(wS(n))||TS(wS(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!TS(wS(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},DS=(e,{json:t,lossy:n}={})=>{let r=[];return ES(!(t||n),!!t,new Map,r)(e),r},OS=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?bS(DS(e,t)):structuredClone(e):(e,t)=>bS(DS(e,t));function kS(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function AS(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function jS(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||kS,r=e.options.footnoteBackLabel||AS,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=py(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...OS(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
29
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
30
+ `}]}}var MS=(function(e){if(e==null)return LS;if(typeof e==`function`)return IS(e);if(typeof e==`object`)return Array.isArray(e)?NS(e):PS(e);if(typeof e==`string`)return FS(e);throw Error(`Expected function, string, or object as test`)});function NS(e){let t=[],n=-1;for(;++n<e.length;)t[n]=MS(e[n]);return IS(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function PS(e){let t=e;return IS(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function FS(e){return IS(t);function t(t){return t&&t.type===e}}function IS(e){return t;function t(t,n,r){return!!(RS(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function LS(){return!0}function RS(e){return typeof e==`object`&&!!e&&`type`in e}function zS(e){return e}var BS=[],VS=`skip`;function HS(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=MS(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+zS(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=BS,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=US(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function US(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?BS:[e]}function WS(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),HS(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var GS={}.hasOwnProperty,KS={};function qS(e,t){let n=t||KS,r=new Map,i=new Map,a={all:s,applyData:YS,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...gS,...n.handlers},one:o,options:n,patch:JS,wrap:ZS};return WS(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(GS.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=OS(n);return r.children=a.all(e),r}return OS(e)}return(a.options.unknownHandler||XS)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=QS(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=QS(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function JS(e,t){e.position&&(t.position=av(e))}function YS(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,OS(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function XS(e,t){let n=t.data||{},r=`value`in t&&!(GS.call(n,`hProperties`)||GS.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 ZS(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
31
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
32
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
33
+ `}),n}function QS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $S(e,t){let n=qS(e,t),r=n.one(e,void 0),i=jS(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
34
+ `},i)),a}function eC(e,t){return e&&`run`in e?async function(n,r){let i=$S(n,{file:r,...t});await e.run(i,r)}:function(n,r){return $S(n,{file:r,...e||t})}}function tC(e){if(e)throw e}var nC=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function rC(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function iC(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?aC(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function aC(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var oC={basename:sC,dirname:cC,extname:lC,join:uC,sep:`/`};function sC(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);pC(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function cC(e){if(pC(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function lC(e){pC(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function uC(...e){let t=-1,n;for(;++t<e.length;)pC(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:dC(n)}function dC(e){pC(e);let t=e.codePointAt(0)===47,n=fC(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function fC(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function pC(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var mC={cwd:hC};function hC(){return`/`}function gC(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function _C(e){if(typeof e==`string`)e=new URL(e);else if(!gC(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return vC(e)}function vC(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var yC=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],bC=class{constructor(e){let t;t=e?gC(e)?{path:e}:typeof e==`string`||wC(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:mC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<yC.length;){let e=yC[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)yC.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?oC.basename(this.path):void 0}set basename(e){SC(e,`basename`),xC(e,`basename`),this.path=oC.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?oC.dirname(this.path):void 0}set dirname(e){CC(this.basename,`dirname`),this.path=oC.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?oC.extname(this.path):void 0}set extname(e){if(xC(e,`extname`),CC(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=oC.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){gC(e)&&(e=_C(e)),SC(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?oC.basename(this.path,this.extname):void 0}set stem(e){SC(e,`stem`),xC(e,`stem`),this.path=oC.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new uv(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function xC(e,t){if(e&&e.includes(oC.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+oC.sep+"`")}function SC(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function CC(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function wC(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var TC=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),EC=e(nC(),1),DC={}.hasOwnProperty,OC=new class e extends TC{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=iC()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,EC.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(jC(`data`,this.frozen),this.namespace[e]=t,this):DC.call(this.namespace,e)&&this.namespace[e]||void 0:e?(jC(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=PC(e),n=this.parser||this.Parser;return kC(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),kC(`process`,this.parser||this.Parser),AC(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=PC(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);IC(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),kC(`processSync`,this.parser||this.Parser),AC(`processSync`,this.compiler||this.Compiler),this.process(e,r),NC(`processSync`,`process`,t),n;function r(e,r){t=!0,tC(e),n=r}}run(e,t,n){MC(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=PC(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),NC(`runSync`,`run`,n),r;function i(e,t){tC(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=PC(t),r=this.compiler||this.Compiler;return AC(`stringify`,r),MC(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(jC(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,EC.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];rC(o)&&rC(r)&&(r=(0,EC.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function kC(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function AC(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function jC(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function MC(e){if(!rC(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function NC(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function PC(e){return FC(e)?e:new bC(e)}function FC(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function IC(e){return typeof e==`string`||LC(e)}function LC(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var RC=[],zC={allowDangerousHtml:!0},BC=/^(https?|ircs?|mailto|xmpp)$/i,VC=[{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 HC(e){let t=UC(e),n=WC(e);return GC(t.runSync(t.parse(n),n),e)}function UC(e){let t=e.rehypePlugins||RC,n=e.remarkPlugins||RC,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zC}:zC;return OC().use(zx).use(n).use(eC,r).use(t)}function WC(e){let t=e.children||``,n=new bC;return typeof t==`string`?n.value=t:``+t,n}function GC(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||KC;for(let e of VC)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return WS(e,l),vv(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Bv)if(Object.hasOwn(Bv,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Bv[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function KC(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||BC.test(e.slice(0,t))?e:``}function qC(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function JC(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function YC(e,t,n){let r=MS((n||{}).ignore||[]),i=XC(t),a=-1;for(;++a<i.length;)HS(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function XC(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ZC(e[0]),QC(e[1])])}return t}function ZC(e){return typeof e==`string`?new RegExp(JC(e),`g`):e}function QC(e){return typeof e==`function`?e:function(){return e}}var $C=`phrasing`,ew=[`autolink`,`link`,`image`,`label`];function tw(){return{transforms:[lw],enter:{literalAutolink:rw,literalAutolinkEmail:iw,literalAutolinkHttp:iw,literalAutolinkWww:iw},exit:{literalAutolink:cw,literalAutolinkEmail:sw,literalAutolinkHttp:aw,literalAutolinkWww:ow}}}function nw(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:$C,notInConstruct:ew},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:$C,notInConstruct:ew},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:$C,notInConstruct:ew}]}}function rw(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function iw(e){this.config.enter.autolinkProtocol.call(this,e)}function aw(e){this.config.exit.autolinkProtocol.call(this,e)}function ow(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function sw(e){this.config.exit.autolinkEmail.call(this,e)}function cw(e){this.exit(e)}function lw(e){YC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uw],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,dw]],{ignore:[`link`,`linkReference`]})}function uw(e,t,n,r,i){let a=``;if(!mw(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!fw(n)))return!1;let o=pw(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function dw(e,t,n,r){return!mw(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function fw(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pw(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=qC(e,`(`),a=qC(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function mw(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||dy(n)||uy(n))&&(!t||n!==47)}ww.peek=Cw;function hw(){this.buffer()}function gw(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function _w(){this.buffer()}function vw(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function yw(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ty(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bw(e){this.exit(e)}function xw(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ty(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Sw(e){this.exit(e)}function Cw(){return`[`}function ww(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Tw(){return{enter:{gfmFootnoteCallString:hw,gfmFootnoteCall:gw,gfmFootnoteDefinitionLabelString:_w,gfmFootnoteDefinition:vw},exit:{gfmFootnoteCallString:yw,gfmFootnoteCall:bw,gfmFootnoteDefinitionLabelString:xw,gfmFootnoteDefinition:Sw}}}function Ew(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ww},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
35
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Ow:Dw))),s(),o}}function Dw(e,t,n){return t===0?e:Ow(e,t,n)}function Ow(e,t,n){return(n?``:` `)+e}var kw=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Pw.peek=Fw;function Aw(){return{canContainEols:[`delete`],enter:{strikethrough:Mw},exit:{strikethrough:Nw}}}function jw(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:kw}],handlers:{delete:Pw}}}function Mw(e){this.enter({type:`delete`,children:[]},e)}function Nw(e){this.exit(e)}function Pw(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Fw(){return`~`}function Iw(e){return e.length}function Lw(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Iw,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Rw(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=zw(r[d]);else{let e=zw(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
36
+ `)}function Rw(e){return e==null?``:String(e)}function zw(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var Bw={}.hasOwnProperty;function Vw(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Bw.call(t,e)){let n=String(t[e]);i=Bw.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function Hw(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Uw);return i(),o}function Uw(e,t,n){return`>`+(n?``:` `)+e}function Ww(e,t){return Gw(e,t.inConstruct,!0)&&!Gw(e,t.notInConstruct,!1)}function Gw(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 Kw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
37
+ `&&Ww(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
38
+ `}function qw(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Jw(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 Yw(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Xw(e,t,n,r){let i=Yw(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Jw(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Zw);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(qw(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
39
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
40
+ `),a&&(u+=s.move(a+`
41
+ `)),u+=s.move(c),l(),u}function Zw(e,t,n){return(n?``:` `)+e}function Qw(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $w(e,t,n,r){let i=Qw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
42
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function eT(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function tT(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function nT(e,t,n){let r=by(e),i=by(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}}rT.peek=iT;function rT(e,t,n,r){let i=eT(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=nT(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tT(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=nT(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tT(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function iT(e,t,n){return n.options.emphasis||`*`}function aT(e,t){let n=!1;return WS(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Hv(e)&&(t.options.setext||n))}function oT(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(aT(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
43
+ `,after:`
44
+ `});return r(),t(),o+`
45
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
46
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
47
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=tT(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}sT.peek=cT;function sT(e){return e.value||``}function cT(){return`<`}lT.peek=uT;function lT(e,t,n,r){let i=Qw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function uT(){return`!`}dT.peek=fT;function dT(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fT(){return`!`}pT.peek=mT;function pT(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function mT(){return"`"}function hT(e,t){let n=Hv(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))}gT.peek=_T;function gT(e,t,n,r){let i=Qw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(hT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function _T(e,t,n){return hT(e,n)?`<`:`[`}vT.peek=yT;function vT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function yT(){return`[`}function bT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xT(e){let t=bT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ST(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function CT(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wT(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ST(n):bT(n),s=e.ordered?o===`.`?`)`:`.`:xT(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),CT(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function TT(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ET(e,t,n,r){let i=TT(n),a=n.bulletCurrent||bT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function DT(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var OT=MS([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function kT(e,t,n,r){return(e.children.some(function(e){return OT(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AT(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jT.peek=MT;function jT(e,t,n,r){let i=AT(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=nT(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tT(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=nT(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tT(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function MT(e,t,n){return n.options.strong||`*`}function NT(e,t,n,r){return n.safe(e.value,r)}function PT(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function FT(e,t,n){let r=(CT(n)+(n.options.ruleSpaces?` `:``)).repeat(PT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var IT={blockquote:Hw,break:Kw,code:Xw,definition:$w,emphasis:rT,hardBreak:Kw,heading:oT,html:sT,image:lT,imageReference:dT,inlineCode:pT,link:gT,linkReference:vT,list:wT,listItem:ET,paragraph:DT,root:kT,strong:jT,text:NT,thematicBreak:FT};function LT(){return{enter:{table:RT,tableData:HT,tableHeader:HT,tableRow:BT},exit:{codeText:UT,table:zT,tableData:VT,tableHeader:VT,tableRow:VT}}}function RT(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function zT(e){this.exit(e),this.data.inTable=void 0}function BT(e){this.enter({type:`tableRow`,children:[]},e)}function VT(e){this.exit(e)}function HT(e){this.enter({type:`tableCell`,children:[]},e)}function UT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,WT));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function WT(e,t){return t===`|`?t:e}function GT(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
48
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
49
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Lw(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=IT.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function KT(){return{exit:{taskListCheckValueChecked:JT,taskListCheckValueUnchecked:JT,paragraph:YT}}}function qT(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:XT}}}function JT(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function YT(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function XT(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=IT.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ZT(){return[tw(),Tw(),Aw(),LT(),KT()]}function QT(e){return{extensions:[nw(),Ew(e),jw(),GT(e),qT()]}}var $T={tokenize:pE,partial:!0},eE={tokenize:mE,partial:!0},tE={tokenize:hE,partial:!0},nE={tokenize:gE,partial:!0},rE={tokenize:_E,partial:!0},iE={name:`wwwAutolink`,tokenize:dE,previous:vE},aE={name:`protocolAutolink`,tokenize:fE,previous:yE},oE={name:`emailAutolink`,tokenize:uE,previous:bE},sE={};function cE(){return{text:sE}}for(var lE=48;lE<123;)sE[lE]=oE,lE++,lE===58?lE=65:lE===91&&(lE=97);sE[43]=oE,sE[45]=oE,sE[46]=oE,sE[95]=oE,sE[72]=[oE,aE],sE[104]=[oE,aE],sE[87]=[oE,iE],sE[119]=[oE,iE];function uE(e,t,n){let r=this,i,a;return o;function o(t){return!xE(t)||!bE.call(r,r.previous)||SE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return xE(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(rE,u,l)(t):t===45||t===95||ry(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ny(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function dE(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!vE.call(r,r.previous)||SE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check($T,e.attempt(eE,e.attempt(tE,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fE(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&yE.call(r,r.previous)&&!SE(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ny(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ay(t)||ly(t)||dy(t)||uy(t)?n(t):e.attempt(eE,e.attempt(tE,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pE(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mE(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(nE,c,s)(t):t===null||ly(t)||dy(t)||t!==45&&uy(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hE(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(nE,t,a)(o):o===null||ly(o)||dy(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gE(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ly(o)||dy(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||ly(e)||dy(e)?t(e):r(e)}function a(e){return ny(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ny(t)?(e.consume(t),o):n(t)}}function _E(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ry(e)?n(e):t(e)}}function vE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ly(e)}function yE(e){return!ny(e)}function bE(e){return!(e===47||xE(e))}function xE(e){return e===43||e===45||e===46||e===95||ry(e)}function SE(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var CE={tokenize:jE,partial:!0};function wE(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:OE,continuation:{tokenize:kE},exit:AE}},text:{91:{name:`gfmFootnoteCall`,tokenize:DE},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:TE,resolveTo:EE}}}}function TE(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ty(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function EE(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function DE(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||ly(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ty(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return ly(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function OE(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||ly(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ty(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return ly(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),U(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function kE(e,t,n){return e.check(Oy,t,e.attempt(CE,t,n))}function AE(e){e.exit(`gfmFootnoteDefinition`)}function jE(e,t,n){let r=this;return U(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ME(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Jv(o,o.length,0,xy(s,e.slice(r+1,n),t)),Jv(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Jv(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=by(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=by(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var NE=class{constructor(){this.map=[]}add(e,t,n){PE(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function PE(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 FE(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function IE(){return{flow:{null:{name:`table`,tokenize:LE,resolveAll:RE}}}}function LE(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):V(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):H(t)?U(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||ly(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,H(t)?U(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return H(t)?U(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||V(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return H(t)?U(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||V(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||V(n)?(e.exit(`tableRow`),t(n)):H(n)?U(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||ly(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function RE(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new NE;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(BE(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=zE(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=zE(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=zE(f,t,o,i,n,d)):(o[0]=o[1],d=zE(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&BE(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=FE(t.events,n))}return e}function zE(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},VE(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=VE(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=VE(t.events,n[2]),a=VE(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},VE(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function BE(e,t,n,r,i){let a=[],o=VE(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function VE(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var HE={name:`tasklistCheck`,tokenize:WE};function UE(){return{text:{91:HE}}}function WE(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return ly(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return V(r)?t(r):H(r)?e.check({tokenize:GE},t,n)(r):n(r)}}function GE(e,t,n){return U(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function KE(e){return Zv([cE(),wE(),ME(e),IE(),UE()])}var qE={};function JE(e){let t=this,n=e||qE,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(KE(n)),a.push(ZT()),o.push(QT(n))}var YE=e(n(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),XE=Object.assign(ZE(Error),{eval:ZE(EvalError),range:ZE(RangeError),reference:ZE(ReferenceError),syntax:ZE(SyntaxError),type:ZE(TypeError),uri:ZE(URIError)});function ZE(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,YE.default)(t,...n))}}var QE={}.hasOwnProperty,$E={yaml:`-`,toml:`+`};function eD(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=tD(r[n]);return t}function tD(e){let t=e;if(typeof t==`string`){if(!QE.call($E,t))throw XE("Missing matter definition for `%s`",t);t={type:t,marker:$E[t]}}else if(typeof t!=`object`)throw XE("Expected matter to be an object, not `%j`",t);if(!QE.call(t,`type`))throw XE("Missing `type` in matter `%j`",t);if(!QE.call(t,`fence`)&&!QE.call(t,`marker`))throw XE("Missing `marker` or `fence` in matter `%j`",t);return t}function nD(e){let t=eD(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=iD(e,`open`).charCodeAt(0),a=rD(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function rD(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=iD(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),H(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return H(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return V(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=iD(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||V(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||V(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),H(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return H(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||V(i)?(e.exit(r),t(i)):n(i)}}}function iD(e,t){return e.marker?aD(e.marker,t).repeat(3):aD(e.fence,t)}function aD(e,t){return typeof e==`string`?e:e[t]}function oD(e){let t=eD(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=sD(e),r[e.type]=cD,r[e.type+`Value`]=lD}return{enter:n,exit:r}}function sD(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function cD(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function lD(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function uD(e){let t=[],n={},r=eD(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=dD(e);let a=fD(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:JC(a.charAt(1))})}return{unsafe:t,handlers:n}}function dD(e){let t=fD(e,`open`),n=fD(e,`close`);return r;function r(e){return t+(e.value?`
50
+ `+e.value:``)+`
51
+ `+n}}function fD(e,t){return e.marker?pD(e.marker,t).repeat(3):pD(e.fence,t)}function pD(e,t){return typeof e==`string`?e:e[t]}var mD=`yaml`;function hD(e){let t=this,n=e||mD,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(nD(n)),a.push(oD(n)),o.push(uD(n))}var gD=Symbol.for(`yaml.alias`),_D=Symbol.for(`yaml.document`),vD=Symbol.for(`yaml.map`),yD=Symbol.for(`yaml.pair`),bD=Symbol.for(`yaml.scalar`),xD=Symbol.for(`yaml.seq`),SD=Symbol.for(`yaml.node.type`),CD=e=>!!e&&typeof e==`object`&&e[SD]===gD,wD=e=>!!e&&typeof e==`object`&&e[SD]===_D,TD=e=>!!e&&typeof e==`object`&&e[SD]===vD,ED=e=>!!e&&typeof e==`object`&&e[SD]===yD,DD=e=>!!e&&typeof e==`object`&&e[SD]===bD,OD=e=>!!e&&typeof e==`object`&&e[SD]===xD;function kD(e){if(e&&typeof e==`object`)switch(e[SD]){case vD:case xD:return!0}return!1}function AD(e){if(e&&typeof e==`object`)switch(e[SD]){case gD:case vD:case bD:case xD:return!0}return!1}var jD=e=>(DD(e)||kD(e))&&!!e.anchor,MD=Symbol(`break visit`),ND=Symbol(`skip children`),PD=Symbol(`remove node`);function FD(e,t){let n=zD(t);wD(e)?ID(null,e.contents,n,Object.freeze([e]))===PD&&(e.contents=null):ID(null,e,n,Object.freeze([]))}FD.BREAK=MD,FD.SKIP=ND,FD.REMOVE=PD;function ID(e,t,n,r){let i=BD(e,t,n,r);if(AD(i)||ED(i))return VD(e,r,i),ID(e,i,n,r);if(typeof i!=`symbol`){if(kD(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ID(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===MD)return MD;else i===PD&&(t.items.splice(e,1),--e)}}else if(ED(t)){r=Object.freeze(r.concat(t));let e=ID(`key`,t.key,n,r);if(e===MD)return MD;e===PD&&(t.key=null);let i=ID(`value`,t.value,n,r);if(i===MD)return MD;i===PD&&(t.value=null)}}return i}async function LD(e,t){let n=zD(t);wD(e)?await RD(null,e.contents,n,Object.freeze([e]))===PD&&(e.contents=null):await RD(null,e,n,Object.freeze([]))}LD.BREAK=MD,LD.SKIP=ND,LD.REMOVE=PD;async function RD(e,t,n,r){let i=await BD(e,t,n,r);if(AD(i)||ED(i))return VD(e,r,i),RD(e,i,n,r);if(typeof i!=`symbol`){if(kD(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await RD(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===MD)return MD;else i===PD&&(t.items.splice(e,1),--e)}}else if(ED(t)){r=Object.freeze(r.concat(t));let e=await RD(`key`,t.key,n,r);if(e===MD)return MD;e===PD&&(t.key=null);let i=await RD(`value`,t.value,n,r);if(i===MD)return MD;i===PD&&(t.value=null)}}return i}function zD(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function BD(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(TD(t))return n.Map?.(e,t,r);if(OD(t))return n.Seq?.(e,t,r);if(ED(t))return n.Pair?.(e,t,r);if(DD(t))return n.Scalar?.(e,t,r);if(CD(t))return n.Alias?.(e,t,r)}function VD(e,t,n){let r=t[t.length-1];if(kD(r))r.items[e]=n;else if(ED(r))e===`key`?r.key=n:r.value=n;else if(wD(r))r.contents=n;else{let e=CD(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var HD={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},UD=e=>e.replace(/[!,[\]{}]/g,e=>HD[e]),WD=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+UD(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&AD(e.contents)){let t={};FD(e.contents,(e,n)=>{AD(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
52
+ `)}};WD.defaultYaml={explicit:!1,version:`1.2`},WD.defaultTags={"!!":`tag:yaml.org,2002:`};function GD(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function KD(e){let t=new Set;return FD(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function qD(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function JD(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=KD(e);let a=qD(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(DD(t.node)||kD(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function YD(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=YD(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=YD(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=YD(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=YD(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function XD(e,t,n){if(Array.isArray(e))return e.map((e,t)=>XD(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!jD(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ZD=class{constructor(e){Object.defineProperty(this,SD,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!wD(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=XD(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?YD(i,{"":o},``,o):o}},QD=class extends ZD{constructor(e){super(gD),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],FD(e,{Node:(e,t)=>{(CD(t)||jD(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(XD(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=$D(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(GD(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function $D(e,t,n){if(CD(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(kD(t)){let r=0;for(let i of t.items){let t=$D(e,i,n);t>r&&(r=t)}return r}else if(ED(t)){let r=$D(e,t.key,n),i=$D(e,t.value,n);return Math.max(r,i)}return 1}var eO=e=>!e||typeof e!=`function`&&typeof e!=`object`,W=class extends ZD{constructor(e){super(bD),this.value=e}toJSON(e,t){return t?.keep?this.value:XD(this.value,e,t)}toString(){return String(this.value)}};W.BLOCK_FOLDED=`BLOCK_FOLDED`,W.BLOCK_LITERAL=`BLOCK_LITERAL`,W.PLAIN=`PLAIN`,W.QUOTE_DOUBLE=`QUOTE_DOUBLE`,W.QUOTE_SINGLE=`QUOTE_SINGLE`;var tO=`tag:yaml.org,2002:`;function nO(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function rO(e,t,n){if(wD(e)&&(e=e.contents),AD(e))return e;if(ED(e)){let t=n.schema[vD].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new QD(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=tO+t.slice(2));let l=nO(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new W(e);return c&&(c.node=t),t}l=e instanceof Map?o[vD]:Symbol.iterator in Object(e)?o[xD]:o[vD]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new W(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function iO(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return rO(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var aO=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,oO=class extends ZD{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>AD(t)||ED(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(aO(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(kD(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,iO(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(kD(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&DD(i)?i.value:i:kD(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ED(t))return!1;let n=t.value;return n==null||e&&DD(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return kD(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(kD(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,iO(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},sO=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function cO(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var lO=(e,t,n)=>e.endsWith(`
53
+ `)?cO(n,t):n.includes(`
54
+ `)?`
55
+ `+cO(n,t):(e.endsWith(` `)?``:` `)+n,uO=`flow`,dO=`block`,fO=`quoted`;function pO(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=mO(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
56
+ `)n===`block`&&(h=mO(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
57
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
58
+ `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function mO(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
59
+ `);r=t,i=t+1,a=e[i]}return r}var hO=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),gO=e=>/^(%|---|\.\.\.)/m.test(e);function _O(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
60
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function vO(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(gO(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
61
+
62
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
63
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:pO(o,a,fO,hO(t,!1))}function yO(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
64
+ `)||/[ \t]\n|\n[ \t]/.test(e))return vO(e,t);let n=t.indent||(gO(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:pO(r,n,uO,hO(t,!1))}function bO(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=vO;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?yO:i&&!t?vO:n?yO:vO}return r(e,t)}var xO;try{xO=RegExp(`(^|(?<!
65
+ ))
66
+ +(?!
67
+ |$)`,`g`)}catch{xO=/\n+(?!\n|$)/g}function SO({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return bO(n,r);let l=r.indent||(r.forceBlockIndent||gO(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===W.BLOCK_FOLDED?!1:t===W.BLOCK_LITERAL?!0:!_O(n,c,l.length);if(!n)return u?`|
68
+ `:`>
69
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
70
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
71
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
72
+ `&&(p=p.slice(0,-1)),p.replace(xO,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
73
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
74
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=hO(r,!0);o!==`folded`&&t!==W.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=pO(`${v}${e}${p}`,l,dO,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function CO(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
75
+ `)||u&&/[[\]{},]/.test(a))return bO(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
76
+ `)?bO(a,t):SO(e,t,n,r);if(!s&&!u&&i!==W.PLAIN&&a.includes(`
77
+ `))return SO(e,t,n,r);if(gO(a)){if(c===``)return t.forceBlockIndent=!0,SO(e,t,n,r);if(s&&c===l)return bO(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return bO(a,t)}return s?d:pO(d,c,uO,hO(t,!1))}function wO(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==W.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=W.QUOTE_DOUBLE);let c=e=>{switch(e){case W.BLOCK_FOLDED:case W.BLOCK_LITERAL:return i||a?bO(o.value,t):SO(o,t,n,r);case W.QUOTE_DOUBLE:return vO(o.value,t);case W.QUOTE_SINGLE:return yO(o.value,t);case W.PLAIN:return CO(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function TO(e,t){let n=Object.assign({blockQuote:!0,commentString:sO,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function EO(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(DD(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function DO(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(DD(e)||kD(e))&&e.anchor;a&&GD(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function OO(e,t,n,r){if(ED(e))return e.toString(t,n,r);if(CD(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=AD(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=EO(t.doc.schema.tags,a);let o=DO(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):DD(a)?wO(a,t,n,r):a.toString(t,n,r);return o?DD(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function kO({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=AD(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(kD(e)||!AD(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||kD(e)||(DD(e)?e.type===W.BLOCK_FOLDED||e.type===W.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=OO(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=lO(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=lO(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=lO(g,n.indent,l(f))));let _,v,y;AD(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&DD(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&OD(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=OO(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
78
+ `:``,v){let e=l(v);S+=`\n${cO(e,n.indent)}`}x===``&&!n.inFlow?S===`
79
+ `&&y&&(S=`
80
+
81
+ `):S+=`\n${n.indent}`}else if(!p&&kD(t)){let e=x[0],r=x.indexOf(`
82
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
83
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=lO(g,n.indent,l(y)):h&&i&&i(),g}function AO(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var jO=`<<`,MO={identify:e=>e===jO||typeof e==`symbol`&&e.description===jO,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new W(Symbol(jO)),{addToJSMap:PO}),stringify:()=>jO},NO=(e,t)=>(MO.identify(t)||DD(t)&&(!t.type||t.type===W.PLAIN)&&MO.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===MO.tag&&e.default);function PO(e,t,n){if(n=e&&CD(n)?n.resolve(e.doc):n,OD(n))for(let r of n.items)FO(e,t,r);else if(Array.isArray(n))for(let r of n)FO(e,t,r);else FO(e,t,n)}function FO(e,t,n){let r=e&&CD(n)?n.resolve(e.doc):n;if(!TD(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function IO(e,t,{key:n,value:r}){if(AD(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(NO(e,n))PO(e,t,r);else{let i=XD(n,``,e);if(t instanceof Map)t.set(i,XD(r,i,e));else if(t instanceof Set)t.add(i);else{let a=LO(n,i,e),o=XD(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function LO(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(AD(e)&&n?.doc){let t=TO(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),AO(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function RO(e,t,n){return new zO(rO(e,void 0,n),rO(t,void 0,n))}var zO=class e{constructor(e,t=null){Object.defineProperty(this,SD,{value:yD}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return AD(n)&&(n=n.clone(t)),AD(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return IO(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?kO(this,e,t,n):JSON.stringify(this)}};function BO(e,t,n){return(t.inFlow??e.flow?HO:VO)(e,t,n)}function VO({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(AD(i))!d&&i.spaceBefore&&f.push(``),UO(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(ED(i)){let e=AD(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),UO(n,f,e.commentBefore,d))}d=!1;let s=OO(i,u,()=>o=null,()=>d=!0);o&&(s+=lO(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
84
+ `}}return e?(p+=`
85
+ `+cO(l(e),c),s&&s()):d&&o&&o(),p}function HO({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(AD(i))i.spaceBefore&&d.push(``),UO(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(ED(i)){let e=AD(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),UO(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=AD(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=OO(i,c,()=>a=null);n<e.length-1&&(o+=`,`),a&&(o+=lO(o,r,s(a))),!l&&(d.length>u||o.includes(`
86
+ `))&&(l=!0),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
87
+ `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function UO({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=cO(t(r),e);n.push(i.trimStart())}}function WO(e,t){let n=DD(t)?t.value:t;for(let r of e)if(ED(r)&&(r.key===t||r.key===n||DD(r.key)&&r.key.value===n))return r}var GO=class extends oO{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(vD,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(RO(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=ED(e)?e:!e||typeof e!=`object`||!(`key`in e)?new zO(e,e?.value):new zO(e.key,e.value);let r=WO(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);DD(r.value)&&eO(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=WO(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=WO(this.items,e)?.value;return(!t&&DD(n)?n.value:n)??void 0}has(e){return!!WO(this.items,e)}set(e,t){this.add(new zO(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)IO(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!ED(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),BO(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},KO={collection:`map`,default:!0,nodeClass:GO,tag:`tag:yaml.org,2002:map`,resolve(e,t){return TD(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>GO.from(e,t,n)},qO=class extends oO{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(xD,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=JO(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=JO(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&DD(r)?r.value:r}has(e){let t=JO(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=JO(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];DD(r)&&eO(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(XD(e,String(r++),t));return n}toString(e,t,n){return e?BO(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(rO(a,void 0,n))}}return i}};function JO(e){let t=DD(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var YO={collection:`seq`,default:!0,nodeClass:qO,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return OD(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>qO.from(e,t,n)},XO={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),wO(e,t,n,r)}},ZO={identify:e=>e==null,createNode:()=>new W(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new W(null),stringify:({source:e},t)=>typeof e==`string`&&ZO.test.test(e)?e:t.options.nullStr},QO={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new W(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&QO.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function $O({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var ek={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$O},tk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$O(e)}},nk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new W(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:$O},rk=e=>typeof e==`bigint`||Number.isInteger(e),ik=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function ak(e,t,n){let{value:r}=e;return rk(r)&&r>=0?n+r.toString(t):$O(e)}var ok={identify:e=>rk(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>ik(e,2,8,n),stringify:e=>ak(e,8,`0o`)},sk={identify:rk,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ik(e,0,10,n),stringify:$O},ck={identify:e=>rk(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ik(e,2,16,n),stringify:e=>ak(e,16,`0x`)},lk=[KO,YO,XO,ZO,QO,ok,sk,ck,ek,tk,nk];function uk(e){return typeof e==`bigint`||Number.isInteger(e)}var dk=({value:e})=>JSON.stringify(e),fk=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:dk},{identify:e=>e==null,createNode:()=>new W(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:dk},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:dk},{identify:uk,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>uk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:dk}],pk=[KO,YO].concat(fk,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),mk={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=W.BLOCK_LITERAL,t!==W.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===W.BLOCK_LITERAL?`
88
+ `:` `)}return wO({comment:e,type:t,value:s},r,i,a)}};function hk(e,t){if(OD(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ED(r)){if(TD(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new zO(new W(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=ED(r)?r:new zO(r)}}else t(`Expected a sequence for this tag`);return e}function gk(e,t,n){let{replacer:r}=n,i=new qO(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(RO(o,s,n))}return i}var _k={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:hk,createNode:gk},vk=class e extends qO{constructor(){super(),this.add=GO.prototype.add.bind(this),this.delete=GO.prototype.delete.bind(this),this.get=GO.prototype.get.bind(this),this.has=GO.prototype.has.bind(this),this.set=GO.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(ED(e)?(r=XD(e.key,``,t),i=XD(e.value,r,t)):r=XD(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=gk(e,t,n),i=new this;return i.items=r.items,i}};vk.tag=`tag:yaml.org,2002:omap`;var yk={collection:`seq`,identify:e=>e instanceof Map,nodeClass:vk,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=hk(e,t),r=[];for(let{key:e}of n.items)DD(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new vk,n)},createNode:(e,t,n)=>vk.from(e,t,n)};function bk({value:e,source:t},n){return t&&(e?xk:Sk).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var xk={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new W(!0),stringify:bk},Sk={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new W(!1),stringify:bk},Ck={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$O},wk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$O(e)}},Tk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new W(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:$O},Ek=e=>typeof e==`bigint`||Number.isInteger(e);function Dk(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Ok(e,t,n){let{value:r}=e;if(Ek(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return $O(e)}var kk={identify:Ek,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Dk(e,2,2,n),stringify:e=>Ok(e,2,`0b`)},Ak={identify:Ek,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Dk(e,1,8,n),stringify:e=>Ok(e,8,`0`)},jk={identify:Ek,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Dk(e,0,10,n),stringify:$O},Mk={identify:Ek,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Dk(e,2,16,n),stringify:e=>Ok(e,16,`0x`)},Nk=class e extends GO{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=ED(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new zO(e.key,null):new zO(e,null),WO(this.items,t.key)||this.items.push(t)}get(e,t){let n=WO(this.items,e);return!t&&ED(n)?DD(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=WO(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new zO(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(RO(e,null,n));return i}};Nk.tag=`tag:yaml.org,2002:set`;var Pk={collection:`map`,identify:e=>e instanceof Set,nodeClass:Nk,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Nk.from(e,t,n),resolve(e,t){if(TD(e)){if(e.hasAllNullValues(!0))return Object.assign(new Nk,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Fk(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function Ik(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return $O(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Lk={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Fk(e,n),stringify:Ik},Rk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Fk(e,!1),stringify:Ik},zk={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(zk.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Fk(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Bk=[KO,YO,XO,ZO,xk,Sk,kk,Ak,jk,Mk,Ck,wk,Tk,mk,MO,yk,_k,Pk,Lk,Rk,zk],Vk=new Map([[`core`,lk],[`failsafe`,[KO,YO,XO]],[`json`,pk],[`yaml11`,Bk],[`yaml-1.1`,Bk]]),Hk={binary:mk,bool:QO,float:nk,floatExp:tk,floatNaN:ek,floatTime:Rk,int:sk,intHex:ck,intOct:ok,intTime:Lk,map:KO,merge:MO,null:ZO,omap:yk,pairs:_k,seq:YO,set:Pk,timestamp:zk},Uk={"tag:yaml.org,2002:binary":mk,"tag:yaml.org,2002:merge":MO,"tag:yaml.org,2002:omap":yk,"tag:yaml.org,2002:pairs":_k,"tag:yaml.org,2002:set":Pk,"tag:yaml.org,2002:timestamp":zk};function Wk(e,t,n){let r=Vk.get(t);if(r&&!e)return n&&!r.includes(MO)?r.concat(MO):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(Vk.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(MO)),i.reduce((e,t)=>{let n=typeof t==`string`?Hk[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Hk).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Gk=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,Kk=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Wk(e,`compat`):e?Wk(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Uk:{},this.tags=Wk(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,vD,{value:KO}),Object.defineProperty(this,bD,{value:XO}),Object.defineProperty(this,xD,{value:YO}),this.sortMapEntries=typeof a==`function`?a:a===!0?Gk:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function qk(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=TO(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(cO(t,``))}let o=!1,s=null;if(e.contents){if(AD(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(cO(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=OO(e.contents,i,()=>s=null,t);s&&(c+=lO(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(OO(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
89
+ `)?(n.push(`...`),n.push(cO(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(cO(a(t),``)))}return n.join(`
90
+ `)+`
91
+ `}var Jk=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,SD,{value:_D});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new WD({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[SD]:{value:_D}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=AD(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Yk(this.contents)&&this.contents.add(e)}addIn(e,t){Yk(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=KD(this);e.anchor=!t||n.has(t)?qD(t||`a`,n):t}return new QD(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=JD(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=rO(e,l,p);return o&&kD(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new zO(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Yk(this.contents)?this.contents.delete(e):!1}deleteIn(e){return aO(e)?this.contents==null?!1:(this.contents=null,!0):Yk(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return kD(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return aO(e)?!t&&DD(this.contents)?this.contents.value:this.contents:kD(this.contents)?this.contents.getIn(e,t):void 0}has(e){return kD(this.contents)?this.contents.has(e):!1}hasIn(e){return aO(e)?this.contents!==void 0:kD(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=iO(this.schema,[e],t):Yk(this.contents)&&this.contents.set(e,t)}setIn(e,t){aO(e)?this.contents=t:this.contents==null?this.contents=iO(this.schema,Array.from(e),t):Yk(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new WD({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new WD({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Kk(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=XD(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?YD(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return qk(this,e)}};function Yk(e){if(kD(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Xk=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Zk=class extends Xk{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Qk=class extends Xk{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},$k=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
92
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function eA(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function tA(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
93
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(tA(t.key)||tA(t.value))return!0}return!1;default:return!0}}function nA(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&tA(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function rA(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||DD(e)&&DD(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var iA=`All mapping items must start at the same column`;function aA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??GO)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=eA(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,iA)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
94
+ `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||tA(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,iA);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&nA(r.indent,u,i),n.atKey=!1,rA(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=eA(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&nA(r.indent,f,i),s=c.range[2];let l=new zO(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
95
+ `+_.comment:g.comment=_.comment);let e=new zO(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function oA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??qO)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=eA(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&nA(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function sA(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var cA=`Block collections are not allowed within flow collections`,lA=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function uA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?GO:qO))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=eA(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
96
+ `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&tA(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];ED(t)&&(t=t.value??t.key),t.comment?t.comment+=`
97
+ `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],lA(m)&&i(r.range,`BLOCK_IN_FLOW`,cA)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);lA(f)&&i(g.range,`BLOCK_IN_FLOW`,cA),n.atKey=!1;let _=eA(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?lA(m)&&i(v.range,`BLOCK_IN_FLOW`,cA):_.comment&&(g.comment?g.comment+=`
98
+ `+_.comment:g.comment=_.comment);let y=new zO(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;rA(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new GO(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=sA(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
99
+ `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function dA(e,t,n,r,i,a){let o=n.type===`block-map`?aA(e,t,n,r,a):n.type===`block-seq`?oA(e,t,n,r,a):uA(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function fA(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===GO.tagName&&s===`map`||o===qO.tagName&&s===`seq`)return dA(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),dA(e,t,n,i,o)}let l=dA(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=AD(u)?u:new W(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function pA(e,t,n){let r=t.offset,i=mA(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?W.BLOCK_FOLDED:W.BLOCK_LITERAL,o=t.source?hA(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
100
+ `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
101
+ `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===W.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
102
+ `):t.length>c||r[0]===` `?(f===` `?f=`
103
+ `:!p&&f===`
104
+ `&&(f=`
105
+
106
+ `),d+=f+t.slice(c)+r,f=`
107
+ `,p=!0):r===``?f===`
108
+ `?d+=`
109
+ `:f=`
110
+ `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
111
+ `+o[e][0].slice(c);d[d.length-1]!==`
112
+ `&&(d+=`
113
+ `);break;default:d+=`
114
+ `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function mA({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function hA(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function gA(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=W.PLAIN,c=_A(a,l);break;case`single-quoted-scalar`:s=W.QUOTE_SINGLE,c=vA(a,l);break;case`double-quoted-scalar`:s=W.QUOTE_DOUBLE,c=bA(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=sA(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function _A(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),yA(e)}function vA(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),yA(e.slice(1,-1)).replace(/''/g,`'`)}function yA(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
115
+ `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
116
+ `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
117
+ `?i+=a:a=`
118
+ `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function bA(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
119
+ `))if(i===`
120
+ `){let{fold:t,offset:i}=xA(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=SA[i];if(a)n+=a;else if(i===`
121
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
122
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=CA(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
123
+ `&&!(a===`\r`&&e[r+2]===`
124
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function xA(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
125
+ `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
126
+ `);)r===`
127
+ `&&(n+=`
128
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var SA={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
129
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function CA(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function wA(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?pA(e,t,r):gA(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[bD]:c?TA(e.schema,i,c,n,r):t.type===`scalar`?EA(e,i,t,r):e.schema[bD];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=DD(a)?a:new W(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new W(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function TA(e,t,n,r,i){if(n===`!`)return e[bD];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[bD])}function EA({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[bD];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[bD];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function DA(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var OA={composeNode:kA,composeEmptyNode:AA};function kA(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=jA(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=wA(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:l=fA(OA,e,t,n,r),s&&(l.anchor=s.source.substring(1));break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),l=AA(e,t.offset,void 0,null,n,r),u=!1}return s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!DD(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function AA(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=wA(e,{type:`scalar`,offset:DA(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function jA({options:e},{offset:t,source:n,end:r},i){let a=new QD(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=sA(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function MA(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Jk(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=eA(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?kA(c,i,l,o):AA(c,l.end,r,null,l,o);let u=s.contents.range[2],d=sA(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function NA(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function PA(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
130
+
131
+ `:`
132
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var FA=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=NA(e);r?this.warnings.push(new Qk(i,t,n)):this.errors.push(new Zk(i,t,n))},this.directives=new WD({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=PA(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(kD(i)&&!i.flow&&i.items.length>0){let e=i.items[0];ED(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:PA(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=NA(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=MA(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Zk(NA(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Zk(NA(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=sA(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Zk(NA(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Jk(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},IA=Symbol(`break visit`),LA=Symbol(`skip children`),RA=Symbol(`remove item`);function zA(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),BA(Object.freeze([]),e,t)}zA.BREAK=IA,zA.SKIP=LA,zA.REMOVE=RA,zA.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},zA.parentCollection=(e,t)=>{let n=zA.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function BA(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=BA(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===IA)return IA;else r===RA&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function VA(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
133
+ `:case`\r
134
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function HA(e){switch(e){case void 0:case` `:case`
135
+ `:case`\r`:case` `:return!0;default:return!1}}var UA=new Set(`0123456789ABCDEFabcdef`),WA=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),GA=new Set(`,[]{}`),KA=new Set(` ,[]{}
136
+ \r `),qA=e=>!e||KA.has(e),JA=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
137
+ `?!0:t===`\r`?this.buffer[e+1]===`
138
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
139
+ `||!t&&!this.atEnd)return e+n+1}return t===`
140
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&HA(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
141
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&HA(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!HA(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&HA(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(qA),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&HA(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(qA),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||HA(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
142
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
143
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>HA(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
144
+ `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
145
+ `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
146
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
147
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
148
+ `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(HA(r)||e&&GA.has(r))break;t=n}else if(HA(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
149
+ `?(n+=1,r=`
150
+ `,i=this.buffer[n+1]):t=n),i===`#`||e&&GA.has(i))break;if(r===`
151
+ `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&GA.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(qA))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(HA(t)||e&&GA.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!HA(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(WA.has(t))t=this.buffer[++e];else if(t===`%`&&UA.has(this.buffer[e+1])&&UA.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
152
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
153
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},YA=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function XA(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ZA(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function QA(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function $A(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function ej(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function tj(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!XA(t.start,`explicit-key-ind`)&&!XA(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,QA(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var nj=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new JA,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=VA(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&tj(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&ZA(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:ZA(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=ej($A(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
154
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
155
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(XA(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=ej(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(XA(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(QA(t.key)&&!XA(t.sep,`newline`)){let e=ej(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):XA(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!XA(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||XA(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=ej($A(t));tj(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
156
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
157
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=ej($A(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=ej($A(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function rj(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new YA||null,prettyErrors:t}}function ij(e,t={}){let{lineCounter:n,prettyErrors:r}=rj(t),i=new nj(n?.addNewLine),a=new FA(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Zk(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach($k(e,n)),o.warnings.forEach($k(e,n))),o}function aj(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return wD(e)&&!r?e.toString(n):new Jk(e,r,n).toString(n)}function oj(){return e=>{for(let t of e.children??[])t.type===`yaml`&&(t.type=`frontmatter`,t.data={...t.data,hName:`div`,hProperties:{"data-frontmatter":t.value??``},hChildren:[]})}}function sj(e){try{let t=ij(e,{uniqueKeys:!0});if(t.errors.length||t.warnings.length)return null;let n=t.toJS({maxAliasCount:50});return!n||typeof n!=`object`||Array.isArray(n)?null:(JSON.stringify(n),Object.entries(n).map(([e,t])=>[e,t===null?`null`:typeof t==`object`?aj(t).trimEnd():String(t)]))}catch{return null}}function cj({open:e,children:t}){let n=(0,k.useRef)(null),r=(0,k.useRef)(null),i=(0,k.useRef)(!1),[a,o]=(0,k.useState)(e);return e&&!a&&o(!0),(0,k.useLayoutEffect)(()=>{let t=n.current,a=r.current;if(!t||!a)return;let s=!i.current;i.current=!0,t.inert=!e;let c=()=>{t.style.height=e?`auto`:`0px`,t.style.opacity=e?`1`:`0`,o(e)};if(s||typeof t.animate!=`function`||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){c();return}let l=null,u=performance.now()+200,d=e?a.getBoundingClientRect().height:0,f=(n,r)=>{let i=n===0?0:Number(getComputedStyle(t).opacity);l&&(l.onfinish=null,l.cancel()),t.style.height=`${n}px`,l=t.animate([{height:`${n}px`,opacity:i},{height:`${r}px`,opacity:e?1:0}],{duration:Math.max(0,u-performance.now()),easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`both`}),l.onfinish=()=>{c(),l?.cancel(),l=null}};f(t.getBoundingClientRect().height,d);let p=e&&typeof ResizeObserver<`u`?new ResizeObserver(()=>{if(!l)return;let e=a.getBoundingClientRect().height;if(Math.abs(e-d)<.5)return;let n=t.getBoundingClientRect().height;d=e,f(n,e)}):null;return p?.observe(a),()=>{p?.disconnect(),t.style.height=`${t.getBoundingClientRect().height}px`,t.style.opacity=getComputedStyle(t).opacity,l&&(l.onfinish=null,l.cancel())}},[e]),(0,A.jsx)(`div`,{ref:n,"aria-hidden":!e,style:{height:0,overflow:`hidden`},children:(0,A.jsx)(`div`,{ref:r,className:`flow-root min-w-0`,children:e||a?t():null})})}function lj({source:e,label:t}){let n=(0,k.useMemo)(()=>sj(e),[e]),[r,i]=(0,k.useState)(!0),a=(0,k.useId)();return(0,A.jsxs)(`div`,{className:`group/frontmatter not-prose mb-3 mt-0 overflow-hidden rounded-lg border border-border text-xs leading-5`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),className:`flex min-h-9 w-full cursor-pointer items-center gap-1.5 px-3 py-1.5 text-left font-medium text-muted-foreground hover:bg-[var(--interaction-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px]`,children:[(0,A.jsx)(We,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 transition-transform duration-200 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none`,style:{transform:r?`rotate(90deg)`:`rotate(0deg)`}}),t]}),(0,A.jsx)(`div`,{id:a,children:(0,A.jsx)(cj,{open:r,children:()=>(0,A.jsx)(`div`,{className:`max-h-80 overflow-auto border-t border-border px-3 py-2`,children:n?.length?(0,A.jsx)(`dl`,{className:`m-0 grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] gap-x-3 gap-y-1`,children:n.map(([e,t])=>(0,A.jsxs)(`div`,{className:`contents`,children:[(0,A.jsx)(`dt`,{className:`break-words text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap break-words text-foreground`,children:t})]},e))}):(0,A.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words font-mono text-xs text-foreground`,children:e})})})})]})}function uj(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function dj(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
158
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(qw(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
159
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
160
+ `),i&&(c+=a.move(i+`
161
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var fj={tokenize:mj,concrete:!0,name:`mathFlow`},pj={tokenize:hj,partial:!0};function mj(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),U(e,l,`whitespace`)(t))}function l(t){return t===null||V(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(pj,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?U(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):V(t)?e.attempt(pj,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||V(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),U(e,c,`whitespace`)(t))}function c(r){return r===null||V(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function hj(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function gj(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:_j,previous:vj,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||V(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function _j(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===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,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=`mathTextData`,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 vj(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function yj(e){return{flow:{36:fj},text:{36:gj(e)}}}var bj={};function xj(e){let t=this,n=e||bj,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yj(n)),a.push(uj()),o.push(dj(n))}var Sj=/[#.]/g;function Cj(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Sj.lastIndex=i;let e=Sj.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function wj(e,t,n){let r=n?Aj(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Cj(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Tj(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Ej(e,o.properties,t,n)}for(let e of a)Dj(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Tj(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Ej(e,t,n,r){let i=G_(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?X_(r):i.commaSeparated?c_(r):i.commaOrSpaceSeparated?X_(c_(r).join(` `)):Oj(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?kj(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Oj(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Dj(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)Dj(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Dj(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function Oj(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||y_(n)===y_(t)))return!0}return n}function kj(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Aj(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var jj=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Mj=wj(J_,`div`),Nj=wj(Y_,`g`,jj),Pj={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Fj(e,t){return Ij(e,t||{})||{type:`root`,children:[]}}function Ij(e,t){let n=Lj(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Lj(e,t){switch(e.nodeType){case 1:return Hj(e,t);case 3:return Bj(e);case 8:return Vj(e);case 9:return Rj(e,t);case 10:return zj();case 11:return Rj(e,t);default:return}}function Rj(e,t){return{type:`root`,children:Uj(e,t)}}function zj(){return{type:`doctype`}}function Bj(e){return{type:`text`,value:e.nodeValue||``}}function Vj(e){return{type:`comment`,value:e.nodeValue||``}}function Hj(e,t){let n=e.namespaceURI,r=n===Pj.svg?Nj:Mj,i=n===Pj.html?e.tagName.toLowerCase():e.tagName,a=n===Pj.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,Uj(a,t))}function Uj(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=Ij(n[i],t);e!==void 0&&r.push(e)}return r}var Wj=new DOMParser;function Gj(e,t){return Fj(t?.fragment?Kj(e):Wj.parseFromString(e,`text/html`))}function Kj(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var qj=(function(e,t,n){let r=MS(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Jj=(function(e){if(e==null)return Qj;if(typeof e==`string`)return Xj(e);if(typeof e==`object`)return Yj(e);if(typeof e==`function`)return Zj(e);throw Error("Expected function, string, or array as `test`")});function Yj(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Jj(e[n]);return Zj(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Xj(e){return Zj(t);function t(t){return t.tagName===e}}function Zj(e){return t;function t(t,n,r){return!!($j(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Qj(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function $j(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var eM=/\n/g,tM=/[\t ]+/g,nM=Jj(`br`),rM=Jj(gM),iM=Jj(`p`),aM=Jj(`tr`),oM=Jj([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,hM,_M]),sM=Jj(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function cM(e,t){let n=t||{},r=`children`in e?e.children:[],i=sM(e),a=mM(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...dM(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...lM(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?nM(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
162
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function lM(e,t,n){return e.type===`element`?uM(e,t,n):e.type===`text`?n.whitespace===`normal`?dM(e,n):fM(e):[]}function uM(e,t,n){let r=mM(e,n),i=e.children||[],a=-1,o=[];if(oM(e))return o;let s,c;for(nM(e)||aM(e)&&qj(t,e,aM)?c=`
163
+ `:iM(e)?(s=2,c=2):sM(e)&&(s=1,c=1);++a<i.length;)o=o.concat(lM(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?nM(i[a+1]):c}));return rM(e)&&qj(t,e,rM)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function dM(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){eM.lastIndex=a;let e=eM.exec(n),i=e&&`index`in e?e.index:n.length;r.push(pM(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function fM(e){return[String(e.value)]}function pM(e,t,n){let r=[],i=0,a;for(;i<e.length;){tM.lastIndex=i;let n=tM.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function mM(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function hM(e){return!!(e.properties||{}).hidden}function gM(e){return e.tagName===`td`||e.tagName===`th`}function _M(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var vM={},yM=[];function bM(e){let t=e||vM;return function(e,n){HS(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:yM,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=cM(u,{whitespace:`pre`}),f;try{f=Pe.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=Pe.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=Gj(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),VS})}}function xM(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=SM(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=SM(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function SM(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
164
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var CM={}.hasOwnProperty,wM=Object.prototype;function TM(e,t){let n=t||{};return EM({file:n.file||void 0,location:!1,schema:n.space===`svg`?Y_:J_,verbose:n.verbose||!1},e)}function EM(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},kM(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:DM(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=xM(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},kM(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},kM(e,r,n),n}default:return n=OM(e,t),n}}function DM(e,t){let n=-1,r=[];for(;++n<t.length;){let i=EM(e,t[n]);r.push(i)}return r}function OM(e,t){let n=e.schema;e.schema=t.namespaceURI===Pj.svg?Y_:J_;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;CM.call(wM,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Nj:Mj)(t.tagName,i,DM(e,t.childNodes));if(kM(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&jM(r.startTag),o=r&&r.endTag&&jM(r.endTag),s=EM(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function kM(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=AM(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function AM(e,t,n){let r=jM(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)CM.call(n.attrs,i)&&(r[G_(e.schema,i).property]=jM(n.attrs[i]));n.startTag;let a=jM(n.startTag),o=n.endTag?jM(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function jM(e){let t=MM({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=MM({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function MM(e){return e.line&&e.column?e:void 0}var NM={},PM={}.hasOwnProperty,FM=Vw(`type`,{handlers:{root:LM,element:HM,text:BM,comment:VM,doctype:zM}});function IM(e,t){let n=(t||NM).space;return FM(e,n===`svg`?Y_:J_)}function LM(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=WM(e.children,n,t),GM(e,n),n}function RM(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=WM(e.children,n,t),GM(e,n),n}function zM(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return GM(e,t),t}function BM(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return GM(e,t),t}function VM(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return GM(e,t),t}function HM(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=Y_);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&PM.call(e.properties,a)){let t=UM(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Pj[o],childNodes:[],parentNode:null};return s.childNodes=WM(e.children,s,r),GM(e,s),e.tagName===`template`&&e.content&&(s.content=RM(e.content,r)),s}function UM(e,t,n){let r=G_(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?l_(n):Z_(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Pj[r.space]}return i}function WM(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=FM(e[r],n);a.parentNode=t,i.push(a)}return i}function GM(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var KM=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],qM=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),G;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(G||={});var JM={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function YM(e){return e>=55296&&e<=57343}function XM(e){return e>=56320&&e<=57343}function ZM(e,t){return(e-55296)*1024+9216+t}function QM(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $M(e){return e>=64976&&e<=65007||qM.has(e)}var K;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(K||={});var eN=65536,tN=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=eN,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(XM(t))return this.pos++,this._addGap(),ZM(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(K.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let n=this.html.charCodeAt(t);return n===G.CARRIAGE_RETURN?G.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let e=this.html.charCodeAt(this.pos);return e===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):e===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,YM(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===G.LINE_FEED||e===G.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){QM(e)?this._err(K.controlCharacterInInputStream):$M(e)&&this._err(K.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},q;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(q||={});function nN(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var rN=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肻\xA0ଷ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))),iN=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]]);String.fromCodePoint;function aN(e){return e>=55296&&e<=57343||e>1114111?65533:iN.get(e)??e}var oN;(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`})(oN||={});var sN=32,cN;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(cN||={});function lN(e){return e>=oN.ZERO&&e<=oN.NINE}function uN(e){return e>=oN.UPPER_A&&e<=oN.UPPER_F||e>=oN.LOWER_A&&e<=oN.LOWER_F}function dN(e){return e>=oN.UPPER_A&&e<=oN.UPPER_Z||e>=oN.LOWER_A&&e<=oN.LOWER_Z||lN(e)}function fN(e){return e===oN.EQUALS||dN(e)}var pN;(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`})(pN||={});var mN;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(mN||={});var hN=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=pN.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=mN.Strict}startEntity(e){this.decodeMode=e,this.state=pN.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case pN.EntityStart:return e.charCodeAt(t)===oN.NUM?(this.state=pN.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=pN.NamedEntity,this.stateNamedEntity(e,t));case pN.NumericStart:return this.stateNumericStart(e,t);case pN.NumericDecimal:return this.stateNumericDecimal(e,t);case pN.NumericHex:return this.stateNumericHex(e,t);case pN.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|sN)===oN.LOWER_X?(this.state=pN.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=pN.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(lN(r)||uN(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(lN(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===oN.SEMI)this.consumed+=1;else if(this.decodeMode===mN.Strict)return 0;return this.emitCodePoint(aN(this.result),this.consumed),this.errors&&(e!==oN.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&cN.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=gN(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===mN.Attribute&&(i===0||fN(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&cN.VALUE_LENGTH)>>14,i!==0){if(a===oN.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==mN.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&cN.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~cN.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case pN.NamedEntity:return this.result!==0&&(this.decodeMode!==mN.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pN.NumericDecimal:return this.emitNumericEntity(0,2);case pN.NumericHex:return this.emitNumericEntity(0,3);case pN.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pN.EntityStart:return 0}}};function gN(e,t,n,r){let i=(t&cN.BRANCH_LENGTH)>>7,a=t&cN.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var J;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(J||={});var _N;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(_N||={});var vN;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(vN||={});var Y;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(Y||={});var X;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(X||={});var yN=new Map([[Y.A,X.A],[Y.ADDRESS,X.ADDRESS],[Y.ANNOTATION_XML,X.ANNOTATION_XML],[Y.APPLET,X.APPLET],[Y.AREA,X.AREA],[Y.ARTICLE,X.ARTICLE],[Y.ASIDE,X.ASIDE],[Y.B,X.B],[Y.BASE,X.BASE],[Y.BASEFONT,X.BASEFONT],[Y.BGSOUND,X.BGSOUND],[Y.BIG,X.BIG],[Y.BLOCKQUOTE,X.BLOCKQUOTE],[Y.BODY,X.BODY],[Y.BR,X.BR],[Y.BUTTON,X.BUTTON],[Y.CAPTION,X.CAPTION],[Y.CENTER,X.CENTER],[Y.CODE,X.CODE],[Y.COL,X.COL],[Y.COLGROUP,X.COLGROUP],[Y.DD,X.DD],[Y.DESC,X.DESC],[Y.DETAILS,X.DETAILS],[Y.DIALOG,X.DIALOG],[Y.DIR,X.DIR],[Y.DIV,X.DIV],[Y.DL,X.DL],[Y.DT,X.DT],[Y.EM,X.EM],[Y.EMBED,X.EMBED],[Y.FIELDSET,X.FIELDSET],[Y.FIGCAPTION,X.FIGCAPTION],[Y.FIGURE,X.FIGURE],[Y.FONT,X.FONT],[Y.FOOTER,X.FOOTER],[Y.FOREIGN_OBJECT,X.FOREIGN_OBJECT],[Y.FORM,X.FORM],[Y.FRAME,X.FRAME],[Y.FRAMESET,X.FRAMESET],[Y.H1,X.H1],[Y.H2,X.H2],[Y.H3,X.H3],[Y.H4,X.H4],[Y.H5,X.H5],[Y.H6,X.H6],[Y.HEAD,X.HEAD],[Y.HEADER,X.HEADER],[Y.HGROUP,X.HGROUP],[Y.HR,X.HR],[Y.HTML,X.HTML],[Y.I,X.I],[Y.IMG,X.IMG],[Y.IMAGE,X.IMAGE],[Y.INPUT,X.INPUT],[Y.IFRAME,X.IFRAME],[Y.KEYGEN,X.KEYGEN],[Y.LABEL,X.LABEL],[Y.LI,X.LI],[Y.LINK,X.LINK],[Y.LISTING,X.LISTING],[Y.MAIN,X.MAIN],[Y.MALIGNMARK,X.MALIGNMARK],[Y.MARQUEE,X.MARQUEE],[Y.MATH,X.MATH],[Y.MENU,X.MENU],[Y.META,X.META],[Y.MGLYPH,X.MGLYPH],[Y.MI,X.MI],[Y.MO,X.MO],[Y.MN,X.MN],[Y.MS,X.MS],[Y.MTEXT,X.MTEXT],[Y.NAV,X.NAV],[Y.NOBR,X.NOBR],[Y.NOFRAMES,X.NOFRAMES],[Y.NOEMBED,X.NOEMBED],[Y.NOSCRIPT,X.NOSCRIPT],[Y.OBJECT,X.OBJECT],[Y.OL,X.OL],[Y.OPTGROUP,X.OPTGROUP],[Y.OPTION,X.OPTION],[Y.P,X.P],[Y.PARAM,X.PARAM],[Y.PLAINTEXT,X.PLAINTEXT],[Y.PRE,X.PRE],[Y.RB,X.RB],[Y.RP,X.RP],[Y.RT,X.RT],[Y.RTC,X.RTC],[Y.RUBY,X.RUBY],[Y.S,X.S],[Y.SCRIPT,X.SCRIPT],[Y.SEARCH,X.SEARCH],[Y.SECTION,X.SECTION],[Y.SELECT,X.SELECT],[Y.SOURCE,X.SOURCE],[Y.SMALL,X.SMALL],[Y.SPAN,X.SPAN],[Y.STRIKE,X.STRIKE],[Y.STRONG,X.STRONG],[Y.STYLE,X.STYLE],[Y.SUB,X.SUB],[Y.SUMMARY,X.SUMMARY],[Y.SUP,X.SUP],[Y.TABLE,X.TABLE],[Y.TBODY,X.TBODY],[Y.TEMPLATE,X.TEMPLATE],[Y.TEXTAREA,X.TEXTAREA],[Y.TFOOT,X.TFOOT],[Y.TD,X.TD],[Y.TH,X.TH],[Y.THEAD,X.THEAD],[Y.TITLE,X.TITLE],[Y.TR,X.TR],[Y.TRACK,X.TRACK],[Y.TT,X.TT],[Y.U,X.U],[Y.UL,X.UL],[Y.SVG,X.SVG],[Y.VAR,X.VAR],[Y.WBR,X.WBR],[Y.XMP,X.XMP]]);function bN(e){return yN.get(e)??X.UNKNOWN}var Z=X,xN={[J.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[J.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[J.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[J.XLINK]:new Set,[J.XML]:new Set,[J.XMLNS]:new Set},SN=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);new Set([Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT]);var Q;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Q||={});var CN={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function wN(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function TN(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function EN(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function DN(e){return EN(e)||TN(e)}function ON(e){return DN(e)||wN(e)}function kN(e){return e+32}function AN(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function jN(e){return AN(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function MN(e){return e===G.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:YM(e)?K.surrogateCharacterReference:$M(e)?K.noncharacterCharacterReference:QM(e)||e===G.CARRIAGE_RETURN?K.controlCharacterReference:null}var NN=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new tN(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new hN(rN,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=MN(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:q.START_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:q.END_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:q.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:q.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(nN(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(K.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=bN(e.tagName),e.type===q.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(K.endTagWithAttributes),e.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case q.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case q.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case q.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:q.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=AN(e)?q.WHITESPACE_CHARACTER:e===G.NULL?q.NULL_CHARACTER:q.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(q.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?mN.Attribute:mN.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitCodePoint(e);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case G.AMPERSAND:this._startCharacterReference();break;case G.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(DN(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case G.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case G.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case G.QUESTION_MARK:this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(DN(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case G.GREATER_THAN_SIGN:this._err(K.missingEndTagName),this.state=Q.DATA;break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.tagName+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(TN(e)?kN(e):e)}}_stateRcdataLessThanSign(e){e===G.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){DN(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case G.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case G.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===G.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){DN(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case G.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case G.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){DN(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===G.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===G.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===G.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:DN(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){DN(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(JM.SCRIPT,!1)&&jN(this.preprocessor.peek(JM.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<JM.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===G.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(JM.SCRIPT,!1)&&jN(this.preprocessor.peek(JM.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<JM.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._err(K.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:this._err(K.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(TN(e)?kN(e):e)}}_stateAfterAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case G.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case G.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case G.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.AMPERSAND:this._startCharacterReference();break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:case G.EQUALS_SIGN:case G.GRAVE_ACCENT:this._err(K.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case G.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(JM.DASH_DASH,!0)?(this._createCommentToken(JM.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(JM.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(JM.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(JM.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(K.cdataInHtmlContent),this._createCommentToken(JM.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(K.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case G.GREATER_THAN_SIGN:{this._err(K.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case G.GREATER_THAN_SIGN:this._err(K.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case G.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case G.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case G.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===G.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===G.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==G.GREATER_THAN_SIGN&&e!==G.EOF&&this._err(K.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case G.HYPHEN_MINUS:t.data+=`-`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case G.GREATER_THAN_SIGN:this._err(K.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(K.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(TN(e))this._createDoctypeToken(String.fromCharCode(kN(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.NULL:this._err(K.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:{this._err(K.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.NULL:this._err(K.unexpectedNullCharacter),t.name+=`�`;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(TN(e)?kN(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(JM.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(JM.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(K.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.NULL:this._err(K.unexpectedNullCharacter);break;case G.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case G.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case G.EOF:this._err(K.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===G.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA;break;case G.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(G.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ON(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ON(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===G.SEMICOLON&&this._err(K.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},PN=new Set([X.DD,X.DT,X.LI,X.OPTGROUP,X.OPTION,X.P,X.RB,X.RP,X.RT,X.RTC]),FN=new Set([...PN,X.CAPTION,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]),IN=new Set([X.APPLET,X.CAPTION,X.HTML,X.MARQUEE,X.OBJECT,X.TABLE,X.TD,X.TEMPLATE,X.TH]),LN=new Set([...IN,X.OL,X.UL]),RN=new Set([...IN,X.BUTTON]),zN=new Set([X.ANNOTATION_XML,X.MI,X.MN,X.MO,X.MS,X.MTEXT]),BN=new Set([X.DESC,X.FOREIGN_OBJECT,X.TITLE]),VN=new Set([X.TR,X.TEMPLATE,X.HTML]),HN=new Set([X.TBODY,X.TFOOT,X.THEAD,X.TEMPLATE,X.HTML]),UN=new Set([X.TABLE,X.TEMPLATE,X.HTML]),WN=new Set([X.TD,X.TH]),GN=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=X.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===X.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===J.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==J.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(SN,J.HTML)}popUntilTableCellPopped(){this.popUntilPopped(WN,J.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(UN,J.HTML)}clearBackToTableBodyContext(){this.clearBackTo(HN,J.HTML)}clearBackToTableRowContext(){this.clearBackTo(VN,J.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===X.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===X.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case J.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case J.SVG:if(BN.has(r))return!1;break;case J.MATHML:if(zN.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,IN)}hasInListItemScope(e){return this.hasInDynamicScope(e,LN)}hasInButtonScope(e){return this.hasInDynamicScope(e,RN)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case J.HTML:if(SN.has(t))return!0;if(IN.has(t))return!1;break;case J.SVG:if(BN.has(t))return!1;break;case J.MATHML:if(zN.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===J.HTML)switch(this.tagIDs[e]){case X.TBODY:case X.THEAD:case X.TFOOT:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.OPTION:case X.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&PN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&FN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&FN.has(this.currentTagId);)this.pop()}},KN=3,qN;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(qN||={});var JN={type:qN.Marker},YN=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===qN.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<KN)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<KN)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=KN&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(JN)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:qN.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:qN.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(JN);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===qN.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===qN.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===qN.Element&&t.element===e)}},XN={createDocument(){return{nodeName:`#document`,mode:vN.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};XN.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(XN.isTextNode(n)){n.value+=t;return}}XN.appendChild(e,XN.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&XN.isTextNode(r)?r.value+=t:XN.insertBefore(e,XN.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},ZN=`html`,QN=`about:legacy-compat`,$N=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,eP=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),tP=[...eP,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],nP=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),rP=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],iP=[...rP,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function aP(e,t){return t.some(t=>e.startsWith(t))}function oP(e){return e.name===ZN&&e.publicId===null&&(e.systemId===null||e.systemId===QN)}function sP(e){if(e.name!==ZN)return vN.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===$N)return vN.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),nP.has(n))return vN.QUIRKS;let e=t===null?tP:eP;if(aP(n,e))return vN.QUIRKS;if(e=t===null?rP:iP,aP(n,e))return vN.LIMITED_QUIRKS}return vN.NO_QUIRKS}var cP={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},lP=`definitionurl`,uP=`definitionURL`,dP=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),fP=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:J.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:J.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:J.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:J.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:J.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:J.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:J.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:J.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:J.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:J.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:J.XMLNS}]]),pP=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),mP=new Set([X.B,X.BIG,X.BLOCKQUOTE,X.BODY,X.BR,X.CENTER,X.CODE,X.DD,X.DIV,X.DL,X.DT,X.EM,X.EMBED,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HR,X.I,X.IMG,X.LI,X.LISTING,X.MENU,X.META,X.NOBR,X.OL,X.P,X.PRE,X.RUBY,X.S,X.SMALL,X.SPAN,X.STRONG,X.STRIKE,X.SUB,X.SUP,X.TABLE,X.TT,X.U,X.UL,X.VAR]);function hP(e){let t=e.tagID;return t===X.FONT&&e.attrs.some(({name:e})=>e===_N.COLOR||e===_N.SIZE||e===_N.FACE)||mP.has(t)}function gP(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===lP){e.attrs[t].name=uP;break}}function _P(e){for(let t=0;t<e.attrs.length;t++){let n=dP.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function vP(e){for(let t=0;t<e.attrs.length;t++){let n=fP.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function yP(e){let t=pP.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=bN(e.tagName))}function bP(e,t){return t===J.MATHML&&(e===X.MI||e===X.MO||e===X.MN||e===X.MS||e===X.MTEXT)}function xP(e,t,n){if(t===J.MATHML&&e===X.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===_N.ENCODING){let t=n[e].value.toLowerCase();return t===cP.TEXT_HTML||t===cP.APPLICATION_XML}}return t===J.SVG&&(e===X.FOREIGN_OBJECT||e===X.DESC||e===X.TITLE)}function SP(e,t,n,r){return(!r||r===J.HTML)&&xP(e,t,n)||(!r||r===J.MATHML)&&bP(e,t)}var CP=`hidden`,wP=8,TP=3,$;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})($||={});var EP={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},DP=new Set([X.TABLE,X.TBODY,X.TFOOT,X.THEAD,X.TR]),OP={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:XN,onParseError:null},kP=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...OP,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new NN(this.options,this),this.activeFormattingElements=new YN(this.treeAdapter),this.fragmentContextID=n?bN(this.treeAdapter.getTagName(n)):X.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new GN(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...OP,...t};e??=n.treeAdapter.createElement(Y.TEMPLATE,J.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,J.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===X.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??EP,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===J.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,J.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=CN.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==J.HTML))switch(this.fragmentContextID){case X.TITLE:case X.TEXTAREA:this.tokenizer.state=CN.RCDATA;break;case X.STYLE:case X.XMP:case X.IFRAME:case X.NOEMBED:case X.NOFRAMES:case X.NOSCRIPT:this.tokenizer.state=CN.RAWTEXT;break;case X.SCRIPT:this.tokenizer.state=CN.SCRIPT_DATA;break;case X.PLAINTEXT:this.tokenizer.state=CN.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,J.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,J.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(Y.HTML,J.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,X.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===q.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===X.SVG&&this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===J.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===X.MGLYPH||e.tagID===X.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,J.HTML)}_processToken(e){switch(e.type){case q.CHARACTER:this.onCharacter(e);break;case q.NULL_CHARACTER:this.onNullCharacter(e);break;case q.COMMENT:this.onComment(e);break;case q.DOCTYPE:this.onDoctype(e);break;case q.START_TAG:this._processStartTag(e);break;case q.END_TAG:this.onEndTag(e);break;case q.EOF:this.onEof(e);break;case q.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return SP(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===qN.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(X.P),this.openElements.popUntilTagNamePopped(X.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case X.TR:this.insertionMode=$.IN_ROW;return;case X.TBODY:case X.THEAD:case X.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case X.CAPTION:this.insertionMode=$.IN_CAPTION;return;case X.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case X.TABLE:this.insertionMode=$.IN_TABLE;return;case X.BODY:this.insertionMode=$.IN_BODY;return;case X.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case X.SELECT:this._resetInsertionModeForSelect(e);return;case X.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case X.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case X.TD:case X.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case X.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}break}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===X.TEMPLATE)break;if(e===X.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return DP.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case X.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===J.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case X.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return xN[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){qI(this,e);return}switch(this.insertionMode){case $.INITIAL:HP(this,e);break;case $.BEFORE_HTML:GP(this,e);break;case $.BEFORE_HEAD:JP(this,e);break;case $.IN_HEAD:QP(this,e);break;case $.IN_HEAD_NO_SCRIPT:tF(this,e);break;case $.AFTER_HEAD:iF(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:sF(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:nI(this,e);break;case $.IN_TABLE_TEXT:hI(this,e);break;case $.IN_COLUMN_GROUP:SI(this,e);break;case $.AFTER_BODY:RI(this,e);break;case $.AFTER_AFTER_BODY:WI(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){KI(this,e);return}switch(this.insertionMode){case $.INITIAL:HP(this,e);break;case $.BEFORE_HTML:GP(this,e);break;case $.BEFORE_HEAD:JP(this,e);break;case $.IN_HEAD:QP(this,e);break;case $.IN_HEAD_NO_SCRIPT:tF(this,e);break;case $.AFTER_HEAD:iF(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:nI(this,e);break;case $.IN_COLUMN_GROUP:SI(this,e);break;case $.AFTER_BODY:RI(this,e);break;case $.AFTER_AFTER_BODY:WI(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){LP(this,e);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:LP(this,e);break;case $.IN_TABLE_TEXT:gI(this,e);break;case $.AFTER_BODY:RP(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:zP(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:VP(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,K.misplacedDoctype);break;case $.IN_TABLE_TEXT:gI(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?YI(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:HP(this,e);break;case $.BEFORE_HTML:UP(this,e);break;case $.BEFORE_HEAD:KP(this,e);break;case $.IN_HEAD:YP(this,e);break;case $.IN_HEAD_NO_SCRIPT:$P(this,e);break;case $.AFTER_HEAD:nF(this,e);break;case $.IN_BODY:BF(this,e);break;case $.IN_TABLE:dI(this,e);break;case $.IN_TABLE_TEXT:gI(this,e);break;case $.IN_CAPTION:vI(this,e);break;case $.IN_COLUMN_GROUP:bI(this,e);break;case $.IN_TABLE_BODY:CI(this,e);break;case $.IN_ROW:TI(this,e);break;case $.IN_CELL:DI(this,e);break;case $.IN_SELECT:kI(this,e);break;case $.IN_SELECT_IN_TABLE:jI(this,e);break;case $.IN_TEMPLATE:NI(this,e);break;case $.AFTER_BODY:II(this,e);break;case $.IN_FRAMESET:zI(this,e);break;case $.AFTER_FRAMESET:VI(this,e);break;case $.AFTER_AFTER_BODY:UI(this,e);break;case $.AFTER_AFTER_FRAMESET:GI(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?XI(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:HP(this,e);break;case $.BEFORE_HTML:WP(this,e);break;case $.BEFORE_HEAD:qP(this,e);break;case $.IN_HEAD:XP(this,e);break;case $.IN_HEAD_NO_SCRIPT:eF(this,e);break;case $.AFTER_HEAD:rF(this,e);break;case $.IN_BODY:QF(this,e);break;case $.TEXT:eI(this,e);break;case $.IN_TABLE:fI(this,e);break;case $.IN_TABLE_TEXT:gI(this,e);break;case $.IN_CAPTION:yI(this,e);break;case $.IN_COLUMN_GROUP:xI(this,e);break;case $.IN_TABLE_BODY:wI(this,e);break;case $.IN_ROW:EI(this,e);break;case $.IN_CELL:OI(this,e);break;case $.IN_SELECT:AI(this,e);break;case $.IN_SELECT_IN_TABLE:MI(this,e);break;case $.IN_TEMPLATE:PI(this,e);break;case $.AFTER_BODY:LI(this,e);break;case $.IN_FRAMESET:BI(this,e);break;case $.AFTER_FRAMESET:HI(this,e);break;case $.AFTER_AFTER_BODY:WI(this,e);break;default:}}onEof(e){switch(this.insertionMode){case $.INITIAL:HP(this,e);break;case $.BEFORE_HTML:GP(this,e);break;case $.BEFORE_HEAD:JP(this,e);break;case $.IN_HEAD:QP(this,e);break;case $.IN_HEAD_NO_SCRIPT:tF(this,e);break;case $.AFTER_HEAD:iF(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:$F(this,e);break;case $.TEXT:tI(this,e);break;case $.IN_TABLE_TEXT:gI(this,e);break;case $.IN_TEMPLATE:FI(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:BP(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===G.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:oF(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:nI(this,e);break;case $.IN_TABLE_TEXT:mI(this,e);break;default:}}};function AP(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ZF(e,t),n}function jP(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function MP(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=TP;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=NP(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function NP(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function PP(e,t,n){let r=bN(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===X.TEMPLATE&&i===J.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function FP(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function IP(e,t){for(let n=0;n<wP;n++){let n=AP(e,t);if(!n)break;let r=jP(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=MP(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&PP(e,a,i),FP(e,r,n)}}function LP(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function RP(e,t){e._appendCommentNode(t,e.openElements.items[0])}function zP(e,t){e._appendCommentNode(t,e.document)}function BP(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function VP(e,t){e._setDocumentType(t);let n=t.forceQuirks?vN.QUIRKS:sP(t);oP(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function HP(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,vN.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function UP(e,t){t.tagID===X.HTML?(e._insertElement(t,J.HTML),e.insertionMode=$.BEFORE_HEAD):GP(e,t)}function WP(e,t){let n=t.tagID;(n===X.HTML||n===X.HEAD||n===X.BODY||n===X.BR)&&GP(e,t)}function GP(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function KP(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.HEAD:e._insertElement(t,J.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:JP(e,t)}}function qP(e,t){let n=t.tagID;n===X.HEAD||n===X.BODY||n===X.HTML||n===X.BR?JP(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function JP(e,t){e._insertFakeElement(Y.HEAD,X.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function YP(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TITLE:e._switchToTextParsing(t,CN.RCDATA);break;case X.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,CN.RAWTEXT):(e._insertElement(t,J.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case X.NOFRAMES:case X.STYLE:e._switchToTextParsing(t,CN.RAWTEXT);break;case X.SCRIPT:e._switchToTextParsing(t,CN.SCRIPT_DATA);break;case X.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case X.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:QP(e,t)}}function XP(e,t){switch(t.tagID){case X.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case X.BODY:case X.BR:case X.HTML:QP(e,t);break;case X.TEMPLATE:ZP(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function ZP(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==X.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function QP(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function $P(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.BASEFONT:case X.BGSOUND:case X.HEAD:case X.LINK:case X.META:case X.NOFRAMES:case X.STYLE:YP(e,t);break;case X.NOSCRIPT:e._err(t,K.nestedNoscriptInHead);break;default:tF(e,t)}}function eF(e,t){switch(t.tagID){case X.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case X.BR:tF(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function tF(e,t){let n=t.type===q.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function nF(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.BODY:e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case X.FRAMESET:e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET;break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,X.HEAD),YP(e,t),e.openElements.remove(e.headElement);break;case X.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:iF(e,t)}}function rF(e,t){switch(t.tagID){case X.BODY:case X.HTML:case X.BR:iF(e,t);break;case X.TEMPLATE:ZP(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function iF(e,t){e._insertFakeElement(Y.BODY,X.BODY),e.insertionMode=$.IN_BODY,aF(e,t)}function aF(e,t){switch(t.type){case q.CHARACTER:sF(e,t);break;case q.WHITESPACE_CHARACTER:oF(e,t);break;case q.COMMENT:LP(e,t);break;case q.START_TAG:BF(e,t);break;case q.END_TAG:QF(e,t);break;case q.EOF:$F(e,t);break;default:}}function oF(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function sF(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function cF(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function lF(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function uF(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET)}function dF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function fF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&SN.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,J.HTML)}function pF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function mF(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),n||(e.formElement=e.openElements.current))}function hF(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===X.LI&&r===X.LI||(n===X.DD||n===X.DT)&&(r===X.DD||r===X.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==X.ADDRESS&&r!==X.DIV&&r!==X.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function gF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.tokenizer.state=CN.PLAINTEXT}function _F(e,t){e.openElements.hasInScope(X.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1}function vF(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(IP(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yF(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bF(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(X.NOBR)&&(IP(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xF(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function SF(e,t){e.treeAdapter.getDocumentMode(e.document)!==vN.QUIRKS&&e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function CF(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wF(e){let t=nN(e,_N.TYPE);return t!=null&&t.toLowerCase()===CP}function TF(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),wF(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function EF(e,t){e._appendElement(t,J.HTML),t.ackSelfClosing=!0}function DF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function OF(e,t){t.tagName=Y.IMG,t.tagID=X.IMG,CF(e,t)}function kF(e,t){e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.tokenizer.state=CN.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function AF(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,CN.RAWTEXT)}function jF(e,t){e.framesetOk=!1,e._switchToTextParsing(t,CN.RAWTEXT)}function MF(e,t){e._switchToTextParsing(t,CN.RAWTEXT)}function NF(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function PF(e,t){e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function FF(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,J.HTML)}function IF(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(X.RTC),e._insertElement(t,J.HTML)}function LF(e,t){e._reconstructActiveFormattingElements(),gP(t),vP(t),t.selfClosing?e._appendElement(t,J.MATHML):e._insertElement(t,J.MATHML),t.ackSelfClosing=!0}function RF(e,t){e._reconstructActiveFormattingElements(),_P(t),vP(t),t.selfClosing?e._appendElement(t,J.SVG):e._insertElement(t,J.SVG),t.ackSelfClosing=!0}function zF(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function BF(e,t){switch(t.tagID){case X.I:case X.S:case X.B:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.SMALL:case X.STRIKE:case X.STRONG:yF(e,t);break;case X.A:vF(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:fF(e,t);break;case X.P:case X.DL:case X.OL:case X.UL:case X.DIV:case X.DIR:case X.NAV:case X.MAIN:case X.MENU:case X.ASIDE:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.DETAILS:case X.ADDRESS:case X.ARTICLE:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:dF(e,t);break;case X.LI:case X.DD:case X.DT:hF(e,t);break;case X.BR:case X.IMG:case X.WBR:case X.AREA:case X.EMBED:case X.KEYGEN:CF(e,t);break;case X.HR:DF(e,t);break;case X.RB:case X.RTC:FF(e,t);break;case X.RT:case X.RP:IF(e,t);break;case X.PRE:case X.LISTING:pF(e,t);break;case X.XMP:AF(e,t);break;case X.SVG:RF(e,t);break;case X.HTML:cF(e,t);break;case X.BASE:case X.LINK:case X.META:case X.STYLE:case X.TITLE:case X.SCRIPT:case X.BGSOUND:case X.BASEFONT:case X.TEMPLATE:YP(e,t);break;case X.BODY:lF(e,t);break;case X.FORM:mF(e,t);break;case X.NOBR:bF(e,t);break;case X.MATH:LF(e,t);break;case X.TABLE:SF(e,t);break;case X.INPUT:TF(e,t);break;case X.PARAM:case X.TRACK:case X.SOURCE:EF(e,t);break;case X.IMAGE:OF(e,t);break;case X.BUTTON:_F(e,t);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:xF(e,t);break;case X.IFRAME:jF(e,t);break;case X.SELECT:NF(e,t);break;case X.OPTION:case X.OPTGROUP:PF(e,t);break;case X.NOEMBED:case X.NOFRAMES:MF(e,t);break;case X.FRAMESET:uF(e,t);break;case X.TEXTAREA:kF(e,t);break;case X.NOSCRIPT:e.options.scriptingEnabled?MF(e,t):zF(e,t);break;case X.PLAINTEXT:gF(e,t);break;case X.COL:case X.TH:case X.TD:case X.TR:case X.HEAD:case X.FRAME:case X.TBODY:case X.TFOOT:case X.THEAD:case X.CAPTION:case X.COLGROUP:break;default:zF(e,t)}}function VF(e,t){if(e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function HF(e,t){e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,LI(e,t))}function UF(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function WF(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(X.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(X.FORM):n&&e.openElements.remove(n))}function GF(e){e.openElements.hasInButtonScope(X.P)||e._insertFakeElement(Y.P,X.P),e._closePElement()}function KF(e){e.openElements.hasInListItemScope(X.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(X.LI),e.openElements.popUntilTagNamePopped(X.LI))}function qF(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JF(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function YF(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function XF(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,X.BR),e.openElements.pop(),e.framesetOk=!1}function ZF(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==X.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function QF(e,t){switch(t.tagID){case X.A:case X.B:case X.I:case X.S:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.NOBR:case X.SMALL:case X.STRIKE:case X.STRONG:IP(e,t);break;case X.P:GF(e);break;case X.DL:case X.UL:case X.OL:case X.DIR:case X.DIV:case X.NAV:case X.PRE:case X.MAIN:case X.MENU:case X.ASIDE:case X.BUTTON:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.ADDRESS:case X.ARTICLE:case X.DETAILS:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.LISTING:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:UF(e,t);break;case X.LI:KF(e);break;case X.DD:case X.DT:qF(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:JF(e);break;case X.BR:XF(e);break;case X.BODY:VF(e,t);break;case X.HTML:HF(e,t);break;case X.FORM:WF(e);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:YF(e,t);break;case X.TEMPLATE:ZP(e,t);break;default:ZF(e,t)}}function $F(e,t){e.tmplInsertionModeStack.length>0?FI(e,t):BP(e,t)}function eI(e,t){var n;t.tagID===X.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tI(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function nI(e,t){if(e.openElements.currentTagId!==void 0&&DP.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case q.CHARACTER:hI(e,t);break;case q.WHITESPACE_CHARACTER:mI(e,t);break}else pI(e,t)}function rI(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CAPTION}function iI(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function aI(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,X.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,bI(e,t)}function oI(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_TABLE_BODY}function sI(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,X.TBODY),e.insertionMode=$.IN_TABLE_BODY,CI(e,t)}function cI(e,t){e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function lI(e,t){wF(t)?e._appendElement(t,J.HTML):pI(e,t),t.ackSelfClosing=!0}function uI(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,J.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function dI(e,t){switch(t.tagID){case X.TD:case X.TH:case X.TR:sI(e,t);break;case X.STYLE:case X.SCRIPT:case X.TEMPLATE:YP(e,t);break;case X.COL:aI(e,t);break;case X.FORM:uI(e,t);break;case X.TABLE:cI(e,t);break;case X.TBODY:case X.TFOOT:case X.THEAD:oI(e,t);break;case X.INPUT:lI(e,t);break;case X.CAPTION:rI(e,t);break;case X.COLGROUP:iI(e,t);break;default:pI(e,t)}}function fI(e,t){switch(t.tagID){case X.TABLE:e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode());break;case X.TEMPLATE:ZP(e,t);break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:pI(e,t)}}function pI(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,aF(e,t),e.fosterParentingEnabled=n}function mI(e,t){e.pendingCharacterTokens.push(t)}function hI(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gI(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)pI(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var _I=new Set([X.CAPTION,X.COL,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]);function vI(e,t){let n=t.tagID;_I.has(n)?e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,dI(e,t)):BF(e,t)}function yI(e,t){let n=t.tagID;switch(n){case X.CAPTION:case X.TABLE:e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===X.TABLE&&fI(e,t));break;case X.BODY:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:QF(e,t)}}function bI(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.COL:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TEMPLATE:YP(e,t);break;default:SI(e,t)}}function xI(e,t){switch(t.tagID){case X.COLGROUP:e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TEMPLATE:ZP(e,t);break;case X.COL:break;default:SI(e,t)}}function SI(e,t){e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function CI(e,t){switch(t.tagID){case X.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_ROW;break;case X.TH:case X.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,X.TR),e.insertionMode=$.IN_ROW,TI(e,t);break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,dI(e,t));break;default:dI(e,t)}}function wI(e,t){let n=t.tagID;switch(t.tagID){case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,fI(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:case X.TR:break;default:fI(e,t)}}function TI(e,t){switch(t.tagID){case X.TH:case X.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,CI(e,t));break;default:dI(e,t)}}function EI(e,t){switch(t.tagID){case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case X.TABLE:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,wI(e,t));break;case X.TBODY:case X.TFOOT:case X.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(X.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,wI(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:break;default:fI(e,t)}}function DI(e,t){let n=t.tagID;_I.has(n)?(e.openElements.hasInTableScope(X.TD)||e.openElements.hasInTableScope(X.TH))&&(e._closeTableCell(),TI(e,t)):BF(e,t)}function OI(e,t){let n=t.tagID;switch(n){case X.TD:case X.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case X.TABLE:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),EI(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:break;default:QF(e,t)}}function kI(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.OPTGROUP:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.HR:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.INPUT:case X.KEYGEN:case X.TEXTAREA:case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),t.tagID!==X.SELECT&&e._processStartTag(t));break;case X.SCRIPT:case X.TEMPLATE:YP(e,t);break;default:}}function AI(e,t){switch(t.tagID){case X.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===X.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===X.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop();break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop();break;case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode());break;case X.TEMPLATE:ZP(e,t);break;default:}}function jI(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e._processStartTag(t)):kI(e,t)}function MI(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e.onEndTag(t)):AI(e,t)}function NI(e,t){switch(t.tagID){case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:YP(e,t);break;case X.CAPTION:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,dI(e,t);break;case X.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,bI(e,t);break;case X.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,CI(e,t);break;case X.TD:case X.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,TI(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,BF(e,t)}}function PI(e,t){t.tagID===X.TEMPLATE&&ZP(e,t)}function FI(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):BP(e,t)}function II(e,t){t.tagID===X.HTML?BF(e,t):RI(e,t)}function LI(e,t){if(t.tagID===X.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===X.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else RI(e,t)}function RI(e,t){e.insertionMode=$.IN_BODY,aF(e,t)}function zI(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.FRAMESET:e._insertElement(t,J.HTML);break;case X.FRAME:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.NOFRAMES:YP(e,t);break;default:}}function BI(e,t){t.tagID===X.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==X.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function VI(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.NOFRAMES:YP(e,t);break;default:}}function HI(e,t){t.tagID===X.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function UI(e,t){t.tagID===X.HTML?BF(e,t):WI(e,t)}function WI(e,t){e.insertionMode=$.IN_BODY,aF(e,t)}function GI(e,t){switch(t.tagID){case X.HTML:BF(e,t);break;case X.NOFRAMES:YP(e,t);break;default:}}function KI(e,t){t.chars=`�`,e._insertCharacters(t)}function qI(e,t){e._insertCharacters(t),e.framesetOk=!1}function JI(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==J.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function YI(e,t){if(hP(t))JI(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===J.MATHML?gP(t):r===J.SVG&&(yP(t),_P(t)),vP(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function XI(e,t){if(t.tagID===X.P||t.tagID===X.BR){JI(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===J.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR]);var ZI=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,QI=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),$I={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function eL(e,t){let n=mL(e),r=Vw(`type`,{handlers:{root:nL,element:rL,text:iL,comment:sL,doctype:aL,raw:cL},unknown:lL}),i={parser:n?new kP($I):kP.getFragmentParser(void 0,$I),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),uL(i,rv());let a=TM(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&WS(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function tL(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function nL(e,t){tL(e.children,t)}function rL(e,t){fL(e,t),tL(e.children,t),pL(e,t)}function iL(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:q.CHARACTER,chars:e.value,location:hL(e)};uL(t,rv(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function aL(e,t){let n={type:q.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:hL(e)};uL(t,rv(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function oL(e,t){t.stitches=!0;let n=gL(e);`children`in e&&`children`in n&&(n.children=eL({type:`root`,children:e.children},t.options).children),sL({type:`comment`,value:{stitch:n}},t)}function sL(e,t){let n=e.value,r={type:q.COMMENT,data:n,location:hL(e)};uL(t,rv(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function cL(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,dL(t,rv(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ZI,`&lt;$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function lL(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))oL(n,t);else{let e=``;throw QI.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function uL(e,t){dL(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=CN.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function dL(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function fL(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===CN.PLAINTEXT)return;uL(t,rv(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Pj.html;i===Pj.html&&n===`svg`&&(i=Pj.svg);let a=IM({...e,children:[]},{space:i===Pj.svg?`svg`:`html`}),o={type:q.START_TAG,tagName:n,tagID:bN(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:hL(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function pL(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&KM.includes(n)||t.parser.tokenizer.state===CN.PLAINTEXT)return;uL(t,nv(e));let r={type:q.END_TAG,tagName:n,tagID:bN(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:hL(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===CN.RCDATA||t.parser.tokenizer.state===CN.RAWTEXT||t.parser.tokenizer.state===CN.SCRIPT_DATA)&&(t.parser.tokenizer.state=CN.DATA)}function mL(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function hL(e){let t=rv(e)||{line:void 0,column:void 0,offset:void 0},n=nv(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function gL(e){return`children`in e?OS({...e,children:[]}):OS(e)}function _L(e){return function(t,n){return eL(t,{...e,file:n})}}var vL=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],yL={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...vL,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...vL],h2:[[`className`,`sr-only`]],img:[...vL,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...vL,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...vL],table:[...vL],ul:[...vL,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},bL={}.hasOwnProperty;function xL(e,t){let n={type:`root`,children:[]},r=SL({schema:t?{...yL,...t}:yL,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function SL(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return CL(e,n);case`doctype`:return wL(e,n);case`element`:return TL(e,n);case`root`:return EL(e,n);case`text`:return DL(e,n);default:}}}function CL(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return PL(r,t),r}}function wL(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return PL(e,t),e}}function TL(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=OL(e,t.children),i=kL(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&bL.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return PL(o,t),o}function EL(e,t){let n={type:`root`,children:OL(e,t.children)};return PL(n,t),n}function DL(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return PL(n,t),n}function OL(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=SL(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function kL(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&bL.call(r,n)?r[n]:void 0,o=r&&bL.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(bL.call(s,l)){let t=s[l],n=AL(e,FL(a,l),l,t);n??=AL(e,FL(o,l),l,t),n!=null&&(c[l]=n)}if(i&&bL.call(i,n)){let e=i[n];for(l in e)bL.call(e,l)&&!bL.call(c,l)&&(c[l]=e[l])}return c}function AL(e,t,n,r){return t?Array.isArray(r)?jL(e,t,n,r):ML(e,t,n,r):void 0}function jL(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=ML(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function ML(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&NL(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function NL(e,t,n){let r=e.schema.protocols&&bL.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function PL(e,t){let n=av(t);t.data&&(e.data=OS(t.data)),n&&(e.position=n)}function FL(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function IL(e){return function(t){return xL(t,e)}}var LL={...yL,attributes:{...yL.attributes,div:[...yL.attributes?.div??[],`dataFrontmatter`],span:[...yL.attributes?.span??[],...[`Kind`,`Key`,`Ref`,`Name`,`Source`,`Path`,`Label`,`RawText`,`Excerpt`,`MessageId`,`Role`,`StartLine`,`EndLine`].map(e=>`dataChatInlineToken${e}`)],code:[[`className`,/^language-./,`math-inline`,`math-display`]],details:[`open`]},protocols:{...yL.protocols,href:[...yL.protocols?.href??[],`nextclaw`,`file`]}};function RL(e){return e.value??e.children?.map(RL).join(``)??``}function zL({node:e,children:t,open:n,label:r}){let[i,a]=(0,k.useState)(!!n),o=(0,k.useId)(),s=e?.children.find(e=>e.type===`element`&&e.tagName===`summary`),c=s?RL(s):r,l=k.Children.toArray(t).filter(e=>!(0,k.isValidElement)(e)||e.props.node?.tagName!==`summary`);return(0,A.jsxs)(`div`,{className:`my-3 overflow-hidden rounded-lg border border-border`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":o,onClick:()=>a(e=>!e),className:`flex min-h-9 w-full items-center gap-2 px-3 py-2 text-left text-sm font-medium hover:bg-[var(--interaction-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px]`,children:[(0,A.jsx)(We,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 transition-transform duration-200 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none`,style:{transform:i?`rotate(90deg)`:`rotate(0deg)`}}),(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:c||r})]}),(0,A.jsx)(`div`,{id:o,children:(0,A.jsx)(cj,{open:i,children:()=>(0,A.jsx)(`div`,{className:`flow-root min-w-0 border-t border-border px-3 py-2`,children:l})})})]})}var BL=function(e,t,n){let r=41,i=t=>(e.enter(`mathText`),e.enter(`mathTextSequence`),e.consume(t),a),a=t=>t!==40&&t!==91?n(t):(r=t===40?41:93,e.consume(t),e.exit(`mathTextSequence`),c),o=(e,t,n)=>{let i=t=>(e.enter(`mathTextSequence`),e.consume(t),a),a=i=>i===r?(e.consume(i),e.exit(`mathTextSequence`),t):n(i);return i},s=n=>(e.exit(`mathText`),t(n)),c=t=>t===null?n(t):t===92?e.attempt({tokenize:o},s,l)(t):(e.enter(`mathTextData`),e.consume(t),e.exit(`mathTextData`),c),l=t=>(e.enter(`mathTextData`),e.consume(t),u),u=t=>t===null?n(t):(e.consume(t),e.exit(`mathTextData`),c);return i};function VL(e){return function(){let t=this.data();return(t.micromarkExtensions??=[]).push({text:{92:{tokenize:BL}}}),function t(n){let r=n.position?.start.offset;n.type===`inlineMath`&&r!==void 0&&e.startsWith(`\\[`,r)&&n.data?.hProperties&&(n.data.hProperties.className=[`language-math`,`math-display`]),n.children?.forEach(t)}}}function HL(e){return{type:`element`,tagName:e?`div`:`span`,properties:{"data-chat-math-pending":`true`,"aria-busy":`true`,style:e?`min-height:3em;display:flex;align-items:center;justify-content:center;opacity:0.6`:`opacity:0.6`},children:[{type:`text`,value:`…`}]}}function UL(e,t){let n=t.slice(e.position?.start.offset,e.position?.end.offset).split(/\r\n|\r|\n/),r=n[0]?.match(/^(\${2,}|`{3,}|~{3,})/)?.[1];if(!r||n.length<2)return!1;let i=n.at(-1)?.replace(/^\s*(?:>\s*)*/,``).trim()??``;return i.length>=r.length&&[...i].every(e=>e===r[0])}function WL(e){return()=>function t(n){if((n.type===`math`||n.type===`code`&&n.lang===`math`)&&!UL(n,e)){let e=HL(!0);return{...n,data:{hName:e.tagName,hProperties:e.properties,hChildren:e.children}}}return n.children&&=n.children.map(t),n}}function GL(){return function e(t){return t.properties?.className?.includes(`katex-error`)?HL(!1):(t.children&&=t.children.map(e),t)}}function KL({characterCountLabel:e,excerpt:t,kind:n,label:r,location:i,path:a,tooltip:o,onClick:s}){let{Tooltip:c,TooltipContent:l,TooltipProvider:u,TooltipTrigger:d}=Ki,f=!!s,p=j(jh,`nextclaw-chat-inline-token mx-[0.08em]`,f?`cursor-pointer transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`:`cursor-default`),m=a||o,h=(0,A.jsx)(Kh,{excerpt:t,kind:n,label:r,metricLabel:i??e,source:m}),g=f?(0,A.jsx)(`button`,{type:`button`,className:p,onClick:e=>{e.preventDefault(),e.stopPropagation(),s?.()},children:h}):(0,A.jsx)(`span`,{className:p,children:h});return(n===`workspace_excerpt`||n===`conversation_excerpt`)&&t?(0,A.jsx)(qh,{characterCountLabel:e,excerpt:t,kind:n===`conversation_excerpt`?n:`workspace_file`,label:r,location:i,path:m,children:g}):(0,A.jsx)(u,{delayDuration:250,children:(0,A.jsxs)(c,{children:[(0,A.jsx)(d,{asChild:!0,children:g}),(0,A.jsx)(l,{side:`top`,className:`max-w-[24rem] break-all text-xs`,children:o})]})})}function qL(){return typeof navigator<`u`&&typeof navigator.clipboard?.writeText==`function`}function JL(e){if(typeof document>`u`)return;let t=document.getSelection();t&&(t.removeAllRanges(),e.forEach(e=>t.addRange(e)))}function YL(){let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:null,n=t?{input:t,start:t.selectionStart,end:t.selectionEnd}:null,r=document.getSelection();return{activeElement:e,activeInputSelection:n,ranges:r?Array.from({length:r.rangeCount},(e,t)=>r.getRangeAt(t).cloneRange()):[]}}function XL(e){let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),t.setAttribute(`aria-hidden`,`true`),Object.assign(t.style,{fontSize:`12pt`,left:`-9999px`,opacity:`0`,pointerEvents:`none`,position:`fixed`,top:`0`}),t}function ZL(e){try{e.focus({preventScroll:!0})}catch{e.focus()}}function QL(e){ZL(e),e.select(),e.setSelectionRange(0,e.value.length)}function $L(){try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{return!1}}function eR(e){if(!e.activeInputSelection)return!1;let{input:t,start:n,end:r}=e.activeInputSelection;return n===null||r===null?!1:(t.setSelectionRange(n,r),!0)}function tR(e){e.activeElement&&ZL(e.activeElement),eR(e)||JL(e.ranges)}function nR(e){if(typeof document>`u`||!document.body)return!1;let t=YL(),n=XL(e);document.body.appendChild(n),QL(n);let r=$L();return n.remove(),tR(t),r}async function rR(e){if(!e)return!1;if(qL())try{return await navigator.clipboard.writeText(e),!0}catch{return nR(e)}return nR(e)}var iR=1300;function aR(e){let[t,n]=(0,k.useState)(!1),r=(0,k.useCallback)(async()=>{e.text&&(await rR(e.text)?n(!0):n(!1))},[e.text]);return(0,k.useEffect)(()=>{if(!t||typeof window>`u`)return;let r=window.setTimeout(()=>n(!1),e.resetDelayMs??iR);return()=>window.clearTimeout(r)},[t,e.resetDelayMs]),{copied:t,copy:r}}var oR=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,ee=`[a-zA-Z_]\\w*`,te=`\\b\\d+(\\.\\d+)?`,E=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,ne=`\\b(0b[01]+)`,D=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,re=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},O={begin:`\\\\[\\s\\S]`,relevance:0},ie={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[O]},ae={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[O]},oe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},se=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ce=se(`//`,`$`),le=se(`/\\*`,`\\*/`),ue=se(`#`,`$`),de={scope:`number`,begin:te,relevance:0},fe={scope:`number`,begin:E,relevance:0},pe={scope:`number`,begin:ne,relevance:0},me={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,contains:[O]}]},he={scope:`title`,begin:T,relevance:0},ge={scope:`title`,begin:ee,relevance:0},_e={begin:`\\.\\s*`+ee,relevance:0},ve=Object.freeze({__proto__:null,APOS_STRING_MODE:ie,BACKSLASH_ESCAPE:O,BINARY_NUMBER_MODE:pe,BINARY_NUMBER_RE:ne,COMMENT:se,C_BLOCK_COMMENT_MODE:le,C_LINE_COMMENT_MODE:ce,C_NUMBER_MODE:fe,C_NUMBER_RE:E,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ue,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:_e,NUMBER_MODE:de,NUMBER_RE:te,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:ae,REGEXP_MODE:me,RE_STARTERS_RE:D,SHEBANG:re,TITLE_MODE:he,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:ge});function ye(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function be(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function xe(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ye,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Se(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function Ce(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function we(e,t){e.relevance===void 0&&(e.relevance=1)}var Te=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Ee=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],De=`keyword`;function Oe(e,t,n=De){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Oe(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ke(n[0],n[1])]})}}function ke(e,t){return t?Number(t):Ae(e)?0:1}function Ae(e){return Ee.includes(e.toLowerCase())}var je={},Me=e=>{console.error(e)},Ne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Pe=(e,t)=>{je[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),je[`${e}/${t}`]=!0)},Fe=Error();function Ie(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Le(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Me(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Fe;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Me(`beginScope must be object`),Fe;Ie(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Re(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Me(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Fe;if(typeof e.endScope!=`object`||e.endScope===null)throw Me(`endScope must be object`),Fe;Ie(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ze(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Be(e){ze(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Le(e),Re(e)}function Ve(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[be,Ce,Be,Te].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[xe,Se,we].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=Oe(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ue(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function He(e){return e?e.endsWithParent||He(e.starts):!1}function Ue(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:He(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var We=`11.11.1`,Ge=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ke=i,qe=a,Je=Symbol(`nomatch`),Ye=7,Xe=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=ie(n[1]);return t||(Ne(s.replace(`{}`,n[1])),Ne(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ie(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Pe(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Pe(`10.7.0`,`Please use highlight(code, options) instead.
165
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ue(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ue(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!D.keywords){O.addText(ae);return}let e=0;D.keywordPatternRe.lastIndex=0;let t=D.keywordPatternRe.exec(ae),n=``;for(;t;){n+=ae.substring(e,t.index);let r=te.case_insensitive?t[0].toLowerCase():t[0],i=u(D,r);if(i){let[e,a]=i;if(O.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ye&&(oe+=a),e.startsWith(`_`))n+=t[0];else{let n=te.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=D.keywordPatternRe.lastIndex,t=D.keywordPatternRe.exec(ae)}n+=ae.substring(e),O.addText(n)}function f(){if(ae===``)return;let e=null;if(typeof D.subLanguage==`string`){if(!t[D.subLanguage]){O.addText(ae);return}e=v(D.subLanguage,ae,!0,re[D.subLanguage]),re[D.subLanguage]=e._top}else e=S(ae,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(oe+=e.relevance),O.__addSublanguage(e._emitter,e.language)}function p(){D.subLanguage==null?d():f(),ae=``}function m(e,t){e!==``&&(O.startScope(t),O.addText(e),O.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=te.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(ae=i,d(),ae=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&O.openNode(te.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(ae,te.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),ae=``):e.beginScope._multi&&(h(e.beginScope,t),ae=``)),D=Object.create(e,{parent:{value:D}}),D}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return D.matcher.regexIndex===0?(ae+=e[0],1):(le=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?ae+=t:(n.excludeBegin&&(ae+=t),p(),!n.returnBegin&&!n.excludeBegin&&(ae=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(D,e,r);if(!i)return Je;let a=D;D.endScope&&D.endScope._wrap?(p(),m(t,D.endScope._wrap)):D.endScope&&D.endScope._multi?(p(),h(D.endScope,e)):a.skip?ae+=t:(a.returnEnd||a.excludeEnd||(ae+=t),p(),a.excludeEnd&&(ae=t));do D.scope&&O.closeNode(),!D.skip&&!D.subLanguage&&(oe+=D.relevance),D=D.parent;while(D!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=D;t!==te;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>O.openNode(e))}let T={};function ee(t,r){let a=r&&r[0];if(ae+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(ae+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(D.scope||`<unnamed>`)+`"`);throw e.mode=D,e}else if(r.type===`end`){let e=C(r);if(e!==Je)return e}if(r.type===`illegal`&&a===``)return ae+=`
166
+ `,1;if(ce>1e5&&ce>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return ae+=a,a.length}let te=ie(e);if(!te)throw Me(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let E=Ve(te),ne=``,D=a||E,re={},O=new l.__emitter(l);w();let ae=``,oe=0,se=0,ce=0,le=!1;try{if(te.__emitTokens)te.__emitTokens(n,O);else{for(D.matcher.considerAll();;){ce++,le?le=!1:D.matcher.considerAll(),D.matcher.lastIndex=se;let e=D.matcher.exec(n);if(!e)break;let t=ee(n.substring(se,e.index),e);se=e.index+t}ee(n.substring(se))}return O.finalize(),ne=O.toHTML(),{language:e,value:ne,relevance:oe,illegal:!1,_emitter:O,_top:D}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:se,context:n.slice(se-100,se+100),mode:t.mode,resultSoFar:ne},_emitter:O};if(o)return{language:e,value:Ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:O,_top:D};throw t}}function b(e){let t={value:Ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(ie).filter(oe).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(ie(e.language).supersetOf===t.language)return 1;if(ie(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ue(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ge(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ue(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=qe(l,e)}let ee=()=>{ne(),Pe(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function te(){ne(),Pe(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let E=!1;function ne(){function e(){ne()}if(document.readyState===`loading`){E||window.addEventListener(`DOMContentLoaded`,e,!1),E=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function D(n,r){let i=null;try{i=r(e)}catch(e){if(Me(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Me(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&ae(i.aliases,{languageName:n})}function re(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function O(){return Object.keys(t)}function ie(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function ae(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function oe(e){let t=ie(e);return t&&!t.disableAutodetect}function se(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ce(e){se(e),a.push(e)}function le(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ue(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function de(e){return Pe(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Pe(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:ne,highlightElement:w,highlightBlock:de,configure:T,initHighlighting:ee,initHighlightingOnLoad:te,registerLanguage:D,unregisterLanguage:re,listLanguages:O,getLanguage:ie,registerAliases:ae,autoDetection:oe,inherit:qe,addPlugin:ce,removePlugin:le}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=We,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ve)typeof ve[e]==`object`&&n(ve[e]);return Object.assign(e,ve),e},Ze=Xe({});Ze.newInstance=()=>Xe({}),t.exports=Ze,Ze.HighlightJS=Ze,Ze.default=Ze}))()).default;function sR(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var cR=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lR=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),uR=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),dR=[...lR,...uR],fR=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),pR=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),mR=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hR=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function gR(e){let t=e.regex,n=cR(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+pR.join(`|`)+`)`},{begin:`:(:)?(`+mR.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+hR.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:fR.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+dR.join(`|`)+`)\\b`}]}}function _R(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var vR=`[A-Za-z$_][0-9A-Za-z$_]*`,yR=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),bR=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],xR=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),SR=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],CR=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],wR=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],TR=[].concat(CR,xR,SR);function ER(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=vR,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:vR,keyword:yR,literal:bR,built_in:TR,"variable.language":wR},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...xR,...SR]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let E={match:t.concat(/\b/,te([...CR,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},re=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},O,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:re,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},ne,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},E,ee,S,D,{match:/\$[(.]/}]}}function DR(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function OR(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function kR(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function AR(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function jR(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var MR=`[A-Za-z$_][0-9A-Za-z$_]*`,NR=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),PR=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],FR=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),IR=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],LR=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],RR=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],zR=[].concat(LR,FR,IR);function BR(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=MR,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:MR,keyword:NR,literal:PR,built_in:zR,"variable.language":RR},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...FR,...IR]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let E={match:t.concat(/\b/,te([...LR,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},re=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},O,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:re,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},ne,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},E,ee,S,D,{match:/\$[(.]/}]}}function VR(e){let t=e.regex,n=BR(e),r=MR,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:MR,keyword:NR.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:PR,built_in:zR.concat(i),"variable.language":RR},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function HR(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function UR(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var WR=new Set([`text`,`txt`,`plain`,`plaintext`,`none`,`output`]),GR=[`typescript`,`javascript`,`json`,`bash`,`shell`,`python`,`css`,`xml`,`markdown`,`yaml`,`sql`,`diff`],KR=4,qR=[{name:`typescript`,language:VR,aliases:[`ts`,`tsx`]},{name:`javascript`,language:ER,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{name:`json`,language:DR,aliases:[`jsonc`]},{name:`bash`,language:sR,aliases:[`sh`,`zsh`]},{name:`shell`,language:AR,aliases:[`console`,`terminal`]},{name:`python`,language:kR,aliases:[`py`]},{name:`css`,language:gR},{name:`xml`,language:HR,aliases:[`html`,`svg`]},{name:`markdown`,language:OR,aliases:[`md`,`mdx`]},{name:`yaml`,language:UR,aliases:[`yml`]},{name:`sql`,language:jR},{name:`diff`,language:_R,aliases:[`patch`]}];function JR(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function YR(e){return e.trim().toLowerCase()}var XR=new class{constructor(){this.highlight=(e,t)=>{let n=YR(t);if(!e||WR.has(n))return this.createPlainTextResult(e,n||`text`);if(this.engine.getLanguage(n)){let t=this.engine.highlight(e,{language:n,ignoreIllegals:!0});return{html:t.value,language:t.language??n,highlighted:!0}}let r=this.engine.highlightAuto(e,GR);return r.language&&r.relevance>=KR?{html:r.value,language:r.language,highlighted:!0}:this.createPlainTextResult(e,n||`text`)},this.createPlainTextResult=(e,t)=>({html:JR(e),language:t,highlighted:!1}),this.engine=oR.newInstance(),qR.forEach(e=>{this.engine.registerLanguage(e.name,e.language),e.aliases&&this.engine.registerAliases(e.aliases,{languageName:e.name})})}},ZR=/language-([a-z0-9-]+)/i;function QR(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(QR).join(``):``}function $R(e){let t=QR(e);return t.endsWith(`
167
+ `)?t.slice(0,-1):t}function ez(e){return(e?ZR.exec(e):null)?.[1]?.toLowerCase()||`text`}function tz({className:e,children:t,texts:n}){let r=(0,k.useMemo)(()=>ez(e),[e]),i=(0,k.useMemo)(()=>$R(t),[t]),a=(0,k.useMemo)(()=>XR.highlight(i,r),[i,r]),o=(0,k.useMemo)(()=>{let t=`language-${a.language}`;return j(`hljs`,e,e?.includes(`language-`)?void 0:t)},[e,a.language]),{copied:s,copy:c}=aR({text:i});return(0,A.jsxs)(`div`,{className:`chat-codeblock`,children:[(0,A.jsxs)(`div`,{className:`chat-codeblock-toolbar`,children:[(0,A.jsx)(`span`,{className:`chat-codeblock-language`,children:r}),(0,A.jsxs)(`button`,{type:`button`,className:`chat-codeblock-copy`,onClick:()=>void c(),"aria-label":s?n.copiedCodeLabel:n.copyCodeLabel,children:[s?(0,A.jsx)(h,{className:`h-3.5 w-3.5`}):(0,A.jsx)(Ye,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:s?n.copiedCodeLabel:n.copyCodeLabel})]})]}),(0,A.jsx)(`pre`,{children:(0,A.jsx)(`code`,{className:o,"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})})]})}var nz=`nextclaw-inline`,rz=/language-([a-z0-9-]+)/i,iz=new Set([`auto`,`source`,`rendered`]),az=32,oz=64*1024;function sz(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cz(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}function lz(e){return Number.isInteger(e)&&Number(e)>0?Number(e):void 0}function uz(e){let t=cz(e);return t&&iz.has(t)?t:void 0}function dz(e){let{payload:t}=e;return sz(t)?t:null}function fz(e,t){return e===null||typeof e==`string`||typeof e==`boolean`?!0:typeof e==`number`?Number.isFinite(e):t>=az||typeof e!=`object`?!1:(Array.isArray(e)?e:Object.values(e)).every(e=>fz(e,t+1))}function pz(e){if(e!==void 0)return!sz(e)||!fz(e,0)?null:new TextEncoder().encode(JSON.stringify(e)).byteLength<=oz?e:null}function mz(e){let t=dz(e);if(!t)return null;let n=cz(t.path);if(!n)return null;let r=uz(t.viewer),i=pz(t.params);return i===null||i&&(r===`source`||!/\.html?$/i.test(n))?null:{type:`file`,payload:{path:n,line:lz(t.line),column:lz(t.column),viewer:r,params:i??void 0}}}function hz(e){let t=dz(e);if(!t)return null;let n=cz(t.url);return n?{type:`url`,payload:{url:n}}:null}function gz(e){let t=dz(e);if(!t)return null;let n=cz(t.appId);if(!n)return null;let r=pz(t.params);return r===null?null:{type:`panel_app`,payload:{appId:n,path:cz(t.path),params:r??void 0}}}function _z(e){let t=dz(e);return!t||!(`value`in t)?null:{type:`json`,payload:{value:t.value}}}function vz(e){if(!sz(e))return null;let t=cz(e.type);return t===`file`?mz(e):t===`url`?hz(e):t===`panel_app`?gz(e):t===`json`?_z(e):null}function yz(e){return(e?rz.exec(e):null)?.[1]?.toLowerCase()===nz}function bz(e){let t=e.endsWith(`
168
+ `)?e.slice(0,-1):e,n;try{n=JSON.parse(t)}catch{return null}if(!sz(n))return null;let r=vz(n.target);return r?{target:r,title:cz(n.title),description:cz(n.description)}:null}function xz(e){if(e.title)return e.title;if(e.target.type===`file`){let t=e.target.payload.path.split(`/`).filter(Boolean);return t[t.length-1]??e.target.payload.path}return e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:`JSON`}function Sz(e){return e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:JSON.stringify(e.target.payload.value,null,2)}function Cz({display:e}){let t=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return e.target.type===`file`?(0,A.jsx)(at,{className:t,"aria-hidden":!0}):e.target.type===`url`?(0,A.jsx)(Oe,{className:t,"aria-hidden":!0}):e.target.type===`panel_app`?(0,A.jsx)(Fe,{className:t,"aria-hidden":!0}):(0,A.jsx)(qe,{className:t,"aria-hidden":!0})}function wz(e){return e.length>1200?`${e.slice(0,1200)}\n...`:e}function Tz({display:e}){let t=xz(e),n=Sz(e),r=e.target.type===`json`?wz(n):n;return(0,A.jsxs)(`section`,{className:j(`my-2 max-w-full border-l-2 border-border bg-muted/30 px-3 py-2`,`text-xs leading-relaxed text-foreground`),"data-nextclaw-inline-display":`true`,"data-nextclaw-inline-display-type":e.target.type,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(Cz,{display:e}),(0,A.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),e.description?(0,A.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[12px] text-muted-foreground`,children:e.description}):null,(0,A.jsx)(`pre`,{className:j(`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words`,`font-mono text-[11px] leading-relaxed text-muted-foreground`),children:r})]})}function Ez({display:e,renderInlineDisplay:t}){let n=t?.(e);return n==null?(0,A.jsx)(Tz,{display:e}):(0,A.jsx)(A.Fragment,{children:n})}var Dz=.5,Oz=4,kz=.25;function Az({actions:e,className:t}){return(0,A.jsx)(`div`,{"data-chat-message-preview-toolbar":`true`,className:j(`absolute right-2 top-2 z-10 flex items-center gap-0.5 rounded-lg bg-black/55 p-1 text-white opacity-80 shadow-lg backdrop-blur-md transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100`,t),children:e.map(e=>(0,A.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,disabled:e.disabled,className:`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onSelect()},children:e.icon},e.id))})}function jz({actions:e=[],children:t,closeLabel:n,label:r,onClose:i,resetZoomLabel:a=`Reset zoom`,zoomInLabel:o=`Zoom in`,zoomOutLabel:s=`Zoom out`}){let c=(0,k.useRef)(null),[l,u]=(0,k.useState)(!1),[d,f]=(0,k.useState)({scale:1,x:0,y:0}),p=(0,k.useCallback)(()=>{f({scale:1,x:0,y:0})},[]),m=(0,k.useCallback)((e,t={x:0,y:0})=>{f(n=>{let r=typeof e==`function`?e(n.scale):e,i=Math.min(Oz,Math.max(Dz,r));if(i<=1)return{scale:i,x:0,y:0};let a=i/n.scale;return{scale:i,x:t.x-(t.x-n.x)*a,y:t.y-(t.y-n.y)*a}})},[]);(0,k.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{if(e.key===`Escape`){e.preventDefault(),i();return}e.key===`+`||e.key===`=`?(e.preventDefault(),m(e=>e+kz)):e.key===`-`?(e.preventDefault(),m(e=>e-kz)):e.key===`0`&&(e.preventDefault(),p())};return window.addEventListener(`keydown`,t),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t)}},[m,i,p]);let h=e=>{d.scale<=1||e.button!==0||(e.currentTarget.setPointerCapture(e.pointerId),c.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,x:d.x,y:d.y},u(!0))},g=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||f(n=>({...n,x:t.x+e.clientX-t.startX,y:t.y+e.clientY-t.startY}))},_=e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),c.current=null,u(!1))},v=e=>{e.preventDefault();let t=e.currentTarget.getBoundingClientRect();m(t=>t+(e.deltaY<0?kz:-kz),{x:e.clientX-t.left-t.width/2,y:e.clientY-t.top-t.height/2})},y=`${Math.round(d.scale*100)}%`,b=[...e,{id:`close`,label:n,icon:(0,A.jsx)(Me,{className:`h-4 w-4`,strokeWidth:2}),onSelect:i}];return(0,Ch.createPortal)((0,A.jsxs)(`div`,{role:`dialog`,"aria-label":r,"aria-modal":`true`,className:`fixed inset-0 z-[var(--z-modal,10050)] overflow-hidden bg-black/90 backdrop-blur-[2px]`,onClick:i,children:[(0,A.jsx)(Az,{actions:b,className:`right-4 top-4 opacity-100`}),(0,A.jsx)(`div`,{"data-chat-message-lightbox-viewport":`true`,className:j(`absolute inset-0 flex touch-none select-none items-center justify-center overflow-hidden p-6 sm:p-12`,d.scale>1&&(l?`cursor-grabbing`:`cursor-grab`)),onClick:e=>e.stopPropagation(),onDoubleClick:()=>{d.scale===1?m(2):p()},onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onWheel:v,children:(0,A.jsx)(`div`,{"data-chat-message-lightbox-content":`true`,className:j(`flex h-full w-full items-center justify-center will-change-transform`,!l&&`transition-transform duration-150 ease-out`),style:{transform:`translate3d(${d.x}px, ${d.y}px, 0) scale(${d.scale})`},children:t})}),(0,A.jsxs)(`div`,{className:`absolute bottom-5 left-1/2 z-10 flex -translate-x-1/2 items-center gap-0.5 rounded-xl bg-black/60 p-1 text-white shadow-xl backdrop-blur-md`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":s,title:s,disabled:d.scale<=Dz,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),m(e=>e-kz)},children:(0,A.jsx)(vt,{className:`h-4 w-4`,strokeWidth:2})}),(0,A.jsx)(`output`,{"aria-label":y,className:`inline-flex h-9 min-w-16 items-center justify-center px-2 text-xs font-medium tabular-nums`,children:y}),(0,A.jsx)(`button`,{type:`button`,"aria-label":o,title:o,disabled:d.scale>=Oz,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),m(e=>e+kz)},children:(0,A.jsx)(Ne,{className:`h-4 w-4`,strokeWidth:2})}),(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-5 w-px bg-white/20`}),(0,A.jsx)(`button`,{type:`button`,"aria-label":a,title:a,disabled:d.scale===1&&d.x===0&&d.y===0,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),p()},children:(0,A.jsx)(Ct,{className:`h-4 w-4`,strokeWidth:2})})]})]}),document.body)}var Mz=200,Nz=null;function Pz(){return Nz??=u(()=>import(`./mermaid.core-B7ufoXgq.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),Nz}function Fz(){if(typeof document>`u`)return`default`;let e=document.documentElement;return e.getAttribute(`data-theme-appearance`)===`dark`||e.classList.contains(`dark`)?`dark`:`default`}function Iz(){let[e,t]=(0,k.useState)(Fz);return(0,k.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(Fz()));return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme-appearance`]}),()=>n.disconnect()},[]),e}function Lz({isStreaming:e,source:t,texts:n}){let r=(0,k.useId)().replace(/[^a-zA-Z0-9_-]/g,``),i=(0,k.useRef)(0),a=Iz(),o=t.trim(),s=`${a}:${o}`,c=(0,k.useRef)({isFinal:!e,key:s,source:o,theme:a}),l=(0,k.useRef)(null),u=(0,k.useRef)(!1),d=(0,k.useRef)(Date.now()),f=(0,k.useRef)(!0),[p,m]=(0,k.useState)(!1),[g,_]=(0,k.useState)(null),[v,y]=(0,k.useState)(null),b=n.mermaidDiagramLabel??`Mermaid diagram`,x=n.mermaidExpandLabel??`Expand diagram`,S=n.attachmentCloseLabel??`Close preview`,C=n.mermaidLoadingLabel??`Rendering diagram…`,w=n.mermaidRenderErrorLabel??`Diagram could not be rendered`,{copied:T,copy:ee}=aR({text:o}),te=T?n.copiedCodeLabel:n.copyCodeLabel,E=(0,k.useCallback)(e=>{if(!f.current||u.current)return;if(l.current!==null){if(!e)return;window.clearTimeout(l.current),l.current=null}let t=Date.now()-d.current,n=e?0:Math.max(0,Mz-t);l.current=window.setTimeout(()=>{l.current=null,_(c.current)},n)},[]);(0,k.useEffect)(()=>(f.current=!0,()=>{f.current=!1,l.current!==null&&(window.clearTimeout(l.current),l.current=null)}),[]),(0,k.useEffect)(()=>{c.current={isFinal:!e,key:s,source:o,theme:a},E(!e)},[e,o,s,E,a]),(0,k.useEffect)(()=>{if(!g)return;let e=!0;return(async()=>{u.current=!0,d.current=Date.now();try{let t=await Pz();if(!e||!f.current)return;i.current+=1;let n=`nextclaw-mermaid-${r}-${i.current}`;t.initialize({securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:g.theme});let a=await t.parse(g.source,{suppressErrors:!0});if(!e||!f.current)return;if(!a)throw Error(`Invalid Mermaid diagram`);let{svg:o}=await t.render(n,g.source);e&&f.current&&c.current.theme===g.theme&&y({key:g.key,status:`rendered`,svg:o})}catch{e&&f.current&&g.isFinal&&c.current.key===g.key&&y({key:g.key,status:`error`})}finally{u.current=!1;let t=c.current;e&&f.current&&(t.key!==g.key||t.isFinal!==g.isFinal)&&E(t.isFinal)}})(),()=>{e=!1}},[r,g,E]);let ne=v?.key===s?v:null;if(ne?.status===`error`)return(0,A.jsxs)(`div`,{"data-chat-mermaid-error":`true`,className:`my-3 overflow-hidden rounded-xl border border-border bg-muted/25`,children:[(0,A.jsx)(`div`,{className:`border-b border-border px-3 py-2 text-xs text-muted-foreground`,children:w}),(0,A.jsx)(tz,{className:`language-mermaid`,texts:n,children:o})]});let D=v?.status===`rendered`?v:null;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`figure`,{"aria-label":b,"aria-busy":!ne,"data-chat-mermaid-diagram":`true`,"data-chat-mermaid-pending":!D||void 0,"data-chat-mermaid-updating":!ne||void 0,className:D?`group/mermaid relative my-3 min-h-24 overflow-auto py-2`:`my-3 flex min-h-14 items-center justify-center rounded-xl bg-muted/20 px-3 py-2`,children:D?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":x,title:x,className:`relative block min-w-full cursor-zoom-in border-0 bg-transparent p-0 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>m(!0),children:(0,A.jsx)(`span`,{className:`block min-w-fit [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:D.svg}})}),(0,A.jsx)(Az,{actions:[{id:`copy-source`,label:te,icon:T?(0,A.jsx)(h,{className:`h-4 w-4`,strokeWidth:2}):(0,A.jsx)(Ye,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>void ee()},{id:`expand`,label:x,icon:(0,A.jsx)(Qe,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>m(!0)}]})]}):(0,A.jsxs)(`div`,{role:`status`,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground/80`,children:[(0,A.jsx)(ke,{"aria-hidden":`true`,className:`h-3.5 w-3.5 animate-spin motion-reduce:animate-none`}),(0,A.jsx)(`span`,{children:C})]})}),p&&D?(0,A.jsx)(jz,{closeLabel:S,label:b,onClose:()=>m(!1),zoomInLabel:n.previewZoomInLabel,zoomOutLabel:n.previewZoomOutLabel,resetZoomLabel:n.previewResetZoomLabel,actions:[{id:`copy-source`,label:te,icon:T?(0,A.jsx)(h,{className:`h-4 w-4`,strokeWidth:2}):(0,A.jsx)(Ye,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>void ee()}],children:(0,A.jsx)(`div`,{"data-chat-mermaid-expanded-canvas":`true`,className:`h-full w-full overflow-hidden rounded-xl bg-background p-4 shadow-2xl [&_svg]:mx-auto [&_svg]:!h-full [&_svg]:!w-full [&_svg]:!max-w-none`,dangerouslySetInnerHTML:{__html:D.svg}})}):null]})}function Rz({alt:e,expandLabel:t,closeLabel:n,resetZoomLabel:r,sizeLabel:i,src:a,zoomInLabel:o,zoomOutLabel:s}){let[c,l]=(0,k.useState)(!1),u=()=>l(!0);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{"data-chat-message-image-preview":!0,className:`group/image relative block w-fit max-w-[min(100%,32rem)] overflow-hidden rounded-lg`,children:[(0,A.jsx)(`button`,{type:`button`,className:`block w-fit max-w-[min(100%,32rem)] text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:u,onDoubleClick:e=>{e.preventDefault(),u()},"aria-label":t,children:(0,A.jsx)(`img`,{src:a,alt:e,className:`block h-auto w-auto max-h-[26rem] max-w-full rounded-lg bg-transparent object-contain`})}),(0,A.jsx)(Az,{actions:[{id:`expand`,label:t,icon:(0,A.jsx)(Qe,{className:`h-4 w-4`,strokeWidth:2}),onSelect:u}]}),i?(0,A.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-start bg-gradient-to-t from-black/50 via-black/15 to-transparent px-2.5 pb-2 pt-8 opacity-0 transition-opacity duration-150 group-hover/image:opacity-100 group-focus-within/image:opacity-100`,children:(0,A.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-black/40 px-1.5 py-0.5 text-[10px] font-medium text-white/95 backdrop-blur-sm`,children:i})}):null]}),c?(0,A.jsx)(jz,{closeLabel:n,label:e,onClose:()=>l(!1),resetZoomLabel:r,zoomInLabel:o,zoomOutLabel:s,children:(0,A.jsx)(`img`,{src:a,alt:e,className:`max-h-full max-w-full object-contain shadow-2xl`})}):null]})}var zz=new Set([`nextclaw:`,`http:`,`https:`,`mailto:`,`tel:`]),Bz=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Vz=/^[a-z]:[\\/]/i,Hz=/^\/[a-z]:[\\/]/i,Uz=`file:`;function Wz(e){return!e.startsWith(`//`)&&!Bz.test(e)}function Gz(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:void 0}function Kz(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==Uz||t.hostname&&t.hostname.toLowerCase()!==`localhost`)return null;let n;try{n=decodeURIComponent(t.pathname)}catch{return null}return Hz.test(n)&&(n=n.slice(1)),n?{path:n,query:t.searchParams,fragment:t.hash.slice(1)}:null}function qz(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``,i=n.indexOf(`?`),a=i>=0?n.slice(0,i):n,o=i>=0?n.slice(i+1):``,s;try{s=decodeURIComponent(a)}catch{return null}return s?{path:s,query:new URLSearchParams(o),fragment:r}:null}function Jz(e){let t=/^L(\d+)(?:C(\d+))?(?:-L\d+(?:C\d+)?)?$/i.exec(e),n=Gz(t?.[1]);return{line:n,column:n?Gz(t?.[2]):void 0}}function Yz(e){if(Vz.test(e)||Wz(e))return e;try{let t=new URL(e);return zz.has(t.protocol)||t.protocol===Uz&&Kz(e)?e:``}catch{return``}}function Xz(e){return e&&Yz(e)||null}function Zz(e){return/^https?:\/\//i.test(e)}function Qz(e){let t=e.toLowerCase().startsWith(Uz)?Kz(e):qz(e),n=t?.path;if(!n||n.startsWith(`#`)||n.startsWith(`//`)||!Vz.test(n)&&Bz.test(n))return null;let r=t.query.get(`viewer`),i=Jz(t.fragment),a=/^(.*?)(?::(\d+)(?::(\d+))?)$/.exec(n),o=a?.[1]??n,s=i.line??Gz(a?.[2]),c=i.column??(s?Gz(a?.[3]):void 0);return{path:o,label:o.split(/[\\/]/).filter(Boolean).pop()??o,viewMode:`preview`,...r===`source`||r===`rendered`?{previewViewer:r}:{},...typeof s==`number`?{line:s}:{},...typeof c==`number`?{column:c}:{}}}var $z=`data-chat-inline-token-kind`,eB=`data-chat-inline-token-key`,tB=`data-chat-inline-token-ref`,nB=`data-chat-inline-token-name`,rB=`data-chat-inline-token-source`,iB=`data-chat-inline-token-path`,aB=`data-chat-inline-token-label`,oB=`data-chat-inline-token-raw-text`,sB=`data-chat-inline-token-excerpt`,cB=`data-chat-inline-token-message-id`,lB=`data-chat-inline-token-role`,uB=`data-chat-inline-token-start-line`,dB=`data-chat-inline-token-end-line`;function fB(e){return e.filter(e=>e.rawText).sort((e,t)=>t.rawText.length-e.rawText.length)}function pB(e){let t={[$z]:e.kind,[aB]:e.label,[oB]:e.rawText};return`ref`in e?(t[tB]=e.ref,t[nB]=e.name,e.source&&(t[rB]=e.source),e.path&&(t[iB]=e.path)):(t[eB]=e.key,e.kind===`workspace_excerpt`&&`path`in e?(t[iB]=e.path,t[sB]=e.excerpt,e.startLine!==null&&(t[uB]=String(e.startLine)),e.endLine!==null&&(t[dB]=String(e.endLine))):e.kind===`conversation_excerpt`&&`messageId`in e&&(t[sB]=e.excerpt,t[cB]=e.messageId,t[lB]=e.role)),{type:`chatInlineToken`,data:{hName:`span`,hProperties:t,hChildren:[{type:`text`,value:e.label}]}}}function mB(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i.rawText,t);n<0||(!r||n<r.index||n===r.index&&i.rawText.length>r.token.rawText.length)&&(r={index:n,token:i})}return r}var hB=class{constructor(e){this.tokens=e,this.occurrenceCounts=new Map,this.transform=e=>e.type===`code`||e.type===`inlineCode`||!e.children?e:{...e,children:e.children.flatMap(e=>e.type===`text`&&typeof e.value==`string`?this.splitTextNode(e.value):[this.transform(e)])},this.splitTextNode=e=>{let t=[],n=0;for(;n<e.length;){let r=mB(e,n,this.tokens);if(!r){t.push({type:`text`,value:e.slice(n)});break}r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)});let i=this.tokens.filter(e=>e.rawText===r.token.rawText),a=this.occurrenceCounts.get(r.token.rawText)??0,o=i[Math.min(a,i.length-1)]??r.token;this.occurrenceCounts.set(r.token.rawText,a+1),t.push(pB(o)),n=r.index+r.token.rawText.length}return t.length>0?t:[{type:`text`,value:e}]}}};function gB(e){let t=fB(e);return function(){let e=this.data(),n={text:{36:t.filter(e=>e.rawText.startsWith(`$`)).map(e=>({tokenize:(t,n,r)=>{let i=0;return function a(o){return o===e.rawText.charCodeAt(i)?(i===0&&t.enter(`data`),t.consume(o),i+=1,i===e.rawText.length?(t.exit(`data`),n):a):r(o)}}}))}};return(e.micromarkExtensions??=[]).push(n),e=>t.length>0?new hB(t).transform(e):e}}function _B(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}function vB(e){let t=_B(e,rB);return t===`builtin`||t===`global`||t===`project`||t===`workspace`?t:null}function yB(e,t){let n=Number(_B(e,t));return Number.isInteger(n)&&n>0?n:null}function bB(e){let t=_B(e,$z),n=_B(e,aB),r=_B(e,oB);if(t===`skill`&&n&&r){let i=_B(e,tB),a=_B(e,nB);return i&&a?{kind:t,ref:i,name:a,source:vB(e),path:_B(e,iB),label:n,rawText:r}:null}let i=_B(e,eB);if(t===`workspace_excerpt`&&i&&n&&r){let a=_B(e,iB),o=_B(e,sB);return a&&o?{kind:t,key:i,path:a,label:n,excerpt:o,startLine:yB(e,uB),endLine:yB(e,dB),rawText:r}:null}if(t===`conversation_excerpt`&&i&&n&&r){let a=_B(e,sB),o=_B(e,cB),s=_B(e,lB);return a&&o&&(s===`assistant`||s===`user`)?{kind:t,key:i,messageId:o,role:s,label:n,excerpt:a,rawText:r}:null}return t&&i&&n&&r?{kind:t,key:i,label:n,rawText:r}:null}var xB=14e4,SB={"katex-display":{overflowX:`auto`,overflowY:`hidden`,paddingBlock:`0.25em`}};function CB(e){return e.length<=xB?e:`${e.slice(0,xB)}\n\n...`}function wB(e){let t=0;for(let n of e?.children??[]){if(n.type===`text`){let e=n.value??``;if(e.trim().length>0||e.includes(`
169
+ `)||e.includes(`\r`))return!1;continue}if(n.tagName!==`img`)return!1;t+=1}return t>=3}var TB=(0,k.createContext)(null);function EB(){let e=(0,k.useContext)(TB);if(!e)throw Error(`Chat message Markdown renderer requires its runtime context`);return e}var DB={details:function({node:e,children:t,open:n}){let{texts:r}=EB();return(0,A.jsx)(zL,{node:e,open:n,label:r.detailsLabel??`Details`,children:t})},summary:()=>null,div:function({node:e,children:t,...n}){let{texts:r}=EB(),i=n[`data-frontmatter`];return typeof i==`string`?(0,A.jsx)(lj,{source:i,label:r.frontmatterLabel??`Document properties`}):(0,A.jsx)(`div`,{...n,children:t})},p:function({node:e,children:t}){let{inline:n}=EB();return n?(0,A.jsx)(A.Fragment,{children:t}):(0,A.jsx)(`p`,{"data-chat-image-row":wB(e)?`three-column`:void 0,children:t})},span:function({node:e,children:t,...n}){let{onInlineTokenClick:r,texts:i}=EB(),a=bB(n);if(a){let e=`excerpt`in a?a:null,t=a.kind===`workspace_excerpt`&&`path`in a?a:null;return(0,A.jsx)(KL,{characterCountLabel:t?i.excerptCharacterCountTemplate?.replace(`{count}`,String(Wh(t.excerpt))):void 0,excerpt:e?.excerpt,kind:a.kind,label:a.label,location:t?.startLine?t.startLine===t.endLine||!t.endLine?`L${t.startLine}`:`L${t.startLine}–${t.endLine}`:void 0,path:t?.path,tooltip:`ref`in a?a.name:a.key,onClick:r&&a.kind!==`conversation_excerpt`?()=>r(a):void 0})}return(0,A.jsx)(`span`,{...n,style:{...n.style,...SB[n.className??``]},children:t})},a:function({node:e,href:t,children:n,...r}){let{onFileOpen:i}=EB(),a=Xz(t),o=s_(a),s=a?Zz(a):!1,c=s?null:a?Qz(a):null,l=e=>{if(!a){e.preventDefault();return}!i||!c||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),i(c))};return(0,A.jsxs)(`a`,{...r,className:j(r.className,!a&&`chat-link-invalid`),href:a??`#`,"aria-disabled":!a||void 0,onClick:l,target:s?`_blank`:void 0,rel:s?`noreferrer noopener`:void 0,children:[o&&(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex empty:hidden`,style:{marginInlineEnd:`0.25em`,verticalAlign:`-0.1em`},children:o}),n]})},table:function({node:e,children:t,...n}){return(0,A.jsx)(`div`,{className:`chat-table-wrap`,children:(0,A.jsx)(`table`,{...n,children:t})})},input:function({node:e,type:t,checked:n,...r}){return t===`checkbox`?(0,A.jsx)(`input`,{...r,type:`checkbox`,checked:n,readOnly:!0,disabled:!0,className:`chat-task-checkbox`}):(0,A.jsx)(`input`,{...r,type:t})},img:function({node:e,src:t,alt:n}){let{resolveFileContentUrl:r,texts:i}=EB(),a=Xz(t);if(!a)return null;let o=Qz(a),s=o&&r?r(o):a;return s?(0,A.jsx)(Rz,{alt:n||``,closeLabel:i.attachmentCloseLabel??`Close preview`,expandLabel:i.attachmentExpandLabel??`Expand image`,resetZoomLabel:i.previewResetZoomLabel,sizeLabel:null,src:s,zoomInLabel:i.previewZoomInLabel,zoomOutLabel:i.previewZoomOutLabel}):null},code:function({node:e,className:t,children:n,...r}){let{isStreaming:i,renderInlineDisplay:a,texts:o}=EB(),s=String(n??``);if(!t&&!s.includes(`
170
+ `))return(0,A.jsx)(`code`,{...r,className:j(`chat-inline-code`,t),children:n});let c=yz(t)?bz(s):null;return c?(0,A.jsx)(Ez,{display:c,renderInlineDisplay:a}):t?.split(` `).includes(`language-mermaid`)?(0,A.jsx)(Lz,{isStreaming:i,source:s,texts:o}):(0,A.jsx)(tz,{className:t,texts:o,children:n})}};function OB({text:e,role:t,texts:n,inline:r=!1,isStreaming:i=!1,inlineTokens:a,onFileOpen:o,onInlineTokenClick:s,resolveFileContentUrl:c,renderInlineDisplay:l}){let u=t===`user`,d=CB(e),f=a?.length?[JE,xj,VL(d),gB(a)]:[JE,xj,VL(d)];i&&f.push(WL(d)),r||f.unshift(hD,oj);let p=r?`span`:`div`;return(0,A.jsx)(TB.Provider,{value:{inline:r,isStreaming:i,isUser:u,onFileOpen:o,onInlineTokenClick:s,renderInlineDisplay:l,resolveFileContentUrl:c,texts:n},children:(0,A.jsx)(p,{"data-stream-phase":i?e.length%3:void 0,className:j(`chat-markdown`,u?`chat-markdown-user`:`chat-markdown-assistant`),children:(0,A.jsx)(HC,{skipHtml:r,remarkPlugins:f,rehypePlugins:[...r?[]:[_L,[IL,LL]],[bM,{trust:!1,maxExpand:1e3,...i?{errorColor:`currentColor`}:{}}],...i?[GL]:[]],components:DB,urlTransform:Yz,children:d})})})}var kB={archive:`bg-muted text-muted-foreground`,audio:`bg-muted text-muted-foreground`,code:`bg-muted text-muted-foreground`,data:`bg-muted text-muted-foreground`,document:`bg-muted text-muted-foreground`,generic:`bg-muted text-muted-foreground`,image:`bg-muted text-muted-foreground`,pdf:`bg-muted text-muted-foreground`,sheet:`bg-muted text-muted-foreground`,video:`bg-muted text-muted-foreground`},AB=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svg`,`ts`,`tsx`]),jB=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),MB=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),NB=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),PB=new Set([`avi`,`m4v`,`mov`,`mp4`,`mkv`,`webm`,`wmv`]),FB=new Set([`doc`,`docx`,`odt`,`pages`,`rtf`,`txt`]),IB=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),LB=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]);function RB(e){if(!Number.isFinite(e)||e==null||e<0)return null;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=10||r===0?0:1;return`${n.toFixed(i).replace(/\.0$/,``)} ${t[r]}`}function zB(e,t){let n=BB(e);if(n)return n.toUpperCase();let r=(t.split(`/`)[1]??``).split(/[+.;-]/)[0]?.trim();return r?r.slice(0,6).toUpperCase():`FILE`}function BB(e){return/\.([a-z0-9]{1,12})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function VB(e){return typeof e==`string`&&/^data:image\//i.test(e.trim())}function HB(e){return MB.has(e)?e===`jpg`||e===`jpeg`?`image/jpeg`:e===`svg`?`image/svg+xml`:`image/${e}`:NB.has(e)?e===`mp3`?`audio/mpeg`:e===`m4a`?`audio/mp4`:e===`weba`?`audio/webm`:`audio/${e}`:PB.has(e)?e===`mov`?`video/quicktime`:e===`m4v`?`video/mp4`:`video/${e}`:e===`pdf`?`application/pdf`:null}function UB(e){let t=BB(e);return t?HB(t):null}function WB(e){let t=e.mimeType.trim().toLowerCase();return t.length>0&&t!==`application/octet-stream`?t:UB(e.label)}function GB(e){let t=e.mimeType.trim().toLowerCase(),n=BB(e.label);return e.isImage||t.startsWith(`image/`)||MB.has(n)||VB(e.dataUrl)}function KB(e,t){let n=BB(e),r=t.toLowerCase();return r.startsWith(`image/`)||MB.has(n)?`image`:r.startsWith(`audio/`)||NB.has(n)?`audio`:r.startsWith(`video/`)||PB.has(n)?`video`:r.includes(`pdf`)||n===`pdf`?`pdf`:LB.has(n)||/(zip|tar|gzip|rar|compressed|archive)/.test(r)?`archive`:IB.has(n)||/(spreadsheet|sheet|excel|csv)/.test(r)?`sheet`:jB.has(n)||/(json|xml|yaml|toml)/.test(r)?`data`:AB.has(n)||/(javascript|typescript|jsx|tsx|css|html)/.test(r)?`code`:FB.has(n)||/(msword|document|opendocument|rtf|text\/)/.test(r)?`document`:`generic`}function qB(e){let t=KB(e.label,e.mimeType),n=RB(e.sizeBytes);return{category:t,extension:zB(e.label,e.mimeType),sizeLabel:n}}var JB={archive:`Archive`,audio:`Audio`,code:`Code file`,data:`Data file`,document:`Document`,generic:`File`,image:`Image`,pdf:`PDF document`,sheet:`Spreadsheet`,video:`Video`},YB={archive:$e,audio:et,code:tt,data:rt,document:at,generic:st,image:nt,pdf:at,sheet:it,video:ot};function XB(e,t){return t?.attachmentCategoryLabels?.[e]??JB[e]}function ZB(e,t,n){return(0,A.jsx)(`div`,{className:j(`mt-0.5 text-[11px] leading-4`,n?`text-foreground/55`:`text-muted-foreground`),children:t?`${e} · ${t}`:e})}function QB(e,t,n){return(0,A.jsx)(`span`,{className:j(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium`,n?t?`bg-black/5 text-foreground/75`:`bg-muted text-muted-foreground`:t?`bg-black/[0.03] text-foreground/45`:`bg-muted/70 text-muted-foreground/70`),children:e})}function $B(e){let{label:t,href:n,isUser:r,onOpen:i}=e,a=j(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors`,r?`bg-black/5 text-foreground/75 hover:bg-black/10 hover:text-foreground`:`bg-muted text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`);return i?(0,A.jsx)(`button`,{type:`button`,className:a,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:t}):n?(0,A.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:a,children:t}):QB(t,r,!1)}function eV({category:e,isUser:t}){let n=YB[e];return(0,A.jsx)(`div`,{className:j(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,t?`bg-black/5 text-foreground/70`:kB[e]),children:(0,A.jsx)(n,{className:j(`h-4 w-4`,t?`text-foreground/70`:`text-current`),strokeWidth:2})})}function tV(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:o}=e;return(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2.5 py-2`,children:[(0,A.jsx)(eV,{category:t,isUser:a}),(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:`truncate text-[13px] font-medium leading-5`,children:n.label}),ZB(r,i,a)]}),o]})})]})}function nV(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,shellClasses:o,actionLabel:s,onOpen:c}=e;if(!n.dataUrl||t!==`audio`&&t!==`video`)return null;let l=WB(n);return(0,A.jsxs)(`div`,{className:o,children:[tV({category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:$B({label:s,href:n.dataUrl,isUser:a,onOpen:c?()=>c(n):void 0})}),(0,A.jsx)(`div`,{className:`px-2.5 pb-2.5`,children:t===`audio`?(0,A.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":n.label,className:`block w-full`,children:(0,A.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})}):(0,A.jsx)(`div`,{className:j(`overflow-hidden rounded-lg`,a?`bg-black/10`:`bg-muted ring-1 ring-border/70`),children:(0,A.jsx)(`video`,{controls:!0,preload:`metadata`,playsInline:!0,"aria-label":n.label,className:`block max-h-[28rem] w-full bg-black`,children:(0,A.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})})})})]})}function rV({file:e,isUser:t=!1,texts:n,onOpen:r}){let{category:i,sizeLabel:a}=qB(e),o=GB(e)&&!!e.dataUrl,s=i===`audio`&&!!e.dataUrl,c=i===`video`&&!!e.dataUrl,l=!!e.dataUrl,u=l?n?.attachmentOpenLabel??`Open`:n?.attachmentAttachedLabel??`Attached`,d=n?.attachmentExpandLabel??`Expand image`,f=n?.attachmentCloseLabel??`Close preview`,p=XB(i,n),m=j(`block overflow-hidden rounded-xl border transition-colors`,t?`border-black/8 bg-black/[0.03] text-foreground`:`border-border/70 bg-card text-card-foreground`,l&&(t?`hover:bg-black/[0.05]`:`hover:bg-muted/50`));if(o&&e.dataUrl)return(0,A.jsx)(Rz,{alt:e.label,expandLabel:d,closeLabel:f,resetZoomLabel:n?.previewResetZoomLabel,sizeLabel:a,src:e.dataUrl,zoomInLabel:n?.previewZoomInLabel,zoomOutLabel:n?.previewZoomOutLabel});if(s||c)return nV({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,shellClasses:m,actionLabel:u,onOpen:r});let h=tV({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,action:QB(u,t,l)});return!l||!e.dataUrl?(0,A.jsx)(`div`,{className:m,children:h}):r?(0,A.jsx)(`button`,{type:`button`,className:j(m,`group w-full text-left`),onClick:()=>r(e),children:h}):(0,A.jsx)(`a`,{href:e.dataUrl,target:`_blank`,rel:`noreferrer`,className:j(m,`group`),children:h})}function iV({group:e,indexOffset:t,isUser:n,texts:r,onOpen:i}){return(0,A.jsx)(`div`,{"data-chat-message-image-row":`three-column`,"data-chat-message-wide-content":`true`,className:`grid w-full grid-cols-3 items-start gap-3`,children:e.items.map(({index:e,part:a})=>(0,A.jsx)(rV,{file:a.file,isUser:n,texts:r,onOpen:i},`file-${t+e}`))})}function aV(e){return!!(e?.kind===`part`&&e.part.type===`file`&&e.part.file.isImage&&e.part.file.dataUrl)}function oV(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!aV(r)){r&&t.push(r),n+=1;continue}let i=n,a=[];for(;aV(e[n]);)a.push(e[n]),n+=1;if(a.length<3){t.push(...a);continue}t.push({kind:`image-group`,key:`image-group-${i}`,items:a})}return t}function sV(e){let{isInProgress:t}=e,[n,r]=(0,k.useState)(t),[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(t);(0,k.useEffect)(()=>{let e=o.current;!e&&t?(r(!0),a(!1)):e&&!t&&!i&&r(!1),o.current=t},[t,i]);function s(e){e.preventDefault();let i=!n;if(r(i),!i){a(!1);return}t&&a(!0)}return{isOpen:n,onSummaryClick:s}}var cV=10;function lV(e,t=cV){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function uV(e){return e instanceof KeyboardEvent&&e.key!==`Enter`&&e.key!==` `?!1:!!((e.target instanceof Element?e.target:e.target instanceof Node?e.target.parentElement:null)?.closest(`button, a, input, textarea, select, [role="button"], summary`))?.matches(`[aria-expanded="false"]:not([aria-haspopup]):not(:disabled), details:not([open]) > summary`)}function dV(e,t){let n=e=>{uV(e)&&t()};return e?.addEventListener(`click`,n,!0),e?.addEventListener(`keydown`,n,!0),()=>{e?.removeEventListener(`click`,n,!0),e?.removeEventListener(`keydown`,n,!0)}}function fV(e,t,n,r){let i=e.getBoundingClientRect().top,a=n?n.getBoundingClientRect().top-i+e.scrollTop:r,o=t.getBoundingClientRect().top-i+e.scrollTop;return{offset:a,height:a===null?0:Math.max(0,a-o+e.clientHeight-24)}}function pV({contentRef:e,contentVersion:t,hasContent:n,isLoading:r,resetKey:i,scrollRef:a,stickyThresholdPx:o,initialScrollTop:s,turnSpace:c}){let[l,u]=(0,k.useState)(!0),d=(0,k.useRef)(s===void 0),f=(0,k.useRef)(null),p=(0,k.useRef)(!1),m=(0,k.useRef)(null),h=(0,k.useRef)(c?.key),g=(0,k.useRef)(null),_=(0,k.useRef)(null),v=(0,k.useRef)(c);(0,k.useLayoutEffect)(()=>{v.current=c});let y=(0,k.useCallback)(()=>{let e=v.current,t=a.current;if(!e?.frameRef.current||!t)return;let n=fV(t,e.frameRef.current,_.current===e.key?e.anchorRef.current:null,g.current);g.current=n.offset,e.frameRef.current.style.minHeight=`${n.height}px`},[a]),b=(0,k.useCallback)(()=>{let t=a.current;if(!t)return;let n=e?.current;u((n?n.getBoundingClientRect().bottom-t.getBoundingClientRect().top-t.clientTop-t.clientHeight:t.scrollHeight-t.scrollTop-t.clientHeight)<=(o??cV))},[e,a,o]),x=(0,k.useCallback)(e=>{d.current=e,b()},[b]),S=(0,k.useCallback)(()=>{let e=m.current;e!==null&&(cancelAnimationFrame(e),m.current=null)},[]),C=(0,k.useCallback)((e=`auto`)=>{S(),m.current=requestAnimationFrame(()=>{m.current=null;let t=a.current;t&&(y(),typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight,b())})},[S,a,y,b]),w=(0,k.useCallback)(()=>{x(!0),C()},[C,x]),T=(0,k.useCallback)(()=>{let e=a.current;if(!e)return;let t=lV(e,o);t||S(),x(t)},[S,o,a,x]);return(0,k.useEffect)(()=>dV(a.current,()=>{p.current=!1,S(),x(!1)}),[S,n,i,a,x]),(0,k.useLayoutEffect)(()=>{if(f.current===i)return;let e=f.current===null&&h.current===null;f.current=i,e||(h.current=v.current?.key),_.current=null,g.current=null,y(),x(s===void 0),p.current=s===void 0},[i,s,x,y]),(0,k.useLayoutEffect)(()=>{let e=c?.key;e!==h.current&&(h.current=e,!(!e||r||!d.current)&&(_.current=e,y(),C()))},[r,C,c?.key,y]),(0,k.useEffect)(()=>S,[S]),(0,k.useEffect)(()=>{let t=e?.current;if(!t||!n||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{y(),b(),d.current&&C()});return r.observe(t),a.current&&r.observe(a.current),()=>r.disconnect()},[e,n,C,i,a,y,b]),(0,k.useLayoutEffect)(()=>{!p.current||r||!n||(p.current=!1,C())},[n,r,C]),(0,k.useLayoutEffect)(()=>{!d.current||!n||C()},[t,n,C]),{isAtBottom:l,onScroll:T,scrollToBottom:w}}var mV=`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-current`,hV=`group/process-row flex w-full min-w-0 items-center gap-1.5 py-0 text-[0.925rem] font-normal leading-[1.72] text-muted-foreground/80`;function gV({children:e,className:t}){return(0,A.jsx)(`span`,{"data-theme-control":`process-icon`,className:j(mV,t),children:e})}function _V({position:e}){return(0,A.jsx)(`span`,{"aria-hidden":`true`,"data-tool-workflow-rail":`true`,className:j(`pointer-events-none absolute left-[0.575em] w-px -translate-x-1/2 bg-border/70`,e===`first`?`bottom-0 top-[0.86em]`:e===`last`?`top-0 h-[0.86em]`:`inset-y-0`)})}function vV({children:e,className:t,interactive:n=!1,onClick:r,role:i,tabIndex:a,onKeyDown:o,"aria-expanded":s}){return(0,A.jsx)(`div`,{"data-chat-process-meta-row":`true`,className:j(hV,n?`cursor-pointer transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`:null,t),onClick:r,role:i,tabIndex:a,onKeyDown:o,"aria-expanded":n?s:void 0,children:e})}function yV({label:e,openGroup:t,open:n=!1,icon:r,className:i,leadingIconClassName:a,labelClassName:o,onClick:s}){return(0,A.jsxs)(`button`,{type:`button`,"data-chat-process-meta-row":`true`,className:j(hV,`m-0 w-full border-0 bg-transparent p-0 text-left shadow-none transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,i),"aria-expanded":n,onClick:s,children:[r?(0,A.jsx)(gV,{className:j(`relative z-[1] rounded-sm`,a),children:(0,A.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}):null,(0,A.jsx)(`span`,{className:j(`min-w-0 shrink truncate`,o),children:e}),(0,A.jsx)(`span`,{className:j(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 focus-visible:opacity-100`),children:(0,A.jsx)(We,{className:j(`h-[1.05em] w-[1.05em] transition-transform duration-200 motion-reduce:transition-none`,n&&`rotate-90`),strokeWidth:2.25})})]})}function bV(e,t,n){let r=Array.from(t).length;return(n??`${e} · {count}`).split(`{count}`).join(String(r))}function xV({label:e,text:t,characterCountTemplates:n,isUser:r,isInProgress:i}){let{isOpen:a,onSummaryClick:o}=sV({isInProgress:i}),s=(0,k.useRef)(null),c=bV(e,t,i?n?.inProgress:n?.completed),{onScroll:l}=pV({scrollRef:s,resetKey:`reasoning`,isLoading:!1,hasContent:t.length>0,contentVersion:t,stickyThresholdPx:20});return(0,A.jsxs)(`div`,{className:`group/reasoning`,children:[(0,A.jsx)(yV,{openGroup:`reasoning`,open:a,icon:Ve,leadingIconClassName:r?`bg-primary`:`bg-card`,label:c,labelClassName:r?`text-primary-100`:void 0,onClick:o}),(0,A.jsx)(cj,{open:a,children:()=>(0,A.jsx)(`div`,{ref:s,onScroll:l,"data-reasoning-scroll":`true`,className:j(`mt-1 w-fit max-w-[500px] max-h-56 overflow-y-auto rounded-lg custom-scrollbar`,r?`bg-primary/70`:`bg-muted`),children:(0,A.jsx)(`pre`,{className:`min-w-0 whitespace-pre-wrap break-all p-2 text-[11px]`,children:t})})})]})}function SV({children:e,className:t}){return(0,A.jsx)(`div`,{className:j(`relative my-0 flex w-full min-w-0 max-w-full flex-col text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function CV({children:e,className:t}){return(0,A.jsx)(`div`,{className:j(`mt-0.5 w-full max-w-full min-w-0 overflow-hidden pl-[calc(1.15em+0.375rem)] text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function wV({label:e,tone:t,children:n}){let r={input:{dot:`bg-muted-foreground/60`,body:`text-foreground`},output:{dot:`bg-primary/70`,body:`text-foreground`},error:{dot:`bg-rose-500/80`,body:`text-rose-950/85`}}[t];return(0,A.jsxs)(`section`,{className:`overflow-hidden rounded-md border border-border/70 bg-muted/20`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5 text-[10px] font-medium tracking-wide text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:j(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,A.jsx)(`span`,{className:`normal-case tracking-normal`,children:e})]}),(0,A.jsx)(`div`,{className:`w-full overflow-hidden`,children:(0,A.jsx)(`pre`,{className:j(`w-full max-w-full min-w-0 max-h-64 overflow-x-auto overflow-y-auto px-2.5 py-2 font-mono text-[12px] leading-relaxed whitespace-pre custom-scrollbar`,r.body),children:n})})]})}var TV={running:{text:`text-muted-foreground`,icon:ke,spin:!0},success:{text:`text-muted-foreground/75`,icon:h,spin:!1},error:{text:`text-destructive`,icon:kt,spin:!1},cancelled:{text:`text-muted-foreground/70`,icon:vt,spin:!1}};function EV({card:e,iconOnly:t=!1}){let n=TV[e.statusTone]||TV.cancelled,r=n.icon,i=!t&&(e.statusTone===`running`||e.statusTone===`error`);return(0,A.jsxs)(`span`,{className:j(`inline-flex shrink-0 items-center gap-1 text-[0.925rem] font-normal leading-[1.72]`,n.text),"aria-label":t?e.statusLabel:void 0,children:[(0,A.jsx)(r,{"aria-hidden":`true`,className:j(`h-[1.05em] w-[1.05em]`,n.spin&&`animate-spin`),strokeWidth:2.25}),i?e.statusLabel:null]})}function DV(e){return e.kind===`show-content`?{icon:Ee,label:e.label,toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}:{icon:Ie,label:e.label??(e.sessionKind===`child`?`Open child session`:`Open session`),toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}}function OV({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=Ki,o=DV(e),s=o.icon;return(0,A.jsx)(i,{delayDuration:250,children:(0,A.jsxs)(n,{children:[(0,A.jsx)(a,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e)},className:j(`inline-flex h-6 w-6 items-center justify-center rounded-md border transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,o.toneClassName),"aria-label":o.label,title:o.label,children:(0,A.jsx)(s,{className:`h-3.5 w-3.5`,strokeWidth:2.25})})}),(0,A.jsx)(r,{side:`top`,className:`text-xs`,children:o.label})]})})}function kV(e){return e.replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim()}function AV(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t())}function jV({label:e,summary:t}){return(0,A.jsxs)(`span`,{className:`min-w-0 shrink truncate`,children:[e,t?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mx-1.5 select-none text-muted-foreground/45`,children:`·`}),(0,A.jsx)(`span`,{title:t,children:t})]}):null]})}function MV({expanded:e}){return(0,A.jsx)(`span`,{className:j(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,e?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`),children:(0,A.jsx)(We,{className:j(`h-[1.05em] w-[1.05em] transition-transform duration-200 motion-reduce:transition-none`,e&&`rotate-90`),strokeWidth:2.25})})}function NV({additions:e,deletions:t}){if(e===0&&t===0)return null;let n=[e>0?`+${e}`:null,t>0?`-${t}`:null].filter(Boolean).join(` `);return(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 tabular-nums text-muted-foreground/75`,"aria-label":n,children:[e>0?(0,A.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-emerald-600`,children:[`+`,e]}):null,t>0?(0,A.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-rose-600`,children:[`-`,t]}):null]})}function PV({card:e,toolLabel:t,changeSummary:n,icon:r,expanded:i,canExpand:a,hideSummary:o=!1,trailingMeta:s,actionSlot:c,onToggle:l}){let u=o?``:e.summary?.replace(/^(command|path|args|query|input):\s*/i,``)??``,d=t??kV(e.toolName);return(0,A.jsxs)(vV,{interactive:a,onClick:a?()=>l():void 0,role:a?`button`:void 0,"aria-expanded":i,tabIndex:a?0:void 0,onKeyDown:a?e=>AV(e,l):void 0,children:[(0,A.jsx)(gV,{className:`relative z-[1] rounded-sm bg-card`,children:(0,A.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}),(0,A.jsx)(jV,{label:d,summary:u}),n?(0,A.jsx)(NV,{...n}):null,(0,A.jsx)(EV,{card:e,iconOnly:!!t}),s,a?(0,A.jsx)(MV,{expanded:i}):null,c?(0,A.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`,children:c}):null]})}function FV({action:e,onAction:t}){return(0,A.jsx)(OV,{action:e,onAction:t})}var IV=`font-mono text-[11px] leading-5`,LV=`flex h-5 w-full ${IV}`,RV=`flex h-5 items-center justify-center px-2.5 tabular-nums select-none`;function zV(e){return String(e.newLineNumber??e.oldLineNumber??``)}function BV(e,t){return typeof t==`number`&&(e.newLineNumber??e.oldLineNumber)===t}function VV(e,t,n){return`${e}-${n}-${t.oldLineNumber??`x`}-${t.newLineNumber??`x`}`}function HV(e){return typeof e.newLineNumber==`number`||typeof e.oldLineNumber==`number`}function UV(e){return e.lines.some(HV)}function WV(e){let t=e.lines.reduce((e,t)=>HV(t)?Math.max(e,zV(t).length):e,0);return`${Math.max(6,Math.min(7.5,t+3))}ch`}function GV(e){return`calc(${e.lines.reduce((e,t)=>Math.max(e,Math.max(1,t.text.length)),1)}ch + 1.25rem)`}function KV(e){let t=e.split(/[\\/]/).filter(Boolean).pop()??e,n=t.split(/[?#]/)[0]??t,r=n.lastIndexOf(`.`);return r<=0||r===n.length-1?null:n.slice(r+1).toLowerCase()}function qV(e){return e.languageHint?.trim()||KV(e.path)||`text`}function JV(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?`language-${t}`:`language-text`}function YV(e){return e.kind===`remove`?`border-r border-rose-200 bg-rose-50 text-rose-700`:e.kind===`add`?`border-r border-emerald-200 bg-emerald-50 text-emerald-700`:`border-r border-border bg-muted text-muted-foreground`}function XV(e){return e.kind===`remove`?`bg-rose-50 text-rose-950`:e.kind===`add`?`bg-emerald-50 text-emerald-950`:`bg-card text-foreground`}function ZV({layout:e,line:t,lineNumberColumnWidth:n,target:r,targetRef:i}){return(0,A.jsx)(`span`,{ref:i,"data-file-line-number-cell":`true`,style:e===`compact`?{width:n,minWidth:n}:void 0,className:j(RV,e===`compact`?`sticky left-0 z-[1]`:`w-full shrink-0`,YV(t),r?`bg-gray-200 font-medium text-gray-950`:null),children:zV(t)})}function QV({language:e,line:t,target:n,targetColumn:r,targetRef:i}){let a=(0,k.useMemo)(()=>XR.highlight(t.text||` `,e),[e,t.text]),o=typeof r==`number`&&Number.isSafeInteger(r)&&r>0?Math.min(r,t.text.length+1):null;return(0,A.jsxs)(`span`,{ref:o?void 0:i,"data-file-code-row":`true`,"data-file-code-language":a.language,"data-highlighted":a.highlighted?`true`:`false`,"data-file-target-column":o??void 0,className:j(`chat-file-code-syntax hljs relative block min-w-0 flex-1 whitespace-pre px-2.5`,JV(a.language),XV(t),n?`bg-gray-100/90`:null),children:[(0,A.jsx)(`span`,{dangerouslySetInnerHTML:{__html:a.html}}),o?(0,A.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-file-target-caret":`true`,className:`pointer-events-none absolute inset-y-0 w-px bg-primary`,style:{left:`calc(0.625rem + ${o-1}ch)`}}):null]})}function $V({language:e,line:t,showLineNumbers:n,lineNumberColumnWidth:r}){return(0,A.jsxs)(`div`,{"data-file-line-row":`true`,className:LV,children:[n?(0,A.jsx)(ZV,{layout:`compact`,line:t,lineNumberColumnWidth:r}):null,(0,A.jsx)(QV,{language:e,line:t})]})}function eH({block:e,targetColumn:t,targetLine:n}){let r=UV(e),i=WV(e),a=GV(e),o=qV(e),s=(0,k.useRef)(null);return(0,k.useLayoutEffect)(()=>{s.current?.scrollIntoView({block:`center`,inline:t?`center`:`nearest`})},[e,t,n]),(0,A.jsxs)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`workspace`,className:`flex h-full min-h-full min-w-full bg-card`,children:[r?(0,A.jsxs)(`div`,{"data-file-code-gutter":`true`,style:{width:i,minWidth:i},className:j(`flex h-full min-h-full shrink-0 flex-col`,IV),children:[e.lines.map((e,r)=>(0,A.jsx)(ZV,{layout:`workspace`,line:e,lineNumberColumnWidth:i,target:BV(e,n),targetRef:!t&&BV(e,n)?s:void 0},VV(`gutter`,e,r))),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 border-r border-border bg-muted`})]}):null,(0,A.jsxs)(`div`,{"data-file-code-canvas":`true`,className:`flex h-full min-h-full min-w-0 flex-1 flex-col bg-card`,children:[(0,A.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:a},children:e.lines.map((e,i)=>{let a=BV(e,n);return(0,A.jsx)(`div`,{"data-file-code-canvas-row":`true`,"data-file-target-line":a?`true`:void 0,"aria-current":a?`location`:void 0,className:LV,children:(0,A.jsx)(QV,{language:o,line:e,target:a,targetColumn:a?t:null,targetRef:a&&(t||!r)?s:void 0})},VV(`code`,e,i))})}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 bg-card`})]})]})}function tH({block:e,layout:t=`compact`,targetColumn:n,targetLine:r}){if(t===`workspace`)return(0,A.jsx)(eH,{block:e,targetColumn:n,targetLine:r});let i=UV(e),a=WV(e),o=GV(e),s=i?`calc(${a} + ${o})`:o,c=qV(e);return(0,A.jsx)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`compact`,className:`overflow-x-auto custom-scrollbar bg-card`,children:(0,A.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:s},children:e.lines.map((e,t)=>(0,A.jsx)($V,{language:c,line:e,showLineNumbers:i,lineNumberColumnWidth:a},VV(`row`,e,t)))})})}function nH({block:e}){return(0,A.jsx)(tH,{block:e,layout:`compact`})}function rH(e){return e.display===`preview`}function iH(e){return e.rawText?e.rawText:e.lines.map(e=>[e.kind,e.oldLineNumber??``,e.newLineNumber??``,e.text].join(`:`)).join(`
171
+ `)}function aH(e){return/^\+\d+$/.test(e)?`text-emerald-700`:/^-\d+$/.test(e)?`text-rose-700`:`text-muted-foreground`}function oH(e){let t=e.split(`·`).map(e=>e.trim()).filter(e=>/^\+\d+$/.test(e)||/^-\d+$/.test(e));return t.length===0?null:(0,A.jsx)(`div`,{className:`flex shrink-0 items-center gap-x-1 whitespace-nowrap text-[10px] font-medium uppercase tracking-[0.08em]`,children:t.map((e,t)=>(0,A.jsxs)(k.Fragment,{children:[t>0?(0,A.jsx)(`span`,{className:`text-muted-foreground/45`,children:`·`}):null,(0,A.jsx)(`span`,{className:j(aH(e)),children:e})]},`${e}-${t}`))})}function sH(e){return{path:e.path,label:e.path.split(`/`).filter(Boolean).pop()??e.path,viewMode:e.display===`diff`?`diff`:`preview`,...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},fullLines:e.fullLines??e.lines}}function cH({children:e,contentVersion:t,resetKey:n,className:r,scrollKind:i}){let a=(0,k.useRef)(null),{onScroll:o}=pV({scrollRef:a,resetKey:n,isLoading:!1,hasContent:!0,contentVersion:t,stickyThresholdPx:20});return(0,A.jsx)(`div`,{ref:a,onScroll:o,"data-file-scroll-kind":i,className:j(`overflow-y-auto bg-card custom-scrollbar`,r),children:e})}function lH({block:e,showPathRow:t,isFirst:n,onFileOpen:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=Ki,c=rH(e),l=t||!!e.caption;return(0,A.jsxs)(`section`,{className:j(`overflow-hidden bg-card`,!n&&`border-t border-border`),children:[l?(0,A.jsxs)(`div`,{className:j(`flex min-h-9 items-center justify-between gap-4 border-b border-border px-3 text-muted-foreground`,t?`py-2`:`py-1.5`),children:[(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,A.jsx)(o,{delayDuration:250,children:(0,A.jsxs)(i,{children:[(0,A.jsx)(s,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,onClick:()=>{r&&r(sH(e))},className:j(`w-full truncate whitespace-nowrap text-left font-mono text-[12px] font-medium leading-5 text-foreground`,r&&`transition-colors hover:text-primary hover:underline`),title:e.path,children:e.path})}),(0,A.jsx)(a,{side:`top`,className:`max-w-[420px] text-xs font-mono break-all`,children:e.path})]})}):null}),e.caption?oH(e.caption):null]}):null,e.lines.length>0?(0,A.jsx)(cH,{resetKey:`block:${e.key}`,contentVersion:iH(e),className:`max-h-72`,scrollKind:`block`,children:(0,A.jsx)(nH,{block:e})}):e.rawText?(0,A.jsx)(cH,{resetKey:`raw:${e.key}`,contentVersion:e.rawText,className:`max-h-72`,scrollKind:`raw`,children:(0,A.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,A.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:e.rawText})})}):null,e.truncated&&!c?(0,A.jsx)(`div`,{className:`border-t border-border bg-muted px-3 py-2 text-[10px] text-muted-foreground`,children:`Showing a shortened diff preview.`}):null]})}function uH({card:e,className:t,onFileOpen:n,showPathRow:r=!0}){let i=e.fileOperation?.blocks??[],a=e.output?.trim()??``;return i.length===0&&!a?null:(0,A.jsxs)(`div`,{className:j(`overflow-hidden rounded-md border border-border/70 bg-card`,t),children:[i.map((e,t)=>(0,A.jsx)(lH,{block:e,showPathRow:r,isFirst:t===0,onFileOpen:n},e.key)),a?(0,A.jsx)(cH,{resetKey:`output:${e.toolName}:${e.summary??`none`}`,contentVersion:a,className:j(`max-h-56`,i.length>0&&`border-t border-border`),scrollKind:`output`,children:(0,A.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,A.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:a})})}):null]})}function dH(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function fH(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:null}function pH(e){let t=fH(e?.durationMs);if(t!=null)return t;let n=dH(e?.startedAt),r=dH(e?.endedAt);return n!=null&&r!=null&&r>=n?r-n:null}function mH(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${String(r).padStart(2,`0`)}m ${String(i).padStart(2,`0`)}s`:r>0?`${r}m ${String(i).padStart(2,`0`)}s`:`${i}s`}function hH(e){return!Number.isFinite(e)||e<0?null:mH(e)}function gH(e){return!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:e<6e4?`${Number((e/1e3).toFixed(2))}s`:mH(e)}function _H(){return globalThis.performance?.now()??Date.now()}function vH(e){return Math.max(0,e.baselineMs+_H()-e.monotonicStartedAt)}function yH(e,t){let n=dH(e?.startedAt),r=fH(e?.durationMs)!=null||e?.endedAt!=null,i=t&&n!=null&&!r,[a,o]=(0,k.useState)(null);return(0,k.useEffect)(()=>{if(!i||n==null||!e?.startedAt){o(null);return}let t={key:e.startedAt,baselineMs:Math.max(0,Date.now()-n),monotonicStartedAt:_H()};o({key:t.key,elapsedMs:vH(t)});let r,a=()=>{if(document.visibilityState===`hidden`)return;let e=vH(t),n=Math.max(50,1e3-e%1e3);r=setTimeout(()=>{o({key:t.key,elapsedMs:vH(t)}),a()},n)},s=()=>{r&&clearTimeout(r),r=void 0,document.visibilityState!==`hidden`&&(o({key:t.key,elapsedMs:vH(t)}),a())};return document.addEventListener(`visibilitychange`,s),a(),()=>{r&&clearTimeout(r),document.removeEventListener(`visibilitychange`,s)}},[i,e?.startedAt,n]),!i||!e?.startedAt?null:a?.key===e.startedAt?a.elapsedMs:null}function bH({execution:e,statusTone:t}){let n=pH(e),r=yH(e,t===`running`&&n==null),i=n==null?r==null?null:hH(r):gH(n);return i?(0,A.jsx)(`span`,{className:`inline-flex shrink-0 tabular-nums text-muted-foreground/75`,children:i}):null}var xH=`\x1B`,SH=RegExp(`${xH}\\[(.*?)([ -/]*[@-~])`,`g`);function CH(e){return e.includes(`${xH}[`)}function wH(e){return e.replace(RegExp(`${xH}\\[[0-?]*[ -/]*[@-~]`,`g`),``)}function TH(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var EH={bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1},DH={1:{bold:!0},2:{dim:!0},3:{italic:!0},4:{underline:!0},7:{inverse:!0},22:{bold:!1,dim:!1},23:{italic:!1},24:{underline:!1},27:{inverse:!1},39:{fg:void 0},49:{bg:void 0}},OH={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`,90:`bright-black`,91:`bright-red`,92:`bright-green`,93:`bright-yellow`,94:`bright-blue`,95:`bright-magenta`,96:`bright-cyan`,97:`bright-white`},kH={40:`black`,41:`red`,42:`green`,43:`yellow`,44:`blue`,45:`magenta`,46:`cyan`,47:`white`,100:`bright-black`,101:`bright-red`,102:`bright-green`,103:`bright-yellow`,104:`bright-blue`,105:`bright-magenta`,106:`bright-cyan`,107:`bright-white`};function AH(e,t){let n=e[t+1];return n===5&&typeof e[t+2]==`number`?{color:`ansi-256-${e[t+2]}`,consumed:2}:n===2&&typeof e[t+2]==`number`&&typeof e[t+3]==`number`&&typeof e[t+4]==`number`?{color:`rgb(${e[t+2]},${e[t+3]},${e[t+4]})`,consumed:4}:null}function jH(e,t){let n={...e};for(let e=0;e<t.length;e+=1){let r=t[e];if(r===0)return{...EH};let i=DH[r];if(i){n={...n,...i};continue}if(r===38||r===48){let i=AH(t,e);i&&(n=r===38?{...n,fg:i.color}:{...n,bg:i.color},e+=i.consumed);continue}if(OH[r]){n={...n,fg:OH[r]};continue}kH[r]&&(n={...n,bg:kH[r]})}return n}function MH(e){let t=[`ansi`];return e.bold&&t.push(`ansi-bold`),e.dim&&t.push(`ansi-dim`),e.italic&&t.push(`ansi-italic`),e.underline&&t.push(`ansi-underline`),e.inverse&&t.push(`ansi-inverse`),e.fg&&(e.fg.startsWith(`rgb(`)?t.push(`ansi-fg-custom`):e.fg.startsWith(`ansi-256-`)?(t.push(`ansi-fg-256`),t.push(e.fg)):t.push(`ansi-fg-${e.fg}`)),e.bg&&(e.bg.startsWith(`rgb(`)?t.push(`ansi-bg-custom`):e.bg.startsWith(`ansi-256-`)?(t.push(`ansi-bg-256`),t.push(e.bg)):t.push(`ansi-bg-${e.bg}`)),t.join(` `)}function NH(e){let t=[];return e.fg?.startsWith(`rgb(`)&&t.push(`color:${e.fg}`),e.bg?.startsWith(`rgb(`)&&t.push(`background-color:${e.bg}`),t.length>0?t.join(`;`):void 0}function PH(e){let t=MH(e),n=NH(e);return n?`<span class="${t}" style="${n}">`:`<span class="${t}">`}function FH(e){if(!e)return``;if(!CH(e))return TH(e);let t=``,n=0,r={...EH},i=!1,a=e=>{e&&(i||=(t+=PH(r),!0),t+=TH(e))},o=()=>{i&&=(t+=`</span>`,!1)};return e.replace(SH,(t,i,s,c)=>{if(a(e.slice(n,c)),n=c+t.length,s!==`m`)return t;let l=i.trim().length===0?[0]:i.split(`;`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e));return o(),r=jH(r,l.length>0?l:[0]),t}),a(e.slice(n)),o(),t}var IH=12e4;function LH(e){return e.length<=IH?e:`${e.slice(0,IH)}\n…`}function RH({code:e,language:t,preferAnsi:n=!1,className:r}){let i=LH(e),a=(0,k.useMemo)(()=>{if(n&&CH(i))return{html:FH(i),language:`ansi`,highlighted:!0};let e=wH(i);return XR.highlight(e,t)},[t,n,i]);return(0,A.jsx)(`code`,{className:j(`hljs chat-terminal-code`,`language-${a.language}`,r),"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})}function zH({command:e,output:t,emptyLabel:n,isRunning:r,hasOutput:i,isError:a=!1}){return(0,A.jsx)(`div`,{className:j(`chat-terminal-surface`,a?`chat-terminal-surface-error`:void 0),"data-testid":`chat-terminal-surface`,children:(0,A.jsxs)(`div`,{className:`chat-terminal-body custom-scrollbar`,children:[(0,A.jsxs)(`div`,{className:`chat-terminal-line chat-terminal-line-command`,children:[(0,A.jsx)(`span`,{className:`chat-terminal-gutter`,"aria-hidden":`true`,children:`$`}),(0,A.jsx)(`div`,{className:`chat-terminal-line-content`,children:e?(0,A.jsxs)(`pre`,{className:`chat-terminal-pre`,children:[(0,A.jsx)(RH,{code:e,language:`bash`}),r&&!i?(0,A.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,A.jsx)(`div`,{className:`chat-terminal-skeleton`})})]}),(i||!r)&&(0,A.jsx)(`div`,{className:`chat-terminal-output-block`,children:i?(0,A.jsxs)(`pre`,{className:j(`chat-terminal-pre chat-terminal-output`,a?`chat-terminal-pre-error`:void 0),children:[(0,A.jsx)(RH,{code:t,language:a?`text`:`shell`,preferAnsi:!0,className:a?`chat-terminal-code-error`:void 0}),r?(0,A.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,A.jsx)(`div`,{className:`chat-terminal-empty`,children:n})})]})})}var BH=200;function VH(e){return typeof e==`string`&&e.length>0?e:null}function HH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function UH(e,t){if(e?.trim())return e.trim();if(t==null)return``;if(typeof t==`string`)return t.trim();if(typeof t==`number`||typeof t==`boolean`)return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function WH(e){return`command`in e||`workingDir`in e||`exitCode`in e||`durationMs`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e}function GH(e){let t=VH(e.aggregated_output)??VH(e.combinedOutput)??VH(e.output);if(t)return t;let n=VH(e.stdout),r=VH(e.stderr);return!n&&!r?null:[n,r].filter(e=>!!e).join(`
172
+ `)}function KH(e,t){if(HH(t)){let e=GH(t);if(e)return e;if(WH(t))return``}if(!e)return``;let n=e.trim();if(!n.startsWith(`{`))return e;try{let t=JSON.parse(n);return HH(t)?GH(t)||(WH(t)?``:e):e}catch{return e}}function qH(e){return e===`write_file`||e===`edit_file`}function JH(e){return e.reduce((e,t)=>({additions:e.additions+t.lines.filter(e=>e.kind===`add`).length,deletions:e.deletions+t.lines.filter(e=>e.kind===`remove`).length}),{additions:0,deletions:0})}function YH({canExpand:e,isRunning:t,autoExpandWhileRunning:n=!0,expandOnError:r=!1,statusTone:i}){let[a,o]=(0,k.useState)(e&&r&&i===`error`),[s,c]=(0,k.useState)(!1),l=(0,k.useRef)(null),u=(0,k.useRef)(t),d=(0,k.useRef)(!0);return(0,k.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]),(0,k.useEffect)(()=>{if(r&&i===`error`&&e&&!s){l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(!0),u.current=t,d.current=!1;return}n&&t&&e&&!s&&!a&&(d.current||!u.current)&&(l.current=window.setTimeout(()=>{o(!0),l.current=null},BH)),t||(l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current&&!s&&o(!1)),u.current=t,d.current=!1},[n,e,r,a,s,t,i]),{expanded:a,onToggle:()=>{e&&(l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(e=>!e),c(!0))}}}function XH(e){return HH(e)?{exitCode:typeof e.exitCode==`number`?e.exitCode:typeof e.exit_code==`number`?e.exit_code:null,workingDir:VH(e.workingDir)??VH(e.cwd)??VH(e.working_directory)}:{}}function ZH({card:e,toolLabel:t}){let n=e.statusTone===`running`,r=e.summary?.replace(/^(command|path|args|query|input):\s*/i,``),i=XH(e.outputData),a=HH(e.outputData)&&WH(e.outputData),o=KH(e.output,e.outputData)||(a?``:UH(void 0,e.outputData)),s=!!o,c=n||s||a||!!r?.trim(),{expanded:l,onToggle:u}=YH({canExpand:c,isRunning:n,autoExpandWhileRunning:!1,expandOnError:c,statusTone:e.statusTone});return(0,A.jsxs)(SV,{children:[(0,A.jsx)(PV,{card:e,toolLabel:t,icon:Dt,expanded:l,canExpand:c,trailingMeta:(0,A.jsx)(bH,{execution:e.execution,statusTone:e.statusTone}),onToggle:u}),(0,A.jsx)(cj,{open:l,children:()=>(0,A.jsx)(CV,{className:`bg-transparent py-0`,children:(0,A.jsx)(zH,{command:r,output:o,emptyLabel:e.emptyLabel,isRunning:n,hasOutput:s,isError:e.statusTone===`error`,exitCode:i.exitCode,workingDir:i.workingDir})})})]})}function QH(e,t){return!!e?.trim()||t!=null}function $H(e){return{previewLineCount:e.reduce((e,t)=>e+t.lines.length,0),previewCharCount:e.reduce((e,t)=>e+(t.rawText?.length??t.lines.reduce((e,t)=>e+t.text.length+1,0)),0)}}function eU(e){return[`edit_file`,`write_file`,`apply_patch`,`file_change`].includes(e)}function tU(e){let{card:t,previewCharCount:n,previewLineCount:r}=e;return qH(t.toolName)?!(t.statusTone===`running`&&t.toolName===`write_file`&&(r>24||n>1200)):!1}function nU({card:e,toolLabel:t,onFileOpen:n}){let r=e.statusTone===`running`,i=!!e.fileOperation?.blocks.length,a=QH(e.input,e.inputData),o=QH(e.output,e.outputData),s=a&&!i,c=i||a||o,l=e.fileOperation?.blocks??[],{previewCharCount:u,previewLineCount:d}=$H(l),f=tU({card:e,previewCharCount:u,previewLineCount:d}),{expanded:p,onToggle:m}=YH({canExpand:c||r,isRunning:r,autoExpandWhileRunning:f,expandOnError:c,statusTone:e.statusTone}),h=eU(e.toolName);return(0,A.jsxs)(SV,{children:[(0,A.jsx)(PV,{card:e,toolLabel:t,changeSummary:h?JH(l):void 0,icon:h?qe:at,expanded:p,canExpand:c||r,hideSummary:!1,onToggle:m}),(0,A.jsx)(cj,{open:p&&c,children:()=>{let t=UH(e.input,e.inputData),r=UH(e.output,e.outputData);return(0,A.jsxs)(CV,{className:`bg-transparent py-0`,children:[s?(0,A.jsx)(wV,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:t}):null,s&&r?(0,A.jsx)(`div`,{className:`h-2`}):null,i||r?(0,A.jsx)(uH,{card:r&&!e.output?{...e,output:r}:e,onFileOpen:n,showPathRow:!0}):null]})}})]})}function rU({card:e,toolLabel:t,icon:n=p}){let r=e.statusTone===`running`,i=!!e.output?.trim()||e.outputData!==null&&e.outputData!==void 0,{expanded:a,onToggle:o}=YH({canExpand:i||r,isRunning:r,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,A.jsxs)(SV,{children:[(0,A.jsx)(PV,{card:e,toolLabel:t,icon:n,expanded:a,canExpand:i||r,onToggle:o}),(0,A.jsx)(cj,{open:a&&i,children:()=>(0,A.jsx)(CV,{className:`py-0`,children:(0,A.jsx)(`pre`,{className:`font-mono text-[12px] text-muted-foreground whitespace-pre-wrap break-all w-full max-w-full max-h-64 overflow-y-auto overflow-x-hidden min-w-0 custom-scrollbar leading-relaxed`,children:UH(e.output,e.outputData)})})})]})}function iU(e,t,n){let r=e.agentId&&n?n(e.agentId):null,i=e.action&&t?(0,A.jsx)(FV,{action:e.action,onAction:t}):null;return r||i?(0,A.jsxs)(A.Fragment,{children:[r,i]}):void 0}function aU({card:e,toolLabel:t,icon:n=jt,onToolAction:r,renderToolAgent:i}){let a=e.statusTone===`running`,o=!!e.input?.trim()||e.inputData!==null&&e.inputData!==void 0,s=!!e.output?.trim()||e.outputData!==null&&e.outputData!==void 0,c=o||s,l=iU(e,r,i),{expanded:u,onToggle:d}=YH({canExpand:c||a,isRunning:a,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,A.jsxs)(SV,{children:[(0,A.jsx)(PV,{card:e,toolLabel:t,icon:n,expanded:u,canExpand:c||a,actionSlot:l,onToggle:d}),(0,A.jsx)(cj,{open:u&&c,children:()=>(0,A.jsxs)(CV,{className:`bg-transparent py-0`,children:[o?(0,A.jsx)(wV,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:UH(e.input,e.inputData)}):null,o&&s?(0,A.jsx)(`div`,{className:`h-2`}):null,s?(0,A.jsx)(wV,{label:e.outputLabel?.trim()||`Output`,tone:e.statusTone===`error`?`error`:`output`,children:UH(e.output,e.outputData)}):null]})})]})}function oU({card:e,onToolAction:t,renderPanelAppCard:n}){let{panelApp:r}=e;return r&&n?n(r):(0,A.jsx)(aU,{card:e,onToolAction:t})}function sU(e){let t=e.toLowerCase();return t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t.includes(`run_`)}function cU(e){let t=e.toLowerCase();return t===`read_file`||t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function lU(e){let t=e.toLowerCase();return t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function uU(e){let t=e.toLowerCase();return t===`grep_search`||t===`find_files`||t.includes(`search`)}var dU={list_dir:{statusKind:`directory`,icon:ut},web_fetch:{statusKind:`web`,icon:Xe},message:{statusKind:`message`,icon:wt},sessions_list:{statusKind:`session`,icon:je},sessions_history:{statusKind:`session`,icon:je},sessions_request:{statusKind:`session`,icon:je},spawn:{statusKind:`agent`,icon:Be},sessions_spawn:{statusKind:`agent`,icon:Be},subagents:{statusKind:`agent`,icon:Be},memory_search:{statusKind:`memory`,icon:Ve},memory_get:{statusKind:`memory`,icon:Ve},cron:{statusKind:`schedule`,icon:He},gateway:{statusKind:`system`,icon:Ae},view_image:{statusKind:`image`,icon:ft},show_file:{statusKind:`display`,icon:Ee},show_url:{statusKind:`display`,icon:Ee},show_panel_app:{statusKind:`display`,icon:Ee},show_content:{statusKind:`display`,icon:Ee}};function fU(e){return dU[e.toLowerCase()]??null}function pU({card:e,toolStatusLabels:t,onToolAction:n,onFileOpen:r,renderToolAgent:i,renderPanelAppCard:a}){if(e.panelApp)return(0,A.jsx)(oU,{card:e,onToolAction:n,renderPanelAppCard:a});let o=fU(e.toolName),s=o?t?.builtIn?.[o.statusKind]?.[e.statusTone]:void 0;return sU(e.toolName)?(0,A.jsx)(ZH,{card:e,toolLabel:t?.terminal[e.statusTone]}):cU(e.toolName)?(0,A.jsx)(nU,{card:e,toolLabel:lU(e.toolName)?t?.fileEdit[e.statusTone]:t?.fileRead[e.statusTone],onFileOpen:r}):uU(e.toolName)?(0,A.jsx)(rU,{card:e,toolLabel:s??t?.search[e.statusTone],icon:o?.icon}):(0,A.jsx)(aU,{card:e,toolLabel:s,icon:o?.icon,onToolAction:n,renderToolAgent:i})}function mU({children:e,label:t}){let n=(0,k.useRef)(null),r=(0,k.useRef)(null);return(0,k.useLayoutEffect)(()=>{let e=n.current,t=r.current;if(!e||!t)return;let i=()=>{let t=e.scrollTop>1,n=e.scrollHeight-e.clientHeight-e.scrollTop>1,r=t||n?`linear-gradient(to bottom, ${t?`transparent, black 16px`:`black`}, ${n?`black calc(100% - 16px), transparent`:`black`})`:`none`;e.style.maskImage=r,e.style.webkitMaskImage=r};i(),e.addEventListener(`scroll`,i,{passive:!0});let a=typeof ResizeObserver>`u`?null:new ResizeObserver(i);return a?.observe(e),a?.observe(t),()=>{e.removeEventListener(`scroll`,i),a?.disconnect()}},[]),(0,A.jsx)(`div`,{ref:n,role:`region`,"aria-label":t,tabIndex:0,className:`max-h-[50dvh] overflow-y-auto custom-scrollbar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,children:(0,A.jsx)(`div`,{ref:r,className:`text-[0.925rem] leading-[1.72]`,children:e})})}var hU=40;function gU({group:e,open:t,isUser:n,reasoningCharacterCountTemplates:r,toolStatusLabels:i,showMoreTemplate:a,onToolAction:o,onFileOpen:s,renderToolAgent:c,renderPanelAppCard:l,onOpenChange:u}){let[d,f]=(0,k.useState)(hU);(0,k.useEffect)(()=>{f(hU)},[e.key]);let p=e.parts.filter(e=>e.type===`tool-card`).length>1,m=e.parts.slice(0,d),h=Math.max(0,e.parts.length-m.length),g=Math.min(hU,h),_=(a??`Show next {count} ({remaining} remaining)`).replace(`{count}`,String(g)).replace(`{remaining}`,String(h));return(0,A.jsxs)(`div`,{className:`group/tool-activity`,children:[(0,A.jsx)(yV,{openGroup:`tool-activity`,open:t,icon:At,leadingIconClassName:`bg-card`,label:e.label,onClick:()=>u(!t)}),(0,A.jsx)(cj,{open:t,children:()=>(0,A.jsxs)(mU,{label:e.label,children:[m.map((t,a)=>{let u=a===m.length-1;return(0,A.jsxs)(`div`,{className:`relative min-w-0`,children:[p?(0,A.jsx)(_V,{position:a===0?`first`:u?`last`:`middle`}):null,t.type===`tool-card`?(0,A.jsx)(pU,{card:t.card,toolStatusLabels:i,onToolAction:o,onFileOpen:s,renderToolAgent:c,renderPanelAppCard:l}):(0,A.jsx)(xV,{label:t.label,text:t.text,characterCountTemplates:r,isUser:n,isInProgress:!1})]},t.type===`tool-card`&&t.card.toolCallId?`tool-group-call-${t.card.toolCallId}`:`tool-group-item-${e.startIndex+a}`)}),h>0?(0,A.jsx)(`button`,{type:`button`,className:`ml-6 mt-1 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>f(e=>e+hU),children:_}):null]})})]})}function _U({open:e,state:t,label:n,texts:r,onToggle:i,onRetry:a,children:o}){let s=r.toolPayloadLoadingLabel??`Loading details`,c=r.toolPayloadLoadFailedLabel??`Couldn’t load details. Try again`;return(0,A.jsxs)(`div`,{className:`group/process`,children:[(0,A.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-2`,children:(0,A.jsx)(yV,{openGroup:`process`,open:e,label:n,onClick:i})}),(0,A.jsx)(cj,{open:e,children:()=>t===`loading`||t===`summary`?(0,A.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`mb-4 space-y-3 py-2 text-sm text-muted-foreground`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(ke,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,A.jsx)(`span`,{children:s})]}),(0,A.jsxs)(`div`,{"aria-hidden":`true`,className:`space-y-2 border-l-2 border-border/60 pl-4 motion-safe:animate-pulse`,children:[(0,A.jsx)(`div`,{className:`h-3 w-2/5 rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-3/4 rounded bg-muted`}),(0,A.jsx)(`div`,{className:`h-3 w-1/2 rounded bg-muted`})]})]}):t===`error`?(0,A.jsx)(`div`,{role:`alert`,className:`mb-4 py-2 text-sm text-muted-foreground`,children:(0,A.jsx)(`button`,{type:`button`,className:`rounded text-left underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,onClick:a,children:c})}):o()})]})}var vU=3;function yU(e){return e.type===`tool-card`}function bU(e){return e?.type===`reasoning`||e?.type===`tool-card`&&!e.card.panelApp}function xU(e){let t=e.toLowerCase();return t===`list_dir`?`directory`:t.includes(`show_content`)||t.includes(`panel_app`)||t.includes(`panel`)?`panel`:t===`spawn`||t.includes(`subagent`)||t.includes(`session_request`)||t.includes(`agent`)&&!t.includes(`read`)?`agent`:t.includes(`web_`)||t.includes(`_web`)||t.includes(`url`)||t.includes(`fetch`)||t.includes(`http`)?`web`:t===`grep_search`||t===`find_files`||t===`search_files`||t.includes(`search`)||t.includes(`grep`)?`search`:t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t===`terminal`||t.includes(`run_`)?`bash`:t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`||t===`multi_replace`||t.includes(`write_file`)||t.includes(`edit_file`)||t.includes(`apply_patch`)?`edit`:t===`read_file`||t===`read`||t===`view_file`||t.includes(`read_file`)||t.startsWith(`read_`)?`read`:`other`}function SU(e){return e===`error`?0:e===`cancelled`?1:e===`running`?2:3}function CU(e,t,n){if(t!==`read`&&t!==`edit`&&t!==`directory`)return[`call:${n}`];let r=e.fileOperation?.blocks.map(({path:e})=>e.trim()).filter(Boolean),i=e.summary?.replace(/^(path|file):\s*/i,``).trim();return r?.length?r:[i||`call:${n}`]}function wU(e,t){let n=t.segmentTemplates[e.family],r=e.count===1?n.one:n.other.split(`{count}`).join(String(e.count)),i=e.exceptionCounts?.error??(e.tone===`error`?e.count:0),a=e.exceptionCounts?.cancelled??(e.tone===`cancelled`?e.count:0);return i===e.count?`${r} ${t.failedLabel}`:a===e.count?`${r} ${t.cancelledLabel}`:[r,i>0?`${i}/${e.count} ${t.failedLabel}`:null,a>0?`${a}/${e.count} ${t.cancelledLabel}`:null].filter(Boolean).join(` · `)}function TU(e){let t=[],n=new Map;for(let[r,i]of e.entries()){let e=xU(i.toolName),a=CU(i,e,r),o=n.get(e);if(!o){t.push(e),n.set(e,{unitTones:new Map(a.map(e=>[e,i.statusTone]))});continue}a.forEach(e=>o.unitTones.set(e,i.statusTone))}let r=t.map(e=>{let t=n.get(e),r=[...t.unitTones.values()],i=r.reduce((e,t)=>SU(t)<SU(e)?t:e,`success`);return{family:e,count:t.unitTones.size,tone:i,exceptionCounts:{error:r.filter(e=>e===`error`).length,cancelled:r.filter(e=>e===`cancelled`).length}}});return r.sort((e,n)=>{let r=SU(e.tone)-SU(n.tone);return r===0?t.indexOf(e.family)-t.indexOf(n.family):r}),r}function EU(e){let{labels:t,segments:n}=e;if(n.length===0)return``;let r=n.slice(0,vU),i=n.length-r.length,a=r.map(e=>wU(e,t));return i>0&&a.push(`+${i}`),a.join(` · `)}function DU(e,t){let n=[],r=t,i=-1;for(;;){let t=e[r];if(!bU(t))break;n.push(t),t.type===`tool-card`&&(i=n.length-1),r+=1}return{candidateParts:n,lastToolOffset:i}}function OU(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type!==`tool-card`||i.card.panelApp){n.push({kind:`part`,key:`part-${r}`,index:r,part:i}),r+=1;continue}let a=r,{candidateParts:o,lastToolOffset:s}=DU(e,a),c=o.filter(yU);if(c.length===1){n.push({kind:`part`,key:`part-${a}`,index:a,part:i}),r=a+1;continue}let l=o.slice(0,s+1);r=a+l.length;let u=TU(c.map(e=>e.card)),d=EU({segments:u,labels:t});n.push({kind:`tool-group`,key:`tool-group-${a}`,group:{key:`tool-group-${a}`,startIndex:a,endIndex:r-1,parts:l,segments:u,label:d}})}return n}var kU=new Set;function AU(e){let{messageId:t,onRequest:n,state:r}=e,[i,a]=(0,k.useState)(!1),[o,s]=(0,k.useState)(()=>new Set),c=r===void 0||r===`ready`,l=()=>{(r===`summary`||r===`error`)&&n?.(t)};return{handleProcessToggle:()=>{if(i)return a(!1);a(!0),l()},handleToolActivityOpenChange:(e,t)=>{t&&!c&&l(),s(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),t&&a(!0)},openToolGroupKeys:c?o:kU,processOpen:i}}var jU={segmentTemplates:{read:{one:`Read 1 file`,other:`Read {count} files`},edit:{one:`Edit 1 file`,other:`Edit {count} files`},directory:{one:`View 1 directory`,other:`View {count} directories`},search:{one:`Search 1 time`,other:`Search {count} times`},bash:{one:`Run 1 command`,other:`Run {count} commands`},web:{one:`Open 1 page`,other:`Open {count} pages`},agent:{one:`Start 1 subtask`,other:`Start {count} subtasks`},panel:{one:`Show 1 result`,other:`Show {count} results`},other:{one:`Use 1 tool`,other:`Use {count} tools`}},failedLabel:`failed`,cancelledLabel:`cancelled`};function MU(e){return{segmentTemplates:{...jU.segmentTemplates,...e.toolActivitySegmentTemplates??{}},failedLabel:e.toolActivityFailedLabel??jU.failedLabel,cancelledLabel:e.toolActivityCancelledLabel??jU.cancelledLabel}}function NU(e){return e.type===`reasoning`||e.type===`tool-card`||e.type===`custom`&&e.process===!0}function PU(e,t){if(e.role!==`assistant`||!e.processSummary||t)return null;let n=-1;for(let t=e.parts.length-1;t>=0;--t)if(NU(e.parts[t])){n=t;break}return n<0||n>=e.parts.length-1?null:{processParts:e.parts.slice(0,n+1),finalParts:e.parts.slice(n+1)}}function FU({index:e,isInProgress:t,isLastPart:n,isUser:r,onAttachmentOpen:i,onFileOpen:a,onInlineTokenClick:o,onToolAction:s,part:c,renderCustomPart:l,renderInlineDisplay:u,renderPanelAppCard:d,renderToolAgent:f,resolveFileContentUrl:p,role:m,texts:h}){let{type:g}=c;if(g===`custom`){let e=l?.(c);return e===void 0?null:(0,A.jsx)(`div`,{className:`min-w-0`,children:e},`custom-${c.customType}-${c.id}`)}if(g===`markdown`){let{inlineTokens:r,text:i}=c;return(0,A.jsx)(OB,{text:i,role:m,texts:h,isStreaming:t&&n,inlineTokens:r,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:p,renderInlineDisplay:u},`markdown-${e}`)}if(g===`reasoning`){let{label:i,text:a}=c;return(0,A.jsx)(xV,{label:i,text:a,characterCountTemplates:h.reasoningCharacterCountTemplates,isUser:r,isInProgress:t&&n},`reasoning-${e}`)}if(g===`tool-card`){let{card:t}=c;return(0,A.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,A.jsx)(_V,{position:`single`}),(0,A.jsx)(pU,{card:t,toolStatusLabels:h.toolStatusLabels,onToolAction:s,onFileOpen:a,renderToolAgent:f,renderPanelAppCard:d})]},`tool-${e}`)}if(g===`file`){let{file:t}=c;return(0,A.jsx)(rV,{file:t,isUser:r,texts:h,onOpen:i},`file-${e}`)}if(g===`unknown`){let{label:t,rawType:n,text:r}=c;return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/60 px-2.5 py-2 text-xs text-muted-foreground`,children:[(0,A.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[t,`: `,n]}),r?(0,A.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground`,children:r}):null]},`unknown-${e}`)}return null}function IU(e){let{isInProgress:t,isUser:n,onAttachmentOpen:r,onFileOpen:i,onInlineTokenClick:a,onToolActivityOpenChange:o,onToolAction:s,openToolGroupKeys:c,parts:l,renderCustomPart:u,renderInlineDisplay:d,renderPanelAppCard:f,renderToolAgent:p,resolveFileContentUrl:m,role:h,texts:g,indexOffset:_=0}=e;return oV(OU(l,MU(g))).map(e=>e.kind===`image-group`?(0,A.jsx)(iV,{group:e,indexOffset:_,isUser:n,texts:g,onOpen:r},`${e.key}-${_}`):e.kind===`tool-group`?(0,A.jsx)(gU,{group:e.group,open:c.has(e.group.key),isUser:n,reasoningCharacterCountTemplates:g.reasoningCharacterCountTemplates,toolStatusLabels:g.toolStatusLabels,showMoreTemplate:g.toolActivityShowMoreTemplate,onToolAction:s,onFileOpen:i,renderToolAgent:p,renderPanelAppCard:f,onOpenChange:t=>o(e.group.key,t)},e.key):FU({part:e.part,index:_+e.index,role:h,isUser:n,isInProgress:t,isLastPart:_+e.index===_+l.length-1,texts:g,onToolAction:s,onFileOpen:i,onAttachmentOpen:r,onInlineTokenClick:a,resolveFileContentUrl:m,renderCustomPart:u,renderInlineDisplay:d,renderToolAgent:p,renderPanelAppCard:f}))}var LU=(0,k.memo)(function({layout:e,message:t,isInProgress:n,texts:r,onToolAction:i,toolPayloadState:a,onToolPayloadRequest:o,onFileOpen:s,onAttachmentOpen:c,onInlineTokenClick:l,renderInlineDisplay:u,renderCustomPart:d,renderToolAgent:f,renderPanelAppCard:p,resolveFileContentUrl:m}){let{role:h}=t,g=h===`user`,_=e===`flat`&&!g,v=PU(t,n),{handleProcessToggle:y,handleToolActivityOpenChange:b,openToolGroupKeys:x,processOpen:S}=AU({messageId:t.id,state:a,onRequest:o});return(0,A.jsx)(`div`,{"data-chat-message-surface":_?`flat`:`card`,className:j(`max-w-full has-[[data-chat-message-wide-content=true]]:w-full`,_?`block w-full text-foreground`:`inline-block w-fit rounded-2xl border px-4 shadow-sm`,!_&&(g?`nextclaw-chat-message-user rounded-[1.45rem] border-primary bg-primary py-2.5 text-primary-foreground shadow-none`:h===`assistant`?`border-border bg-card pb-3 pt-4 text-card-foreground`:`border-border bg-muted/45 py-3 text-foreground`)),children:(0,A.jsx)(`div`,{className:`space-y-0`,children:v?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(_U,{open:S,state:a,label:t.processSummary?.label,texts:r,onToggle:y,onRetry:()=>void o?.(t.id),children:()=>IU({parts:v.processParts,role:h,isUser:g,isInProgress:n,texts:r,onToolAction:i,onFileOpen:s,onAttachmentOpen:c,onInlineTokenClick:l,resolveFileContentUrl:m,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:d,renderInlineDisplay:u,renderToolAgent:f,renderPanelAppCard:p})}),IU({parts:v.finalParts,role:h,isUser:g,isInProgress:n,texts:r,onToolAction:i,onFileOpen:s,onAttachmentOpen:c,onInlineTokenClick:l,resolveFileContentUrl:m,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:d,renderInlineDisplay:u,renderToolAgent:f,renderPanelAppCard:p,indexOffset:v.processParts.length})]}):IU({parts:t.parts,role:h,isUser:g,isInProgress:n,texts:r,onToolAction:i,onFileOpen:s,onAttachmentOpen:c,onInlineTokenClick:l,resolveFileContentUrl:m,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:d,renderInlineDisplay:u,renderToolAgent:f,renderPanelAppCard:p})})})});function RU({messageText:e,texts:t}){let{copied:n,copy:r}=aR({text:e}),i=n?t.copiedMessageLabel:t.copyMessageLabel,{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Ki;return e?(0,A.jsx)(s,{delayDuration:250,children:(0,A.jsxs)(a,{children:[(0,A.jsx)(c,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,onClick:()=>void r(),className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,"aria-label":i,children:n?(0,A.jsx)(h,{className:`h-3.5 w-3.5`}):(0,A.jsx)(Ye,{className:`h-3.5 w-3.5`})})}),(0,A.jsx)(o,{side:`top`,className:`text-xs`,children:i})]})}):null}function zU({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=Ki;return(0,A.jsx)(i,{delayDuration:250,children:(0,A.jsxs)(n,{children:[(0,A.jsx)(a,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":e.label,className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground`,disabled:e.disabled,onClick:()=>t(e),children:e.icon===`edit`?(0,A.jsx)(bt,{className:`h-3.5 w-3.5`}):(0,A.jsx)(Ke,{"data-testid":`chat-continue-message-icon`,className:`h-3.5 w-3.5`})})}),(0,A.jsx)(r,{side:`top`,className:`text-xs`,children:e.label})]})})}function BU({action:e,open:t,onOpenChange:n,restoreFocusRef:r}){let{Dialog:i,DialogContent:a,DialogDescription:o,DialogHeader:s,DialogTitle:c}=Ki;return(0,A.jsx)(i,{open:t,onOpenChange:n,children:(0,A.jsxs)(a,{className:`max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-xl`,closeLabel:e.dialog.closeLabel,onCloseAutoFocus:e=>{e.preventDefault(),r.current?.focus()},children:[(0,A.jsxs)(s,{className:`space-y-1 pr-8 text-left`,children:[(0,A.jsx)(c,{className:`text-lg font-semibold leading-tight text-foreground`,children:e.dialog.title}),e.dialog.description?(0,A.jsx)(o,{className:`text-sm leading-relaxed text-muted-foreground`,children:e.dialog.description}):null]}),(0,A.jsx)(`dl`,{className:`divide-y divide-border/70 rounded-xl border border-border/80 bg-muted/20 px-4`,children:e.dialog.rows.map(e=>(0,A.jsxs)(`div`,{className:`grid gap-1 py-3 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-4`,children:[(0,A.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,A.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-xs leading-5 text-foreground`,children:e.value})]},e.label))})]})})}function VU({message:e}){let[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(null),s=(0,k.useRef)(null),{moreActions:c}=e,{Popover:l,PopoverContent:u,PopoverTrigger:d,Tooltip:f,TooltipContent:p,TooltipProvider:m,TooltipTrigger:h}=Ki;return c?.items.length?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(l,{open:t,onOpenChange:n,children:[(0,A.jsx)(m,{delayDuration:250,children:(0,A.jsxs)(f,{children:[(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(`button`,{ref:s,type:`button`,"aria-label":c.triggerLabel,className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,children:(0,A.jsx)(Ze,{className:`h-3.5 w-3.5`})})})}),(0,A.jsx)(p,{side:`top`,className:`text-xs`,children:c.triggerLabel})]})}),(0,A.jsx)(u,{align:`end`,variant:`menu`,role:`menu`,onCloseAutoFocus:e=>{r&&e.preventDefault()},children:c.items.map(e=>(0,A.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${bi} text-foreground ${xi.item}`,onClick:()=>{n(!1),o(e),i(!0)},children:[e.icon?(0,A.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:e.icon}):null,(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.key))})]}),a?(0,A.jsx)(BU,{action:a,open:r,onOpenChange:i,restoreFocusRef:s}):null]}):null}function HU({message:e,onAction:t,texts:n}){let r=(0,k.useMemo)(()=>e.parts.map(e=>e.type===`markdown`||e.type===`unknown`?e.text:``).filter(e=>!!e?.trim()).join(`
173
+
174
+ `),[e.parts]);return(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 [@container_message-list_(max-width:520px)]:[&>button]:min-h-7 [@container_message-list_(max-width:520px)]:[&>button]:min-w-7`,children:[t?e.actions?.map(e=>(0,A.jsx)(zU,{action:e,onAction:t},e.key)):null,(0,A.jsx)(RU,{messageText:r,texts:n}),(0,A.jsx)(VU,{message:e})]})}var UU=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g,WU=`
175
+ @keyframes nextclaw-chat-typing-text-sheen {
176
+ 0% {
177
+ background-position: 160% 0;
178
+ }
179
+ 100% {
180
+ background-position: -60% 0;
181
+ }
182
+ }
183
+ .nextclaw-chat-typing-indicator__text {
184
+ background-image: linear-gradient(
185
+ 100deg,
186
+ hsl(var(--muted-foreground)) 0%,
187
+ hsl(var(--muted-foreground)) 34%,
188
+ hsl(var(--foreground-tertiary)) 43%,
189
+ hsl(var(--foreground-muted)) 50%,
190
+ hsl(var(--foreground-tertiary)) 57%,
191
+ hsl(var(--muted-foreground)) 66%,
192
+ hsl(var(--muted-foreground)) 100%
193
+ );
194
+ background-size: 240% 100%;
195
+ background-position: 160% 0;
196
+ -webkit-background-clip: text;
197
+ background-clip: text;
198
+ color: transparent;
199
+ -webkit-text-fill-color: transparent;
200
+ animation: nextclaw-chat-typing-text-sheen 2.5s linear infinite;
201
+ }
202
+
203
+ @media (prefers-reduced-motion: reduce) {
204
+ .nextclaw-chat-typing-indicator__text {
205
+ animation: none;
206
+ background-image: none;
207
+ color: hsl(var(--muted-foreground));
208
+ -webkit-text-fill-color: currentColor;
209
+ }
210
+ }
211
+ `;function GU(e){let t=e.trim();return t?t.replace(UU,``).trim().length>0:!1}function KU(e){return(e.role===`assistant`||e.role===`user`)&&e.status!==`streaming`&&e.status!==`pending`}function qU(e){return e.role!==`user`&&(e.status===`streaming`||e.status===`pending`)}function JU(e,t){return e.role===`user`&&e.status===`pending`?{label:t.pendingInputLabel??`Waiting for the next step`,role:`status`}:{label:`${e.roleLabel} · ${e.timestampLabel}`}}function YU(e){return e.parts.some(e=>e.type===`markdown`||e.type===`reasoning`?GU(e.text):!0)}function XU(e,t){return e===`flat`&&!t}function ZU(){return(0,A.jsx)(`div`,{className:`flex items-center gap-2 px-1 py-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsxs)(`div`,{className:`flex space-x-1 items-center h-full`,children:[(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse`}),(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:200ms]`}),(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:400ms]`})]})})}function QU({label:e,layout:t}){return(0,A.jsxs)(`div`,{"data-chat-message-surface":t===`flat`?`flat`:`card`,className:j(`text-sm text-muted-foreground`,t===`flat`?`py-1`:`rounded-2xl border border-border bg-card px-4 py-3 shadow-sm`),children:[(0,A.jsx)(`style`,{children:WU}),(0,A.jsx)(`span`,{className:`nextclaw-chat-typing-indicator__text`,children:e})]})}function $U({assistantAvatarIcon:e,showAssistantHeader:t=!0,className:n,isSending:r,layout:i=`card`,messages:a,onAttachmentOpen:o,onFileOpen:s,onInlineTokenClick:c,onMessageAction:l,onToolAction:u,resolveMessageToolPayloadState:d,onMessageToolPayloadRequest:f,renderCustomPart:p,renderInlineDisplay:m,renderMessageContent:h,renderPanelAppCard:g,renderToolAgent:_,resolveFileContentUrl:v,texts:y}){let b=XU(i,t),x=a.filter(YU),S=r?a.findLast(qU):void 0,C=S?YU(S):!1;return(0,A.jsxs)(`div`,{className:j(`nextclaw-message-list space-y-5 [container:message-list/inline-size]`,n),children:[x.map(t=>{let n=t.role===`user`,r=t.id===S?.id,a=JU(t,y),x=KU(t),C=(0,A.jsx)(LU,{layout:i,message:t,isInProgress:r,texts:y,onToolAction:u,toolPayloadState:d?.(t.id),onToolPayloadRequest:f,onFileOpen:s,onAttachmentOpen:o,onInlineTokenClick:c,resolveFileContentUrl:v,renderCustomPart:p,renderInlineDisplay:m,renderToolAgent:_,renderPanelAppCard:g}),w=h?.(t)??C;return i===`flat`&&!n?(0,A.jsxs)(`article`,{"data-chat-message-id":t.id,"data-chat-message-layout":`flat`,"data-chat-message-role":t.role,"data-chat-message-role-label":t.roleLabel,"data-chat-message-selectable":String(x),className:`w-full min-w-0 space-y-2`,children:[(0,A.jsxs)(`div`,{"data-chat-message-header":`flat`,hidden:b,className:j(`flex min-w-0 items-center gap-2.5`,{hidden:b}),children:[(0,A.jsx)(i_,{assistantIcon:e,role:t.role,size:`compact`}),(0,A.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:t.roleLabel})]}),(0,A.jsx)(`div`,{"data-chat-message-body":`flat`,className:`min-w-0 w-full`,children:w}),r?(0,A.jsx)(`div`,{className:`w-full`,children:(0,A.jsx)(ZU,{})}):(0,A.jsxs)(`div`,{"data-chat-message-footer":`flat`,className:`flex min-w-0 items-center gap-1`,children:[(0,A.jsxs)(`span`,{className:`min-w-0 truncate px-1 text-[11px] leading-4 text-muted-foreground`,title:t.timestampLabel,children:[t.timestampLabel,t.executionSummaryLabel?(0,A.jsxs)(`span`,{className:`[@container_message-list_(max-width:520px)]:hidden`,children:[` · `,t.executionSummaryLabel]}):null]}),(0,A.jsx)(HU,{message:t,onAction:e=>l?.(t,e),texts:y})]})]},t.id):(0,A.jsxs)(`div`,{"data-chat-message-id":t.id,"data-chat-message-layout":`card`,"data-chat-message-role":t.role,"data-chat-message-role-label":t.roleLabel,"data-chat-message-selectable":String(x),className:j(`flex gap-3`,n?`justify-end`:`justify-start`),children:[n?null:(0,A.jsx)(i_,{assistantIcon:e,role:t.role}),(0,A.jsxs)(`div`,{className:j(`w-fit max-w-[92%] space-y-2 has-[[data-chat-message-wide-content=true]]:w-full`,n&&`flex flex-col items-end`),children:[w,(0,A.jsx)(`div`,{className:j(`flex min-w-0 max-w-full items-center gap-1`,n&&`justify-end`),children:r?(0,A.jsx)(ZU,{}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{role:a.role,className:j(`min-w-0 truncate px-1 text-[11px] leading-4 text-muted-foreground`,n?`text-right`:`text-left`),children:[a.label,t.executionSummaryLabel?(0,A.jsxs)(`span`,{className:`[@container_message-list_(max-width:520px)]:hidden`,children:[` · `,t.executionSummaryLabel]}):null]}),(0,A.jsx)(HU,{message:t,onAction:e=>l?.(t,e),texts:y})]})})]}),n?(0,A.jsx)(i_,{role:t.role}):null]},t.id)}),r&&!C?(0,A.jsxs)(`div`,{"data-chat-message-layout":i,className:`flex justify-start gap-3`,children:[(0,A.jsx)(`div`,{hidden:b,className:j({hidden:b}),children:(0,A.jsx)(i_,{assistantIcon:e,role:`assistant`,size:i===`flat`?`compact`:`default`})}),(0,A.jsx)(QU,{label:y.typingLabel,layout:i})]}):null]})}var eW=12,tW=10;function nW(e,t){return t.rangeCount>0&&!t.isCollapsed&&e.contains(t.getRangeAt(0).commonAncestorContainer)}function rW(e){return typeof e.getClientRects==`function`?Array.from(e.getClientRects()).filter(e=>e.width>0||e.height>0):[]}function iW(e){if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE)return rW(e);let t=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=[];for(let r=t.nextNode();r;r=t.nextNode()){if(!(r instanceof Text)||!r.data||!e.intersectsNode(r))continue;let t=document.createRange();t.selectNodeContents(r),r===e.startContainer&&t.setStart(r,e.startOffset),r===e.endContainer&&t.setEnd(r,e.endOffset),n.push(...rW(t))}return n}function aW(e){let t=iW(e),n=t.length>0?t:rW(e),r=n.length>0?n:[e.getBoundingClientRect()],i=r.map(e=>({bottom:Math.min(e.bottom,window.innerHeight),left:Math.max(e.left,0),right:Math.min(e.right,window.innerWidth),top:Math.max(e.top,0)})).filter(e=>e.right>e.left&&e.bottom>e.top),a=i.length>0?i:r,o=Math.min(...a.map(e=>e.left)),s=Math.max(...a.map(e=>e.right));return{bottom:Math.max(...a.map(e=>e.bottom)),center:o+(s-o)/2,top:Math.min(...a.map(e=>e.top))}}function oW(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function sW({actionLabel:e,children:t,className:n=`contents`,isSelectionAllowed:r,maxCharacters:i,onAddToChat:a,selectionTooLongLabel:o}){let s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(!1),u=(0,k.useRef)(null),[d,f]=(0,k.useState)(null),[p,m]=(0,k.useState)(null),h=(0,k.useCallback)(()=>{let e=s.current,t=window.getSelection();if(!e||!t||!nW(e,t)){f(null);return}let n=t.toString().trim();if(!n){f(null);return}let a=t.getRangeAt(0),o=aW(a),c={range:a.cloneRange(),text:n};if(r&&!r(c)){f(null);return}m(null),f({anchorBottom:o.bottom,anchorCenter:o.center,anchorTop:o.top,selection:c,tooLong:n.length>i})},[r,i]),g=(0,k.useCallback)(()=>{u.current!==null&&window.cancelAnimationFrame(u.current),u.current=window.requestAnimationFrame(()=>{u.current=null,h()})},[h]),_=(0,k.useCallback)(e=>{if(c.current=e,!d||!e)return;let t=e.getBoundingClientRect(),n=oW(d.anchorCenter-t.width/2,eW,window.innerWidth-eW-t.width),r=d.anchorBottom+tW,i=d.anchorTop-tW-t.height;m({left:n,top:oW(i>=eW?i:r,eW,window.innerHeight-eW-t.height)})},[d]);return(0,k.useEffect)(()=>{let e=()=>{let e=window.getSelection();if(!e||e.isCollapsed){f(null);return}l.current||g()},t=e=>{let t=s.current;l.current=!!(t&&e.target instanceof Node&&t.contains(e.target)),l.current&&f(null)},n=e=>{if(c.current?.contains(e.target))return;let t=l.current;l.current=!1,t&&g()},r=e=>{e.key===`Escape`&&f(null)},i=()=>f(null);return document.addEventListener(`selectionchange`,e),document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`pointerup`,n,!0),document.addEventListener(`keydown`,r),document.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`selectionchange`,e),document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`pointerup`,n,!0),document.removeEventListener(`keydown`,r),document.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,i),u.current!==null&&window.cancelAnimationFrame(u.current)}},[g]),(0,A.jsxs)(`div`,{ref:s,className:n,children:[t,d&&a?(0,Ch.createPortal)((0,A.jsxs)(`button`,{ref:_,type:`button`,className:`fixed z-[var(--z-popover,10100)] inline-flex max-w-[calc(100vw-24px)] items-center gap-1.5 overflow-hidden whitespace-nowrap rounded-xl border border-border bg-popover px-3 py-2 text-xs font-medium text-popover-foreground shadow-lg transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 disabled:cursor-not-allowed disabled:text-muted-foreground`,style:{left:p?.left??0,top:p?.top??0,visibility:p?`visible`:`hidden`},disabled:d.tooLong,onMouseDown:e=>e.preventDefault(),onClick:()=>{d.tooLong||(a(d.selection),window.getSelection()?.removeAllRanges(),f(null))},children:[(0,A.jsx)(gt,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0`}),(0,A.jsx)(`span`,{className:`truncate`,children:d.tooLong?o:e})]}),document.body):null]})}function cW({item:e}){return(0,A.jsxs)(A.Fragment,{children:[e.icon?(0,A.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:e.icon}):null,(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.children?(0,A.jsx)(We,{className:`h-4 w-4 shrink-0`}):null]})}function lW({item:e,open:t,onOpenChange:n,onClose:i,className:a,children:o}){let s=(0,k.useRef)(null),c=(0,k.useRef)(null),[l,u]=(0,k.useState)(),d=(0,k.useCallback)(e=>{s.current=e,u(e?.closest(`[data-context-menu-layer]`)??void 0)},[]),f=(0,k.useRef)(),p=(0,k.useRef)(!1),m=()=>clearTimeout(f.current),h=e=>{m(),f.current=setTimeout(()=>n(e),e?100:250)};(0,k.useEffect)(()=>()=>clearTimeout(f.current),[]);let g=()=>{m(),n(!1),s.current?.focus()},_=()=>{m(),p.current=!0,n(!0),c.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()};return(0,A.jsxs)(mi,{open:t,onOpenChange:n,children:[(0,A.jsx)(gi,{asChild:!0,children:(0,A.jsx)(`button`,{ref:d,type:`button`,role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":t,disabled:e.disabled,"data-menu-key":e.key,className:r(a,t&&`bg-[var(--interaction-hover)]`),onPointerEnter:e=>{e.pointerType!==`touch`&&(p.current=!1,h(!0))},onPointerLeave:()=>h(!1),onClick:e=>{e.preventDefault(),e.stopPropagation(),_()},onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),e.stopPropagation(),_())},children:o})}),(0,A.jsx)(_i,{container:l,children:(0,A.jsx)(vi,{ref:c,role:`menu`,"aria-label":e.label,"data-menu-escape-owner":``,"data-theme-overlay":`menu`,side:`right`,align:`start`,sideOffset:2,collisionPadding:8,className:r(yi,`z-[var(--z-tooltip)]`),style:{minWidth:`min(13rem, var(--radix-popover-content-available-width))`,maxWidth:`min(18rem, var(--radix-popover-content-available-width))`,maxHeight:`var(--radix-popover-content-available-height)`},onPointerEnter:m,onPointerLeave:()=>h(!1),onPointerDown:e=>e.stopPropagation(),onOpenAutoFocus:e=>{p.current||e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{e.preventDefault(),g()},onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`Escape`)&&(e.preventDefault(),e.stopPropagation(),g())},children:(0,A.jsx)(uW,{groups:e.children,onClose:i})})})]})}function uW({groups:e,onClose:t}){let[n,i]=(0,k.useState)(null),a=(0,k.useRef)(null);return(0,A.jsx)(`div`,{ref:a,"data-menu-level":``,"data-menu-escape-owner":n?``:void 0,onKeyDown:e=>{if(e.target.closest(`[data-menu-level]`)===a.current){if(e.key===`Escape`&&n)e.preventDefault(),e.stopPropagation(),a.current?.querySelector(`[aria-expanded="true"]`)?.focus(),i(null);else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault(),e.stopPropagation();let t=Array.from(a.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`)??[]).filter(e=>e.closest(`[data-menu-level]`)===a.current),n=t.indexOf(document.activeElement),r=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowUp`?-1:1)+t.length)%t.length;i(null),t[r]?.focus()}}},children:e.filter(e=>e.items.length).map((e,a)=>(0,A.jsxs)(`div`,{role:`group`,children:[a>0?(0,A.jsx)(`div`,{className:`mx-2 my-1 h-px bg-border/50`}):null,e.items.map(e=>{let a=r(bi,e.destructive?xi.destructive:`text-foreground ${xi.item}`),o=(0,A.jsx)(cW,{item:e});if(e.children)return(0,A.jsx)(lW,{item:e,open:n===e.key,onOpenChange:t=>i(n=>t?e.key:n===e.key?null:n),onClose:t,className:a,children:o},e.key);let s=()=>{e.onSelect?.(),t(e.href?!1:e.restoreFocus!==!1)};return e.href?(0,A.jsx)(`a`,{role:`menuitem`,className:a,href:e.href,download:e.download,onPointerEnter:()=>i(null),onClick:e=>{e.stopPropagation(),s()},children:o},e.key):(0,A.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,"aria-pressed":e.pressed,"data-menu-key":e.key,className:a,onPointerEnter:()=>i(null),onClick:e=>{e.stopPropagation(),s()},children:o},e.key)})]},e.key))})}var dW=(0,k.createContext)(null),fW=8;function pW(e){return!(e.target instanceof Element)||!e.target.closest(`[data-menu-escape-owner]`)?!1:(e.preventDefault(),!0)}function mW({groups:e,label:t,onClose:n,position:i}){let a=(0,k.useRef)(null),o=i.trigger.closest(`[role="dialog"]`)??document.body,s=o!==document.body;return(0,k.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{let t=s?o.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight,height:window.innerHeight};e.style.maxHeight=`${Math.max(0,t.height-fW*2)}px`;let n=e.getBoundingClientRect(),r=i.align===`end`?i.x-n.width:i.x,a=Math.max(t.left+fW,Math.min(r,t.right-n.width-fW)),c=Math.max(t.top+fW,Math.min(i.y,t.bottom-n.height-fW));e.style.left=`${a-t.left}px`,e.style.top=`${c-t.top}px`};t(),e.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[i,o,s]),(0,Ch.createPortal)((0,A.jsx)(`div`,{className:r(`pointer-events-auto inset-0 z-[var(--z-tooltip)]`,s?`absolute`:`fixed`),"data-context-menu-layer":``,onContextMenu:e=>e.preventDefault(),onPointerDown:()=>n(!0),children:(0,A.jsx)(`div`,{ref:a,role:`menu`,"data-menu-escape-owner":``,"data-theme-overlay":`menu`,"aria-label":t,className:r(yi,s?`absolute`:`fixed`),style:{left:i.x,top:i.y},onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n(!0))},children:(0,A.jsx)(uW,{groups:e,onClose:n})})}),o)}function hW({children:e,groups:t,label:n}){let[r,i]=(0,k.useState)(null),a=t.filter(e=>e.items.length>0),o=e=>{let t=r?.trigger;i(null),e&&t&&window.setTimeout(()=>t.isConnected&&t.focus(),0)},s=e=>{if(r?.trigger===e){o(!0);return}if(a.length===0)return;let t=e.getBoundingClientRect();i({align:`end`,x:t.right,y:t.bottom,trigger:e})},c=(0,k.cloneElement)(e,{"data-context-menu-open":r?``:void 0,onContextMenu:t=>{if(e.props.onContextMenu?.(t),t.defaultPrevented||a.length===0)return;t.preventDefault();let n=t.currentTarget,r=n.getBoundingClientRect();i({align:`start`,x:t.clientX||r.left,y:t.clientY||r.bottom,trigger:n})}});return(0,A.jsxs)(dW.Provider,{value:{isOpen:!!r,toggleFromButton:s},children:[c,r?(0,A.jsx)(mW,{groups:a,label:n,position:r,onClose:o}):null]})}function gW({children:e}){let t=(0,k.useContext)(dW);if(!t)throw Error(`ContextMenuTrigger must be rendered inside ContextMenu`);return(0,k.cloneElement)(e,{"aria-expanded":t.isOpen,"aria-haspopup":`menu`,onClick:n=>{e.props.onClick?.(n),!n.defaultPrevented&&(n.stopPropagation(),t.toggleFromButton(n.currentTarget))}})}export{vt as $,Ar as A,xn as B,Ir as C,jr as D,Mr as E,Nn as F,kt as G,yn as H,An as I,Ct as J,Et as K,Bn as L,kn as M,Tn as N,kr as O,En as P,yt as Q,Mn as R,gi as S,Fr as T,bn as U,vn as V,jt as W,xt as X,St as Y,bt as Z,yi as _,Ve as _t,sW as a,lt as at,_i as b,Ie as bt,pV as c,tt as ct,cj as d,Ye as dt,gt as et,o_ as f,qe as ft,bi as g,He as gt,xi as h,Ue as ht,uW as i,ut as it,Cn as j,Pr as k,OB as l,Ze as lt,Qg as m,We as mt,gW as n,pt as nt,$U as o,st as ot,r_ as p,Ge as pt,Tt as q,pW as r,dt as rt,tH as s,at as st,hW as t,ht as tt,rR as u,Xe as ut,hi as v,Be as vt,Nr as w,mi as x,Fe as xt,vi as y,Le as yt,Sn as z};