@myagentroam/server 0.13.6 → 0.13.7

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 (375) hide show
  1. package/node_modules/@myagentroam/protocol/dist/index.d.ts +8 -0
  2. package/node_modules/@myagentroam/protocol/dist/index.js +2 -0
  3. package/node_modules/@myagentroam/protocol/package.json +1 -1
  4. package/node_modules/@myagentroam/server-core/package.json +2 -2
  5. package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
  6. package/package.json +6 -6
  7. package/web/assets/{AuditManagementPage-DdhzZJJz.js → AuditManagementPage-fDpTFGAJ.js} +1 -1
  8. package/web/assets/{BusyIndicator-DJEYrwl2.js → BusyIndicator-81gYfHFI.js} +1 -1
  9. package/web/assets/{CodeFileEditor-t-S2RxFj.js → CodeFileEditor-BWA7aZwM.js} +3 -3
  10. package/web/assets/{ConversationTemplateManagementPage-DtnCxKPr.js → ConversationTemplateManagementPage-CMwsINqq.js} +1 -1
  11. package/web/assets/{ConversationTemplateManagementPage-8cWdT1rl.js → ConversationTemplateManagementPage-DM2WlZlh.js} +1 -1
  12. package/web/assets/{EnterpriseUserManagementPage-CVpJzsVL.js → EnterpriseUserManagementPage-BKCNfftS.js} +1 -1
  13. package/web/assets/{EnvironmentSecretManager-DaMtII6x.js → EnvironmentSecretManager-jWSJQLLY.js} +1 -1
  14. package/web/assets/{FilePreviewLoading-CqXCVUDH.js → FilePreviewLoading-EXabASKn.js} +1 -1
  15. package/web/assets/HtmlPreviewFrame-DQimcizh.js +5 -0
  16. package/web/assets/{HtmlPreviewFrame-CXd4x0y-.css → HtmlPreviewFrame-D_oKBx6Z.css} +1 -1
  17. package/web/assets/{LicenseManagementPage-C-25sen8.js → LicenseManagementPage-li8NTgz0.js} +1 -1
  18. package/web/assets/{ManagementPagination-BwZo73aV.js → ManagementPagination-DC_Jtk72.js} +1 -1
  19. package/web/assets/{MarAgentModelManagementPage-DkncBptD.js → MarAgentModelManagementPage-BhuEt5ck.js} +1 -1
  20. package/web/assets/{MarAgentModelManagementPage-B9lHTQtV.js → MarAgentModelManagementPage-DtQDSKsm.js} +1 -1
  21. package/web/assets/{MarIcon-0cJTzTai.js → MarIcon-DRzNI1TJ.js} +1 -1
  22. package/web/assets/{MarkdownFilePreview-CnWvYfKN.js → MarkdownFilePreview-DRxwzEkP.js} +2 -2
  23. package/web/assets/{McpDetailsDialog-nt3by9E1.js → McpDetailsDialog-C4hLhwaZ.js} +1 -1
  24. package/web/assets/{McpSourceManagementPage-Bg2wxoSB.js → McpSourceManagementPage-B4o2soUo.js} +1 -1
  25. package/web/assets/{McpSourceManagementPage-BVjVO0Tb.js → McpSourceManagementPage-ChCP_9Wx.js} +1 -1
  26. package/web/assets/{NodeDetailsDialogs-D4wBwUzA.js → NodeDetailsDialogs-jvve59Rc.js} +1 -1
  27. package/web/assets/NodeManagementPage-BaoMHEc6.js +1 -0
  28. package/web/assets/NodeManagementPage-DcE_Tno8.js +1 -0
  29. package/web/assets/{OAuthManagementPage-D9cBB-vX.js → OAuthManagementPage-oSorMLvE.js} +1 -1
  30. package/web/assets/{OrganizationManagementPage-N8HwbTY5.js → OrganizationManagementPage-CEcAvCJe.js} +1 -1
  31. package/web/assets/{ResourceManagementPanel-D80V3ZdZ.js → ResourceManagementPanel-kqq0Svx_.js} +1 -1
  32. package/web/assets/{ResourceManagementPanel.vue_vue_type_script_setup_true_lang-DfCWa6fA.js → ResourceManagementPanel.vue_vue_type_script_setup_true_lang-DWpc58cT.js} +1 -1
  33. package/web/assets/{SecretManagementPage-tsgbjSvn.js → SecretManagementPage-CXmPmuQ7.js} +1 -1
  34. package/web/assets/SecretManagementPage-DnHmkYKn.js +1 -0
  35. package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-CmSoYQ3n.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-DBmhix-s.js} +1 -1
  36. package/web/assets/{SessionSharePage-whJFT3cw.js → SessionSharePage-Bfibf3C2.js} +2 -2
  37. package/web/assets/{SettingsContent-WLH3DkgW.js → SettingsContent-BQYXFW0-.js} +1 -1
  38. package/web/assets/{SettingsContent-Dsw7sGr4.js → SettingsContent-KFZsk8Yv.js} +1 -1
  39. package/web/assets/{SkillCenterPage-yDU-t2cT.js → SkillCenterPage-5lJUA9pl.js} +1 -1
  40. package/web/assets/SkillCenterPage-BmqIek5Q.js +1 -0
  41. package/web/assets/{SkillDetailsDialog-BUfNxAjf.js → SkillDetailsDialog-CrN5o6Jk.js} +1 -1
  42. package/web/assets/{SkillSourceManagementPage-B7yjgXR8.js → SkillSourceManagementPage-Di_lVA5-.js} +1 -1
  43. package/web/assets/{SkillSourceManagementPage-BCHgTDXJ.js → SkillSourceManagementPage-DpenHp3H.js} +1 -1
  44. package/web/assets/{StandaloneFilePreviewPage-b-piNuN1.js → StandaloneFilePreviewPage-_Lh1H6-k.js} +1 -1
  45. package/web/assets/{SystemConfigurationPage-C2Ecb0Su.js → SystemConfigurationPage-BpCsGW-2.js} +1 -1
  46. package/web/assets/SystemConfigurationPage-BqqdmrAK.js +1 -0
  47. package/web/assets/{SystemInformationPage-CBWjqG43.js → SystemInformationPage-G9WA9kpj.js} +1 -1
  48. package/web/assets/{TerminalTabView-CeX2SVcm.js → TerminalTabView-KFAT6dN-.js} +1 -1
  49. package/web/assets/{WorkbenchPage-D4X4qerH.js → WorkbenchPage-BQdwbvse.js} +15 -15
  50. package/web/assets/WorkbenchPage-ptvzMUTa.css +1 -0
  51. package/web/assets/WorkspaceManagementPage-BYtbXfHc.js +1 -0
  52. package/web/assets/WorkspaceManagementPage-C-9iCpGW.js +1 -0
  53. package/web/assets/{_baseIteratee-CnCgfzqY.js → _baseIteratee-CEjLB6P0.js} +1 -1
  54. package/web/assets/{abnfDiagram-VCTEODGH-C8MLlCYr.js → abnfDiagram-VCTEODGH-DwwJ-B6X.js} +1 -1
  55. package/web/assets/{advancedFormat-tqE8I04X.js → advancedFormat-DwAKrlQQ.js} +1 -1
  56. package/web/assets/{arc-ChGPMlfM.js → arc-BhUv0GFi.js} +1 -1
  57. package/web/assets/{architectureDiagram-5GKGNRK7-UNKWS80q.js → architectureDiagram-5GKGNRK7-BYwr4pOI.js} +1 -1
  58. package/web/assets/{blockDiagram-OSKFZWR5-DaoKTWzi.js → blockDiagram-OSKFZWR5-BQ0G5RBd.js} +1 -1
  59. package/web/assets/{c4Diagram-7LVT6UL2-DeJ38tJ4.js → c4Diagram-7LVT6UL2-DLmelPF5.js} +1 -1
  60. package/web/assets/{catalog-ownership-service-ppl9SdO8.js → catalog-ownership-service-BQ72dnlA.js} +1 -1
  61. package/web/assets/{catalog-page-service-CA6TP1Er.js → catalog-page-service-D4eWT4uF.js} +1 -1
  62. package/web/assets/channel-BAHh016e.js +1 -0
  63. package/web/assets/{chunk-2Q5K7J3B-Cie4-T_4.js → chunk-2Q5K7J3B-CQf0ME4y.js} +1 -1
  64. package/web/assets/{chunk-5VM5RSS4-C02e2HuJ.js → chunk-5VM5RSS4-DQY_-Ks6.js} +1 -1
  65. package/web/assets/{chunk-F27PBJKO-CYE4axjh.js → chunk-F27PBJKO-CklCJyS6.js} +1 -1
  66. package/web/assets/{chunk-HLEWEB6X-Qcd3DJvW.js → chunk-HLEWEB6X-Ofa5loFJ.js} +1 -1
  67. package/web/assets/{chunk-JWPE2WC7-BIlv53mX.js → chunk-JWPE2WC7-Dc7083sU.js} +1 -1
  68. package/web/assets/{chunk-POPQ4Y6H-C1FzI22y.js → chunk-POPQ4Y6H-D4Zc7_fI.js} +1 -1
  69. package/web/assets/{chunk-SVP7TREG-B5A4JoXo.js → chunk-SVP7TREG-DiJC9xJx.js} +1 -1
  70. package/web/assets/{chunk-XXDRQBXY-FdosaHEW.js → chunk-XXDRQBXY-BhYPRykj.js} +1 -1
  71. package/web/assets/{chunk-ZLD2IHE6-BzhAoouo.js → chunk-ZLD2IHE6-Cc-O9KsT.js} +1 -1
  72. package/web/assets/classDiagram-CYGNFDIV-IKe_y23-.js +1 -0
  73. package/web/assets/classDiagram-v2-TLXNO2FR-IKe_y23-.js +1 -0
  74. package/web/assets/{conversation-history-D9993EDO.js → conversation-history-DsSE1wLH.js} +1 -1
  75. package/web/assets/{cose-bilkent-JH36ORCC-C4ZjK8dC.js → cose-bilkent-JH36ORCC-rFqp0SYn.js} +1 -1
  76. package/web/assets/{cynefin-OW5HDTMX-D-6QhPjX.js → cynefin-OW5HDTMX-deO0LWKC.js} +1 -1
  77. package/web/assets/{cynefinDiagram-5FMLGOSQ-Bwsk5LdU.js → cynefinDiagram-5FMLGOSQ-BCj0mYAO.js} +1 -1
  78. package/web/assets/{dagre-OS7QT2EB-DoA_-lbd.js → dagre-OS7QT2EB-faTq17DR.js} +1 -1
  79. package/web/assets/{diagram-S7CK7UJ4-sgObxZyi.js → diagram-S7CK7UJ4-cAbTZ8qd.js} +1 -1
  80. package/web/assets/{diagram-UQ7AKVKN-BdMjAaVk.js → diagram-UQ7AKVKN-CxoALt7V.js} +1 -1
  81. package/web/assets/{diagram-VSXAHHWV-BCH9zwo1.js → diagram-VSXAHHWV-BcZM5S7Z.js} +1 -1
  82. package/web/assets/{diagram-VX7I27RA-Z6LSJKeQ.js → diagram-VX7I27RA-QIaSkKCU.js} +1 -1
  83. package/web/assets/{diagram-Z3DM3KII-CcbM5hsL.js → diagram-Z3DM3KII-tYE8PEsy.js} +1 -1
  84. package/web/assets/{ebnfDiagram-PWID7BFC-CWP32uDq.js → ebnfDiagram-PWID7BFC-CQON9X8w.js} +1 -1
  85. package/web/assets/{el-alert-8VKFJYUv.js → el-alert-DQT74Z6k.js} +1 -1
  86. package/web/assets/{el-cascader-CJR-DJLi.js → el-cascader-B52hB1X4.js} +1 -1
  87. package/web/assets/{el-checkbox-D7CsqiQq.js → el-checkbox-D8E82IC3.js} +1 -1
  88. package/web/assets/{el-date-picker-Lb4E2Nje.js → el-date-picker-CzlIv3iG.js} +1 -1
  89. package/web/assets/{el-descriptions-B48GJeGA.js → el-descriptions-CrLOiLtM.js} +1 -1
  90. package/web/assets/{el-form-item-Fjp3w344.js → el-form-item-CjLvz7IR.js} +1 -1
  91. package/web/assets/{el-input-DRF3bOe1.js → el-input-DsD8wPgd.js} +1 -1
  92. package/web/assets/{el-input-number-e6T9QIje.js → el-input-number-DYTEBnhp.js} +1 -1
  93. package/web/assets/{el-radio-DO8joult.js → el-radio-rHorotS0.js} +1 -1
  94. package/web/assets/{el-select-BSaB1c5h.js → el-select-vQRSFUuU.js} +1 -1
  95. package/web/assets/{el-switch-Cpl2xxJc.js → el-switch-D49n4nYq.js} +1 -1
  96. package/web/assets/{el-tab-pane-CQyfpTgD.js → el-tab-pane-CpoewUFm.js} +1 -1
  97. package/web/assets/{el-table-column-BRybrdLI.js → el-table-column-DIe-Jdox.js} +1 -1
  98. package/web/assets/{enterprise-management-service-Qtmnf50C.js → enterprise-management-service-CYSkSkqU.js} +1 -1
  99. package/web/assets/{erDiagram-2YWLMYGG-BOtd6Wuq.js → erDiagram-2YWLMYGG-D6cLXjx4.js} +1 -1
  100. package/web/assets/{error-presentation-CJfLHEK_.js → error-presentation-CKm32JzU.js} +1 -1
  101. package/web/assets/{flowDiagram-T62WH6J4-DGRqBn-8.js → flowDiagram-T62WH6J4-CWSvQfIj.js} +1 -1
  102. package/web/assets/{ganttDiagram-EL5Y4UJY-D84r1V0Q.js → ganttDiagram-EL5Y4UJY-Bk9PlmQ0.js} +1 -1
  103. package/web/assets/{gitGraphDiagram-WWUBYQGX-FANv-qDA.js → gitGraphDiagram-WWUBYQGX-JFxyzn2J.js} +1 -1
  104. package/web/assets/{hosted-conversation-template-client-CeOnupVC.js → hosted-conversation-template-client-CYBI7IvT.js} +1 -1
  105. package/web/assets/{index-DwQqO2fH.js → index-98DLRplS.js} +1 -1
  106. package/web/assets/{index-CBs38naL.js → index-BP-OH85t.js} +1 -1
  107. package/web/assets/{index-sctirQW0.js → index-BQ4D3lnr.js} +1 -1
  108. package/web/assets/{index-B0P8j1yb.js → index-BS-OsBk1.js} +1 -1
  109. package/web/assets/{index-C_EAvnDF.js → index-BTXpkf3M.js} +1 -1
  110. package/web/assets/{index-BYYx_GrI.js → index-BbOzeZis.js} +1 -1
  111. package/web/assets/{index-C90_sIrz.js → index-BzBol34B.js} +1 -1
  112. package/web/assets/{index-Bokwz5PA.js → index-C-rtGAiQ.js} +1 -1
  113. package/web/assets/{index-BkC7CnZA.js → index-C20Ctqox.js} +1 -1
  114. package/web/assets/{index-BOhe9vs1.js → index-C20z2yeK.js} +1 -1
  115. package/web/assets/{index-C8DbmG_l.js → index-C38uEGP7.js} +1 -1
  116. package/web/assets/{index-B7tnVSor.js → index-C8HJ-7wK.js} +1 -1
  117. package/web/assets/{index-hP6Cb_NE.js → index-CNYQPSEc.js} +1 -1
  118. package/web/assets/{index-9ks2AQTi.js → index-CRCrq0fK.js} +1 -1
  119. package/web/assets/{index-x9JuBH-H.js → index-CeewrlMR.js} +1 -1
  120. package/web/assets/{index-DGlioDXJ.js → index-D0gqeuOi.js} +1 -1
  121. package/web/assets/{index-W6jp3JVA.js → index-DCX6wtGf.js} +1 -1
  122. package/web/assets/{index-BsG4OGs3.js → index-DFYUX44y.js} +1 -1
  123. package/web/assets/{index-DU209g6d.js → index-DYEKyod1.js} +1 -1
  124. package/web/assets/{index-D6945seh.js → index-Dmjcd9dH.js} +1 -1
  125. package/web/assets/{index-eU6FSd70.js → index-DqPiRdTW.js} +1 -1
  126. package/web/assets/{index-x2OEXKrc.js → index-Dw3xGHpw.js} +1 -1
  127. package/web/assets/{index-zG9SJlS3.js → index-FxdcMPQK.js} +1 -1
  128. package/web/assets/{index-B8rWDVmR.js → index-GDJZ4nKF.js} +1 -1
  129. package/web/assets/{index-Tv4HGgSj.js → index-QkybH-4Y.js} +1 -1
  130. package/web/assets/{index-C_F0LgDO.js → index-X_ZLsJF-.js} +1 -1
  131. package/web/assets/{index-NReuiFej.js → index-oJjFup0f.js} +1 -1
  132. package/web/assets/{index-BeipYJv6.js → index-s_IiIj3Q.js} +1 -1
  133. package/web/assets/{index-DsgwAvJA.js → index-tebwt16R.js} +3 -3
  134. package/web/assets/infoDiagram-FKFFQAWI-odw5ek8A.js +2 -0
  135. package/web/assets/{isArrayLikeObject-Bg1E4S9y.js → isArrayLikeObject-CNIeaAGq.js} +1 -1
  136. package/web/assets/{ishikawaDiagram-5VMMS53U-B0FDzCa4.js → ishikawaDiagram-5VMMS53U-S3I395rk.js} +1 -1
  137. package/web/assets/{journeyDiagram-EYS64GPL-CIM_LxZU.js → journeyDiagram-EYS64GPL-CEURtMQT.js} +1 -1
  138. package/web/assets/{kanban-definition-UXKFOSKX-DKxBi_r0.js → kanban-definition-UXKFOSKX-B_I_ageX.js} +1 -1
  139. package/web/assets/{layout-DU0JsES_.js → layout-C28pcZJ3.js} +1 -1
  140. package/web/assets/{linear-C3UCzYem.js → linear-B5pI1vN0.js} +1 -1
  141. package/web/assets/{management-url-service-DsBUOSH4.js → management-url-service-BUrqsIPf.js} +1 -1
  142. package/web/assets/{mcp-center-service-BluNkyx-.js → mcp-center-service-Bt8KNvBQ.js} +1 -1
  143. package/web/assets/{merge-B-E3iBqN.js → merge-k_TKlNxw.js} +1 -1
  144. package/web/assets/{mermaid.core-CMc9IFVw.js → mermaid.core-DPF_lBS3.js} +5 -5
  145. package/web/assets/{message-box-service-CszgyilP.js → message-box-service-BzqjQhzH.js} +1 -1
  146. package/web/assets/{mindmap-definition-THT77NOG-BJyPV49z.js → mindmap-definition-THT77NOG-D1wx2rOh.js} +1 -1
  147. package/web/assets/{mobile-dialog-return-service-Csexw-by.js → mobile-dialog-return-service-CDghLsut.js} +1 -1
  148. package/web/assets/{oauth-callback-3M1eIOPT.js → oauth-callback-B21gNkv-.js} +1 -1
  149. package/web/assets/{pegDiagram-XKGWAZYB-jpfn2XMn.js → pegDiagram-XKGWAZYB-0meuEp8g.js} +1 -1
  150. package/web/assets/{pieDiagram-E7YTZNPT-B2jQ3Egj.js → pieDiagram-E7YTZNPT-jC3klXwe.js} +1 -1
  151. package/web/assets/{quadrantDiagram-AXDQQJYC-BXSOa8Vi.js → quadrantDiagram-AXDQQJYC-DzQbzknx.js} +1 -1
  152. package/web/assets/{railroadDiagram-O6MQD6OU-BTy8Z6ZL.js → railroadDiagram-O6MQD6OU-DwiX_44I.js} +1 -1
  153. package/web/assets/{requirementDiagram-IS5BZ75X-eqVPnJ-z.js → requirementDiagram-IS5BZ75X-DdBB28Xn.js} +1 -1
  154. package/web/assets/{runner-presentation-D66Z9p-O.js → runner-presentation-CjPY5Dey.js} +1 -1
  155. package/web/assets/{sankeyDiagram-P5KCCOFB-BI5fAwMJ.js → sankeyDiagram-P5KCCOFB-B1WX3WR_.js} +1 -1
  156. package/web/assets/{sequenceDiagram-WJ2MYXX4-CZ7Un31z.js → sequenceDiagram-WJ2MYXX4-Cz_KunCM.js} +1 -1
  157. package/web/assets/{session-share-client-service-W0XDwceC.js → session-share-client-service-C-0DdFRE.js} +1 -1
  158. package/web/assets/{sizeCapture-INFHLROL-7gQRW3HD.js → sizeCapture-INFHLROL-sB2YOfNo.js} +1 -1
  159. package/web/assets/{stateDiagram-XQSTLZYL-D23AlrmH.js → stateDiagram-XQSTLZYL-Bwb7A16z.js} +1 -1
  160. package/web/assets/stateDiagram-v2-IH3M54BS-DY5Ukxza.js +1 -0
  161. package/web/assets/{swimlanes-V6O3JKXN-By9JzeNC.js → swimlanes-V6O3JKXN-BNtAnq9r.js} +1 -1
  162. package/web/assets/swimlanesDiagram-JKAHXJPX-BZu5MiNn.js +8 -0
  163. package/web/assets/{time-presentation-BRvT6nTd.js → time-presentation-Cz63DSUv.js} +1 -1
  164. package/web/assets/{timeline-definition-24CTP7MA-CyydVD-f.js → timeline-definition-24CTP7MA-Cs6NtxYd.js} +1 -1
  165. package/web/assets/{union-BSveQIrm.js → union-C5QcR3bq.js} +1 -1
  166. package/web/assets/{use-form-common-props-BJ2vZd_0.js → use-form-common-props-C_muwpbj.js} +1 -1
  167. package/web/assets/{use-wheel-TWRoHAF5.js → use-wheel-7n7Aiy_e.js} +1 -1
  168. package/web/assets/{vennDiagram-4TSXK5OY-3OEbunrh.js → vennDiagram-4TSXK5OY-DQcN4PIp.js} +1 -1
  169. package/web/assets/{wardleyDiagram-VM6X3IG4-BuZvJTn0.js → wardleyDiagram-VM6X3IG4-B5qQJgni.js} +1 -1
  170. package/web/assets/{workbench-composer-interaction-controller-BJZsGMk-.js → workbench-composer-interaction-controller-BFZkEbwV.js} +19 -19
  171. package/web/assets/{workbench-presentation-DblBOxzZ.js → workbench-presentation-DSjYJkKK.js} +1 -1
  172. package/web/assets/{xychartDiagram-S5SC5T6Z-CQzJStra.js → xychartDiagram-S5SC5T6Z-B8yJLdGw.js} +1 -1
  173. package/web/docs/404.html +2 -2
  174. package/web/docs/administration/account.html +4 -4
  175. package/web/docs/administration/audit.html +4 -4
  176. package/web/docs/administration/conversation-templates.html +4 -4
  177. package/web/docs/administration/email-notifications.html +4 -4
  178. package/web/docs/administration/license.html +5 -5
  179. package/web/docs/administration/nodes-workspaces.html +4 -4
  180. package/web/docs/administration/oauth.html +4 -4
  181. package/web/docs/administration/secrets.html +4 -4
  182. package/web/docs/administration/template-workspace-maintenance.html +4 -4
  183. package/web/docs/administration/users-organizations.html +4 -4
  184. package/web/docs/assets/administration_license.md.CVLEsGB6.js +1 -0
  185. package/web/docs/assets/{app.DFdypnML.js → app.HBmL36pQ.js} +1 -1
  186. package/web/docs/assets/chunks/@localSearchIndexen-US.pxMPDJyo.js +1 -0
  187. package/web/docs/assets/chunks/@localSearchIndexroot.Bmvw1ncU.js +1 -0
  188. package/web/docs/assets/chunks/{VPLocalSearchBox.P9CapR4-.js → VPLocalSearchBox.9e8uHIOt.js} +1 -1
  189. package/web/docs/assets/chunks/{theme.DLnKtfGY.js → theme.CXF2ox30.js} +2 -2
  190. package/web/docs/assets/deployment_network.md.Bbi7-zH2.js +1 -0
  191. package/web/docs/assets/deployment_network.md.Bbi7-zH2.lean.js +1 -0
  192. package/web/docs/assets/deployment_upgrade.md.CG_VFxvG.js +1 -0
  193. package/web/docs/assets/deployment_upgrade.md.CG_VFxvG.lean.js +1 -0
  194. package/web/docs/assets/en-US_administration_license.md.GCAYq1LT.js +1 -0
  195. package/web/docs/assets/en-US_deployment_network.md.770EzfaT.js +1 -0
  196. package/web/docs/assets/en-US_deployment_network.md.770EzfaT.lean.js +1 -0
  197. package/web/docs/assets/en-US_deployment_upgrade.md.DDevql7U.js +1 -0
  198. package/web/docs/assets/{en-US_deployment_upgrade.md.DZiDDiLn.lean.js → en-US_deployment_upgrade.md.DDevql7U.lean.js} +1 -1
  199. package/web/docs/assets/en-US_getting-started_npm-quick-start.md.D46Ec15e.js +3 -0
  200. package/web/docs/assets/en-US_getting-started_npm-quick-start.md.D46Ec15e.lean.js +1 -0
  201. package/web/docs/assets/{en-US_getting-started_overview.md.Bug5sh21.js → en-US_getting-started_overview.md.CB-43rGR.js} +1 -1
  202. package/web/docs/assets/{en-US_getting-started_overview.md.Bug5sh21.lean.js → en-US_getting-started_overview.md.CB-43rGR.lean.js} +1 -1
  203. package/web/docs/assets/en-US_getting-started_prerequisites.md.BFxGOlUy.js +1 -0
  204. package/web/docs/assets/en-US_getting-started_prerequisites.md.BFxGOlUy.lean.js +1 -0
  205. package/web/docs/assets/{en-US_getting-started_server-installation.md._k2XGM85.js → en-US_getting-started_server-installation.md.C7SjGDJt.js} +2 -2
  206. package/web/docs/assets/getting-started_npm-quick-start.md.CIYjFmiu.js +3 -0
  207. package/web/docs/assets/getting-started_npm-quick-start.md.CIYjFmiu.lean.js +1 -0
  208. package/web/docs/assets/{getting-started_overview.md.CA1CCOBc.js → getting-started_overview.md.Cv-HSfAh.js} +1 -1
  209. package/web/docs/assets/getting-started_prerequisites.md.DjWWTA7V.js +1 -0
  210. package/web/docs/assets/{getting-started_prerequisites.md.D26KU42D.lean.js → getting-started_prerequisites.md.DjWWTA7V.lean.js} +1 -1
  211. package/web/docs/assets/{getting-started_server-installation.md.D3P3Lmc2.js → getting-started_server-installation.md.BsEfVH6b.js} +2 -2
  212. package/web/docs/concepts/architecture.html +4 -4
  213. package/web/docs/concepts/data-and-security.html +4 -4
  214. package/web/docs/concepts/files-git-terminal.html +4 -4
  215. package/web/docs/concepts/node-and-workspace.html +4 -4
  216. package/web/docs/concepts/permissions-and-sharing.html +4 -4
  217. package/web/docs/concepts/runner-control.html +4 -4
  218. package/web/docs/concepts/secrets.html +4 -4
  219. package/web/docs/concepts/session-run-turn.html +4 -4
  220. package/web/docs/deployment/backup-restore.html +4 -4
  221. package/web/docs/deployment/network.html +5 -5
  222. package/web/docs/deployment/node-installation.html +4 -4
  223. package/web/docs/deployment/node-linux.html +4 -4
  224. package/web/docs/deployment/node-macos.html +4 -4
  225. package/web/docs/deployment/node-windows.html +4 -4
  226. package/web/docs/deployment/production.html +4 -4
  227. package/web/docs/deployment/security-checklist.html +4 -4
  228. package/web/docs/deployment/upgrade.html +5 -5
  229. package/web/docs/en-US/administration/account.html +4 -4
  230. package/web/docs/en-US/administration/audit.html +4 -4
  231. package/web/docs/en-US/administration/conversation-templates.html +4 -4
  232. package/web/docs/en-US/administration/email-notifications.html +4 -4
  233. package/web/docs/en-US/administration/license.html +5 -5
  234. package/web/docs/en-US/administration/nodes-workspaces.html +4 -4
  235. package/web/docs/en-US/administration/oauth.html +4 -4
  236. package/web/docs/en-US/administration/secrets.html +4 -4
  237. package/web/docs/en-US/administration/template-workspace-maintenance.html +4 -4
  238. package/web/docs/en-US/administration/users-organizations.html +4 -4
  239. package/web/docs/en-US/concepts/architecture.html +4 -4
  240. package/web/docs/en-US/concepts/data-and-security.html +4 -4
  241. package/web/docs/en-US/concepts/files-git-terminal.html +4 -4
  242. package/web/docs/en-US/concepts/node-and-workspace.html +4 -4
  243. package/web/docs/en-US/concepts/permissions-and-sharing.html +4 -4
  244. package/web/docs/en-US/concepts/runner-control.html +4 -4
  245. package/web/docs/en-US/concepts/secrets.html +4 -4
  246. package/web/docs/en-US/concepts/session-run-turn.html +4 -4
  247. package/web/docs/en-US/deployment/backup-restore.html +4 -4
  248. package/web/docs/en-US/deployment/network.html +5 -5
  249. package/web/docs/en-US/deployment/node-installation.html +4 -4
  250. package/web/docs/en-US/deployment/node-linux.html +4 -4
  251. package/web/docs/en-US/deployment/node-macos.html +4 -4
  252. package/web/docs/en-US/deployment/node-windows.html +4 -4
  253. package/web/docs/en-US/deployment/production.html +4 -4
  254. package/web/docs/en-US/deployment/security-checklist.html +4 -4
  255. package/web/docs/en-US/deployment/upgrade.html +5 -5
  256. package/web/docs/en-US/getting-started/connect-node.html +4 -4
  257. package/web/docs/en-US/getting-started/first-agent-session.html +4 -4
  258. package/web/docs/en-US/getting-started/first-login.html +4 -4
  259. package/web/docs/en-US/getting-started/next-steps.html +4 -4
  260. package/web/docs/en-US/getting-started/npm-quick-start.html +7 -7
  261. package/web/docs/en-US/getting-started/overview.html +5 -5
  262. package/web/docs/en-US/getting-started/prerequisites.html +5 -5
  263. package/web/docs/en-US/getting-started/register-workspace.html +4 -4
  264. package/web/docs/en-US/getting-started/server-installation.html +6 -6
  265. package/web/docs/en-US/operations/marctl.html +4 -4
  266. package/web/docs/en-US/reference/configuration.html +4 -4
  267. package/web/docs/en-US/reference/keyboard-shortcuts.html +4 -4
  268. package/web/docs/en-US/reference/limits.html +4 -4
  269. package/web/docs/en-US/reference/ports-paths-data.html +4 -4
  270. package/web/docs/en-US/reference/status-and-errors.html +4 -4
  271. package/web/docs/en-US/runners/claude-code.html +4 -4
  272. package/web/docs/en-US/runners/codex.html +4 -4
  273. package/web/docs/en-US/runners/mar-agent.html +4 -4
  274. package/web/docs/en-US/runners/opencode.html +4 -4
  275. package/web/docs/en-US/runners/overview.html +4 -4
  276. package/web/docs/en-US/runners/runner-troubleshooting.html +4 -4
  277. package/web/docs/en-US/troubleshooting/node-offline.html +4 -4
  278. package/web/docs/en-US/troubleshooting/quick-diagnosis.html +4 -4
  279. package/web/docs/en-US/troubleshooting/session-run.html +4 -4
  280. package/web/docs/en-US/troubleshooting/terminal.html +4 -4
  281. package/web/docs/en-US/troubleshooting/workspace-files.html +4 -4
  282. package/web/docs/en-US/workbench/composer.html +4 -4
  283. package/web/docs/en-US/workbench/context-and-plan.html +4 -4
  284. package/web/docs/en-US/workbench/conversation.html +4 -4
  285. package/web/docs/en-US/workbench/file-reference-and-attachment.html +4 -4
  286. package/web/docs/en-US/workbench/files.html +4 -4
  287. package/web/docs/en-US/workbench/git-changes.html +4 -4
  288. package/web/docs/en-US/workbench/git-history.html +4 -4
  289. package/web/docs/en-US/workbench/hosted-conversations.html +4 -4
  290. package/web/docs/en-US/workbench/mobile.html +4 -4
  291. package/web/docs/en-US/workbench/navigation.html +4 -4
  292. package/web/docs/en-US/workbench/sessions.html +4 -4
  293. package/web/docs/en-US/workbench/skills.html +4 -4
  294. package/web/docs/en-US/workbench/terminal.html +4 -4
  295. package/web/docs/getting-started/connect-node.html +4 -4
  296. package/web/docs/getting-started/first-agent-session.html +4 -4
  297. package/web/docs/getting-started/first-login.html +4 -4
  298. package/web/docs/getting-started/next-steps.html +4 -4
  299. package/web/docs/getting-started/npm-quick-start.html +7 -7
  300. package/web/docs/getting-started/overview.html +5 -5
  301. package/web/docs/getting-started/prerequisites.html +5 -5
  302. package/web/docs/getting-started/register-workspace.html +4 -4
  303. package/web/docs/getting-started/server-installation.html +6 -6
  304. package/web/docs/hashmap.json +1 -1
  305. package/web/docs/operations/marctl.html +4 -4
  306. package/web/docs/reference/configuration.html +4 -4
  307. package/web/docs/reference/keyboard-shortcuts.html +4 -4
  308. package/web/docs/reference/limits.html +4 -4
  309. package/web/docs/reference/ports-paths-data.html +4 -4
  310. package/web/docs/reference/status-and-errors.html +4 -4
  311. package/web/docs/runners/claude-code.html +4 -4
  312. package/web/docs/runners/codex.html +4 -4
  313. package/web/docs/runners/mar-agent.html +4 -4
  314. package/web/docs/runners/opencode.html +4 -4
  315. package/web/docs/runners/overview.html +4 -4
  316. package/web/docs/runners/runner-troubleshooting.html +4 -4
  317. package/web/docs/troubleshooting/node-offline.html +4 -4
  318. package/web/docs/troubleshooting/quick-diagnosis.html +4 -4
  319. package/web/docs/troubleshooting/session-run.html +4 -4
  320. package/web/docs/troubleshooting/terminal.html +4 -4
  321. package/web/docs/troubleshooting/workspace-files.html +4 -4
  322. package/web/docs/workbench/composer.html +4 -4
  323. package/web/docs/workbench/context-and-plan.html +4 -4
  324. package/web/docs/workbench/conversation.html +4 -4
  325. package/web/docs/workbench/file-reference-and-attachment.html +4 -4
  326. package/web/docs/workbench/files.html +4 -4
  327. package/web/docs/workbench/git-changes.html +4 -4
  328. package/web/docs/workbench/git-history.html +4 -4
  329. package/web/docs/workbench/hosted-conversations.html +4 -4
  330. package/web/docs/workbench/mobile.html +4 -4
  331. package/web/docs/workbench/navigation.html +4 -4
  332. package/web/docs/workbench/sessions.html +4 -4
  333. package/web/docs/workbench/skills.html +4 -4
  334. package/web/docs/workbench/terminal.html +4 -4
  335. package/web/index.html +1 -1
  336. package/web/service-worker.js +1 -1
  337. package/web/web-version.json +1 -1
  338. package/web/assets/HtmlPreviewFrame-xgqXo3bD.js +0 -5
  339. package/web/assets/NodeManagementPage-C1Cj7rex.js +0 -1
  340. package/web/assets/NodeManagementPage-DRBCipFy.js +0 -1
  341. package/web/assets/SecretManagementPage-BDo50Fo5.js +0 -1
  342. package/web/assets/SkillCenterPage-Dl-aKzxp.js +0 -1
  343. package/web/assets/SystemConfigurationPage-CUI3Icws.js +0 -1
  344. package/web/assets/WorkbenchPage-C1l73Bo7.css +0 -1
  345. package/web/assets/WorkspaceManagementPage-0uM3HF3o.js +0 -1
  346. package/web/assets/WorkspaceManagementPage-DlcAgYsx.js +0 -1
  347. package/web/assets/channel-D5Au5X55.js +0 -1
  348. package/web/assets/classDiagram-CYGNFDIV-CplRLUOK.js +0 -1
  349. package/web/assets/classDiagram-v2-TLXNO2FR-CplRLUOK.js +0 -1
  350. package/web/assets/infoDiagram-FKFFQAWI-ZeaWiVDx.js +0 -2
  351. package/web/assets/stateDiagram-v2-IH3M54BS-D93lsHZ8.js +0 -1
  352. package/web/assets/swimlanesDiagram-JKAHXJPX-C3UEWonA.js +0 -8
  353. package/web/docs/assets/administration_license.md.Bf1iyuKG.js +0 -1
  354. package/web/docs/assets/chunks/@localSearchIndexen-US.BEf68FQA.js +0 -1
  355. package/web/docs/assets/chunks/@localSearchIndexroot.Dw4g7XXs.js +0 -1
  356. package/web/docs/assets/deployment_network.md.BarghfLt.js +0 -1
  357. package/web/docs/assets/deployment_network.md.BarghfLt.lean.js +0 -1
  358. package/web/docs/assets/deployment_upgrade.md.BESOToM5.js +0 -1
  359. package/web/docs/assets/deployment_upgrade.md.BESOToM5.lean.js +0 -1
  360. package/web/docs/assets/en-US_administration_license.md.Dmg8rNEl.js +0 -1
  361. package/web/docs/assets/en-US_deployment_network.md.DdOgOLns.js +0 -1
  362. package/web/docs/assets/en-US_deployment_network.md.DdOgOLns.lean.js +0 -1
  363. package/web/docs/assets/en-US_deployment_upgrade.md.DZiDDiLn.js +0 -1
  364. package/web/docs/assets/en-US_getting-started_npm-quick-start.md.Dwsi-ffA.js +0 -3
  365. package/web/docs/assets/en-US_getting-started_npm-quick-start.md.Dwsi-ffA.lean.js +0 -1
  366. package/web/docs/assets/en-US_getting-started_prerequisites.md.Bpx_AQD1.js +0 -1
  367. package/web/docs/assets/en-US_getting-started_prerequisites.md.Bpx_AQD1.lean.js +0 -1
  368. package/web/docs/assets/getting-started_npm-quick-start.md.CcxMwUgz.js +0 -3
  369. package/web/docs/assets/getting-started_npm-quick-start.md.CcxMwUgz.lean.js +0 -1
  370. package/web/docs/assets/getting-started_prerequisites.md.D26KU42D.js +0 -1
  371. /package/web/docs/assets/{administration_license.md.Bf1iyuKG.lean.js → administration_license.md.CVLEsGB6.lean.js} +0 -0
  372. /package/web/docs/assets/{en-US_administration_license.md.Dmg8rNEl.lean.js → en-US_administration_license.md.GCAYq1LT.lean.js} +0 -0
  373. /package/web/docs/assets/{en-US_getting-started_server-installation.md._k2XGM85.lean.js → en-US_getting-started_server-installation.md.C7SjGDJt.lean.js} +0 -0
  374. /package/web/docs/assets/{getting-started_overview.md.CA1CCOBc.lean.js → getting-started_overview.md.Cv-HSfAh.lean.js} +0 -0
  375. /package/web/docs/assets/{getting-started_server-installation.md.D3P3Lmc2.lean.js → getting-started_server-installation.md.BsEfVH6b.lean.js} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BeipYJv6.js","assets/index-Bokwz5PA.js","assets/index-DsgwAvJA.js","assets/index-By66DnCX.css","assets/code-navigation-target-BlnRe0-a.js","assets/index-D6945seh.js","assets/index-C8DbmG_l.js","assets/index-CBs38naL.js","assets/index-BOhe9vs1.js","assets/index-DGlioDXJ.js","assets/index-BYYx_GrI.js","assets/index-Tv4HGgSj.js","assets/index-x9JuBH-H.js","assets/index-sctirQW0.js","assets/index-hP6Cb_NE.js","assets/index-B0P8j1yb.js","assets/index-C_EAvnDF.js","assets/index-DU209g6d.js","assets/index-BkC7CnZA.js","assets/index-W6jp3JVA.js","assets/index-9ks2AQTi.js","assets/index-C_F0LgDO.js","assets/index-x2OEXKrc.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js","assets/index-B8rWDVmR.js","assets/index-eU6FSd70.js"])))=>i.map(i=>d[i]);
2
- import{ag as x,d as Qf,D as Zf,t as ze,w as Pi,Y as eu,o as tu,b as iu,a as nu,_ as su}from"./index-DsgwAvJA.js";import{n as ru}from"./code-navigation-target-BlnRe0-a.js";let pr=[],ja=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ja:pr).push(t=t+n[e])})();function ou(n){if(n<768)return!1;for(let e=0,t=pr.length;;){let i=e+t>>1;if(n<pr[i])t=i;else if(n>=ja[i])e=i+1;else return!0;if(e==t)return!1}}function tl(n){return n>=127462&&n<=127487}const il=8205;function lu(n,e,t=!0,i=!0){return(t?Ka:au)(n,e,i)}function Ka(n,e,t){if(e==n.length)return e;e&&Ua(n.charCodeAt(e))&&Ga(n.charCodeAt(e-1))&&e--;let i=Ws(n,e);for(e+=nl(i);e<n.length;){let s=Ws(n,e);if(i==il||s==il||t&&ou(s))e+=nl(s),i=s;else if(tl(s)){let r=0,o=e-2;for(;o>=0&&tl(Ws(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function au(n,e,t){for(;e>1;){let i=Ka(n,e-2,t);if(i<e)return i;e--}return 0}function Ws(n,e){let t=n.charCodeAt(e);if(!Ga(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Ua(i)?(t-55296<<10)+(i-56320)+65536:t}function Ua(n){return n>=56320&&n<57344}function Ga(n){return n>=55296&&n<56320}function nl(n){return n<65536?1:2}class j{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=xi(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),lt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xi(this,e,t);let i=[];return this.decompose(e,t,i,0),lt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new zi(this),r=new zi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new zi(this,e)}iterRange(e,t=this.length){return new Ya(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xa(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?j.empty:e.length<=32?new oe(e):lt.from(oe.split(e,[]))}}class oe extends j{constructor(e,t=hu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new cu(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new oe(sl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Un(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new oe(l,o.length+r.length));else{let a=l.length>>1;i.push(new oe(l.slice(0,a)),new oe(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof oe))return super.replace(e,t,i);[e,t]=xi(this,e,t);let s=Un(this.text,Un(i.text,sl(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new oe(s,r):lt.from(oe.split(s,[]),r)}sliceString(e,t=this.length,i=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-s_IiIj3Q.js","assets/index-C-rtGAiQ.js","assets/index-tebwt16R.js","assets/index-By66DnCX.css","assets/code-navigation-target-BlnRe0-a.js","assets/index-Dmjcd9dH.js","assets/index-C38uEGP7.js","assets/index-BP-OH85t.js","assets/index-C20z2yeK.js","assets/index-D0gqeuOi.js","assets/index-BbOzeZis.js","assets/index-QkybH-4Y.js","assets/index-CeewrlMR.js","assets/index-BQ4D3lnr.js","assets/index-CNYQPSEc.js","assets/index-BS-OsBk1.js","assets/index-BTXpkf3M.js","assets/index-DYEKyod1.js","assets/index-C20Ctqox.js","assets/index-DCX6wtGf.js","assets/index-CRCrq0fK.js","assets/index-X_ZLsJF-.js","assets/index-Dw3xGHpw.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js","assets/index-GDJZ4nKF.js","assets/index-DqPiRdTW.js"])))=>i.map(i=>d[i]);
2
+ import{ag as x,d as Qf,D as Zf,t as ze,w as Pi,Y as eu,o as tu,b as iu,a as nu,_ as su}from"./index-tebwt16R.js";import{n as ru}from"./code-navigation-target-BlnRe0-a.js";let pr=[],ja=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ja:pr).push(t=t+n[e])})();function ou(n){if(n<768)return!1;for(let e=0,t=pr.length;;){let i=e+t>>1;if(n<pr[i])t=i;else if(n>=ja[i])e=i+1;else return!0;if(e==t)return!1}}function tl(n){return n>=127462&&n<=127487}const il=8205;function lu(n,e,t=!0,i=!0){return(t?Ka:au)(n,e,i)}function Ka(n,e,t){if(e==n.length)return e;e&&Ua(n.charCodeAt(e))&&Ga(n.charCodeAt(e-1))&&e--;let i=Ws(n,e);for(e+=nl(i);e<n.length;){let s=Ws(n,e);if(i==il||s==il||t&&ou(s))e+=nl(s),i=s;else if(tl(s)){let r=0,o=e-2;for(;o>=0&&tl(Ws(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function au(n,e,t){for(;e>1;){let i=Ka(n,e-2,t);if(i<e)return i;e--}return 0}function Ws(n,e){let t=n.charCodeAt(e);if(!Ga(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Ua(i)?(t-55296<<10)+(i-56320)+65536:t}function Ua(n){return n>=56320&&n<57344}function Ga(n){return n>=55296&&n<56320}function nl(n){return n<65536?1:2}class j{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=xi(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),lt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xi(this,e,t);let i=[];return this.decompose(e,t,i,0),lt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new zi(this),r=new zi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new zi(this,e)}iterRange(e,t=this.length){return new Ya(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xa(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?j.empty:e.length<=32?new oe(e):lt.from(oe.split(e,[]))}}class oe extends j{constructor(e,t=hu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new cu(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new oe(sl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Un(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new oe(l,o.length+r.length));else{let a=l.length>>1;i.push(new oe(l.slice(0,a)),new oe(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof oe))return super.replace(e,t,i);[e,t]=xi(this,e,t);let s=Un(this.text,Un(i.text,sl(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new oe(s,r):lt.from(oe.split(s,[]),r)}sliceString(e,t=this.length,i=`
3
3
  `){[e,t]=xi(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new oe(i,s)),i=[],s=-1);return s>-1&&t.push(new oe(i,s)),t}}class lt extends j{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=xi(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new lt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
4
4
  `){[e,t]=xi(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof lt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new oe(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof lt)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof oe&&a&&(p=c[c.length-1])instanceof oe&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new oe(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:lt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new lt(l,t)}}j.empty=new oe([""],0);function hu(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Un(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function sl(n,e,t){return Un(n,[""],e,t)}class zi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof oe?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof oe?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
5
5
  `,this;e--}else if(s instanceof oe){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof oe?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ya{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new zi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Xa{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(j.prototype[Symbol.iterator]=function(){return this.iter()},zi.prototype[Symbol.iterator]=Ya.prototype[Symbol.iterator]=Xa.prototype[Symbol.iterator]=function(){return this});class cu{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function xi(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function ue(n,e,t=!0,i=!0){return lu(n,e,t,i)}function fu(n){return n>=56320&&n<57344}function uu(n){return n>=55296&&n<56320}function Le(n,e){let t=n.charCodeAt(e);if(!uu(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return fu(i)?(t-55296<<10)+(i-56320)+65536:t}function lo(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function at(n){return n<65536?1:2}const mr=/\r\n?|\n/;var be=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(be||(be={}));class pt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){gr(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new pt(e)}composeDesc(e){return this.empty?e:e.empty?this:Ja(this,e)}mapDesc(e,t=!1){return e.empty?this:yr(this,e,t)}mapPos(e,t=-1,i=be.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=be.Simple&&h>=e&&(i==be.TrackDel&&s<e&&h>e||i==be.TrackBefore&&s<e||i==be.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new pt(e)}static create(e){return new pt(e)}}class ce extends pt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return gr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return yr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(j.empty);i.push(o?e.slice(r,r+o):j.empty)}r+=o}return new ce(t,i)}compose(e){return this.empty?e:e.empty?this:Ja(this,e,!0)}map(e,t=!1){return e.empty?this:yr(this,e,t,!0)}iterChanges(e,t=!1){gr(this,e,t)}get desc(){return pt.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Gi(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);we(s,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;we(t,c,f),f>0&&Rt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);we(t,c,-1),we(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new ce(t,i),filtered:pt.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&we(s,t-o,-1);let f=new ce(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof ce){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?j.of(d.split(i||mr)):d:j.empty,m=p.length;if(f==u&&m==0)return;f<o&&a(),f>o&&we(s,f-o,-1),we(s,u-f,m),Rt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(j.empty);i[s]=j.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new ce(t,i)}static createSet(e,t){return new ce(e,t)}}function we(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Rt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(j.empty);n.push(t)}}function gr(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,f=j.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function yr(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Gi(n),l=new Gi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);we(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(we(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(we(s,0,o.ins),r&&Rt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;we(s,h,a<o.i?o.ins:0),r&&a<o.i&&Rt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?ce.createSet(s,r):pt.create(s);throw new Error("Mismatched change set lengths")}}}function Ja(n,e,t=!1){let i=[],s=t?[]:null,r=new Gi(n),o=new Gi(e);for(let l=!1;;){if(r.done&&o.done)return s?ce.createSet(i,s):pt.create(i);if(r.ins==0)we(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)we(i,0,o.ins,l),s&&Rt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;we(i,a,c,l),s&&c&&Rt(s,i,o.text)}else o.ins==-1?(we(i,r.off?0:r.len,a,l),s&&Rt(s,i,r.textBit(a))):(we(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Rt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Gi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?j.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?j.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lt{constructor(e,t,i,s){this.from=e,this.to=t,this.flags=i,this.goalColumn=s}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Lt(i,s,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return w.range(e,t,void 0,void 0,i);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,s,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return w.range(e.anchor,e.head)}static create(e,t,i,s){return new Lt(e,t,i,s)}}class w{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:w.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new w([this.main],0)}addRange(e,t=!0){return w.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,w.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new w(e.ranges.map(t=>Lt.fromJSON(t)),e.main)}static single(e,t=e){return new w([w.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return w.normalized(e.slice(),t);i=r.to}return new w(e,t)}static cursor(e,t=0,i,s){return Lt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i)),s)}static range(e,t,i,s,r){let o=s==null?7:Math.min(6,s);return!r&&e!=t&&(r=t<e?1:-1),r&&(o|=r<0?8:16),t<e?Lt.create(t,e,o|32,i):Lt.create(e,t,o,i)}static undirectionalRange(e,t){return Lt.create(e,t,64,void 0)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?w.range(a,l):w.range(l,a))}}return new w(e,t)}}function Qa(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ao=0;class P{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=ao++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new P(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:ho),!!e.static,e.enables)}of(e){return new Gn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function ho(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Gn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=ao++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||br(f,c)){let d=i(f);if(l?!rl(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=is(u,p);if(this.dependencies.every(g=>g instanceof P?u.facet(g)===f.facet(g):g instanceof ve?u.field(g,!1)==f.field(g,!1):!0)||(l?rl(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}}function rl(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function br(n,e){let t=!1;for(let i of e)qi(n,i)&1&&(t=!0);return t}function du(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=is(a,i[c]);if(s[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)qi(a,h);return a.values[o]=l(a),1},update(a,h){if(!br(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=br(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&ho(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const wn=P.define({static:!0});class ve{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new ve(ao++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(wn).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(wn),o=s.facet(wn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,wn.of({field:this,create:e})]}get extension(){return this}}const Gt={lowest:4,low:3,default:2,high:1,highest:0};function Ri(n){return e=>new Za(e,n)}const qt={highest:Ri(Gt.highest),high:Ri(Gt.high),default:Ri(Gt.default),low:Ri(Gt.low),lowest:Ri(Gt.lowest)};class Za{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class It{of(e){return new xr(this,e)}reconfigure(e){return It.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class xr{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class ts{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of pu(e,t,o))u instanceof ve?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,ho(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(g=>du(g,p,d))}}let f=h.map(u=>u(l));return new ts(e,o,f,l,a,r)}}function pu(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof xr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof xr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Za)r(o.inner,o.prec);else if(o instanceof ve)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Gn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Gt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Gt.default),i.reduce((o,l)=>o.concat(l))}function qi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function is(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const eh=P.define(),vr=P.define({combine:n=>n.some(e=>e),static:!0}),th=P.define({combine:n=>n.length?n[0]:void 0,static:!0}),ih=P.define(),nh=P.define(),sh=P.define(),rh=P.define({combine:n=>n.length?n[0]:!1});class Ct{constructor(e,t){this.type=e,this.value=t}static define(){return new mu}}class mu{of(e){return new Ct(this,e)}}class gu{constructor(e){this.map=e}of(e){return new V(this,e)}}class V{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new V(this.type,t)}is(e){return this.type==e}static define(e={}){return new gu(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}V.reconfigure=V.define();V.appendConfig=V.define();class ae{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Qa(i,t.newLength),r.some(l=>l.type==ae.time)||(this.annotations=r.concat(ae.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ae(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ae.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ae.time=Ct.define();ae.userEvent=Ct.define();ae.addToHistory=Ct.define();ae.remote=Ct.define();function yu(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function oh(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=ce.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:V.mapEffects(n.effects,s).concat(V.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function wr(n,e,t){let i=e.selection,s=ui(e.annotations);return e.userEvent&&(s=s.concat(ae.userEvent.of(e.userEvent))),{changes:e.changes instanceof ce?e.changes:ce.of(e.changes||[],t,n.facet(th)),selection:i&&(i instanceof w?i:w.single(i.anchor,i.head)),effects:ui(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function lh(n,e,t){let i=wr(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=oh(i,wr(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=ae.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return xu(t?bu(s):s)}function bu(n){let e=n.startState,t=!0;for(let s of e.facet(ih)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:yu(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=ce.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=ae.create(e,s,n.selection&&n.selection.map(r),V.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(nh);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof ae?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ae?n=r[0]:n=lh(e,ui(r),!1)}return n}function xu(n){let e=n.startState,t=e.facet(sh),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=oh(i,wr(e,r,n.changes.newLength),!0))}return i==n?n:ae.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const vu=[];function ui(n){return n==null?vu:Array.isArray(n)?n:[n]}var ne=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(ne||(ne={}));const wu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kr;try{kr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ku(n){if(kr)return kr.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||wu.test(t)))return!0}return!1}function Su(n){return e=>{if(!/\S/.test(e))return ne.Space;if(ku(e))return ne.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return ne.Word;return ne.Other}}class ${constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)qi(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return qi(this,i),is(this,i)}update(...e){return lh(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let l of e.effects)l.is(It.reconfigure)?(t&&(s=new Map,t.compartments.forEach((a,h)=>s.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(V.reconfigure)?(t=null,i=l.value):l.is(V.appendConfig)&&(t=null,i=ui(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=ts.resolve(i,s,this),r=new $(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(vr)?e.newSelection:e.newSelection.asSingle();new $(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:w.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ui(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=s.mapDesc(h,!0);r.push(a.range.map(f)),s=s.compose(c),o=V.mapEffects(o,c).concat(V.mapEffects(ui(a.effects),f))}return{changes:s,selection:w.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ce?e:ce.of(e,this.doc.length,this.facet($.lineSeparator))}toText(e){return j.of(e.split(this.facet($.lineSeparator)||mr))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(qi(this,t),is(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof ve&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return $.create({doc:e.doc,selection:w.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=ts.resolve(e.extensions||[],new Map),i=e.doc instanceof j?e.doc:j.of((e.doc||"").split(t.staticFacet($.lineSeparator)||mr)),s=e.selection?e.selection instanceof w?e.selection:w.single(e.selection.anchor,e.selection.head):w.single(0);return Qa(s,i.length),t.staticFacet(vr)||(s=s.asSingle()),new $(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet($.tabSize)}get lineBreak(){return this.facet($.lineSeparator)||`
@@ -12,4 +12,4 @@ import{ag as x,d as Qf,D as Zf,t as ze,w as Pi,Y as eu,o as tu,b as iu,a as nu,_
12
12
  --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Kr),Dp={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Js=null;function Ep(){var n;if(Js==null&&typeof document<"u"&&document.body){let e=document.body.style;Js=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Js||!1}const Qn=P.define({combine(n){let e=mt(n,{render:null,specialChars:Tp,addSpecialChars:null});return(e.replaceTabs=!Ep())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Kr)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Kr)),e}});function Op(n={}){return[Qn.of(n),_p()]}let jl=null;function _p(){return jl||(jl=le.fromClass(class{constructor(n){this.view=n,this.decorations=I.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Qn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Mp({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=Le(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Ti(o.text,l,i-o.from);return I.replace({widget:new Ip((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=I.replace({widget:new Rp(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Qn);n.startState.facet(Qn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Lp="•";function Pp(n){return n>=32?Lp:n==10?"␤":String.fromCharCode(9216+n)}class Rp extends gt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Pp(this.code),i=e.state.phrase("Control character")+" "+(Dp[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ip extends gt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Bp(){return Vp}const Np=I.line({class:"cm-activeLine"}),Vp=le.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(Np.range(s.from)),e=s.from)}return I.set(t)}},{decorations:n=>n.decorations}),Ur=2e3;function Fp(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Ur||t.off>Ur||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(w.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=Mr(h.text,o,n.tabSize,!0);if(c<0)r.push(w.cursor(h.to));else{let f=Mr(h.text,l,n.tabSize);r.push(w.range(h.from+c,h.from+f))}}}return r}function Wp(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Kl(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Ur?-1:s==i.length?Wp(n,e.clientX):Ti(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Hp(n,e){let t=Kl(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Kl(n,s);if(!l)return i;let a=Fp(n.state,t,l);return a.length?o?w.create(a.concat(i.ranges)):w.create(a):i}}:null}function zp(n){let e=(t=>t.altKey&&t.button==0);return _.mouseSelectionStyle.of((t,i)=>e(i)?Hp(t,i):null)}const qp={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},$p={style:"cursor: crosshair"};function jp(n={}){let[e,t]=qp[n.key||"Alt"],i=le.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,_.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?$p:null})]}const Ln="-10000px";class cc{constructor(e,t,i,s){this.facet=t,this.createTooltipView=i,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<r.length;a++){let h=r[a],c=-1;if(h){for(let f=0;f<this.tooltips.length;f++){let u=this.tooltips[f];u&&u.create==h.create&&(c=f)}if(c<0)o[a]=this.createTooltipView(h,a?o[a-1]:null),l&&(l[a]=!!h.above);else{let f=o[a]=this.tooltipViews[c];l&&(l[a]=t[c]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,h)=>t[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function Kp(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Qs=P.define({combine:n=>{var e,t,i;return{position:L.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Kp}}}),Ul=new WeakMap,Co=le.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Qs);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new cc(n,Ao,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Qs);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Ln,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(L.safari){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=vo(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Qs).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:c}=h,f=n.pos[l],u=n.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(t.top,i.top)||f.top>=Math.min(t.bottom,i.bottom)||f.right<Math.max(t.left,i.left)-.1||f.left>Math.min(t.right,i.right)+.1)){c.style.top=Ln;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Ul.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||Gp,C=this.view.textDirection==ee.LTR,k=u.width>i.right-i.left?C?i.left:i.right-u.width:C?Math.max(i.left,Math.min(f.left-(d?14:0)+b.x,i.right-m)):Math.min(Math.max(i.left,f.left-m+(d?14:0)-b.x),i.right-m),R=this.above[l];!a.strictSide&&(R?f.top-g-p-b.y<i.top:f.bottom+g+p+b.y>i.bottom)&&R==i.bottom-f.bottom>f.top-i.top&&(R=this.above[l]=!R);let M=(R?f.top-i.top:i.bottom-f.bottom)-p;if(M<g&&h.resize!==!1){if(M<this.view.defaultLineHeight){c.style.top=Ln;continue}Ul.set(h,g),c.style.height=(g=M)/r+"px"}else c.style.height&&(c.style.height="");let T=R?f.top-g-p-b.y:f.bottom+p+b.y,D=k+m;if(h.overlap!==!0)for(let F of o)F.left<D&&F.right>k&&F.top<T+g&&F.bottom>T&&(T=R?F.top-g-2-p:F.bottom+p+2);if(this.position=="absolute"?(c.style.top=(T-n.parent.top)/r+"px",Gl(c,(k-n.parent.left)/s)):(c.style.top=T/r+"px",Gl(c,k/s)),d){let F=f.left+(C?b.x:-b.x)-(k+14-7);d.style.left=F/s+"px"}h.overlap!==!0&&o.push({left:k,top:T,right:D,bottom:T+g}),c.classList.toggle("cm-tooltip-above",R),c.classList.toggle("cm-tooltip-below",!R),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Ln}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Gl(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const Up=_.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Gp={x:0,y:0},Ao=P.define({enables:[Co,Up]}),us=P.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class _s{static create(e){return new _s(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new cc(e,us,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let s=i[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Yp=Ao.compute([us],n=>{let e=n.facet(us);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:_s.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),fc=P.define();class Xp{constructor(e,t,i,s,r,o){this.view=e,this.source=t,this.field=i,this.locked=s,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let s,r=1;if(i.isWidget())s=i.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let o=e.coordsAtPos(s);if(!o||t.y<o.top||t.y>o.bottom||t.x<o.left-e.defaultCharacterWidth||t.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),a=l&&l.dir==ee.RTL?-1:1;r=t.x<o.left?-a:a}this.activateHover(e,s,r)}activateHover(e,t,i,s){let r=this.source(e,t,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];s&&this.locked.set(a,s),e.dispatch({effects:this.setHover.of(a)})}};if(r&&"then"in r){let l=this.pending={pos:t};r.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>Ie(e.state,a,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin(Co),t=e?e.manager.tooltips.findIndex(i=>i.create==_s.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&!this.locked.has(s)&&r&&!Jp(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!Qp(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:s}=this;s.length&&!this.locked.has(s)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Pn=4;function Jp(n,e){let{left:t,right:i,top:s,bottom:r}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-Pn&&e.clientX<=i+Pn&&e.clientY>=s-Pn&&e.clientY<=r+Pn}function Qp(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.right<i||o.top>s||Math.min(o.bottom,l)<s)return!1;let a=n.posAtCoords({x:i,y:s},!1);return a>=e&&a<=t}function Zp(n,e={}){let t=V.define(),i=new WeakMap,s=ve.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(h=>!e.hideOn(l,h)))),l.docChanged&&o.length){let h=[];for(let c of o){let f=l.changes.mapPos(c.pos,-1,be.TrackDel);if(f!=null){let u=Object.assign(Object.create(null),c);u.pos=f,u.end!=null&&(u.end=l.changes.mapPos(u.end)),h.push(u)}}o=h}for(let h of l.effects)h.is(t)&&(o=h.value,a=void 0),(h.is(tm)&&!h.value||h.value==s)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>us.from(o)});const r=le.define(o=>new Xp(o,n,s,i,t,e.hoverTime||300));return{active:s,extension:[s,r,fc.of(r),Yp]}}function em(n,e,t,i={}){var s;let r=n.state.facet(fc).map(o=>n.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=r.find(l=>l.field==i.tooltip.active);o&&(r=[o])}for(let o of r)o.activateHover(n,e,t,(s=i.until)!==null&&s!==void 0?s:(()=>!1))}function uc(n,e){let t=n.plugin(Co);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const tm=V.define(),Yl=P.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Mo(n,e){let t=n.plugin(dc),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const dc=le.fromClass(class{constructor(n){this.input=n.state.facet(en),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Yl);this.top=new Rn(n,!0,e.topContainer),this.bottom=new Rn(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Yl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rn(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rn(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(en);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>_.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Rn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Xl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Xl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Xl(n){let e=n.nextSibling;return n.remove(),e}const en=P.define({enables:dc});function im(n,e){let t,i=new Promise(o=>t=o),s=o=>nm(o,e,t);n.state.field(Zs,!1)?n.dispatch({effects:pc.of(s)}):n.dispatch({effects:V.appendConfig.of(Zs.init(()=>[s]))});let r=mc.of(s);return{close:r,result:i.then(o=>((n.win.queueMicrotask||(a=>n.win.setTimeout(a,10)))(()=>{n.state.field(Zs).indexOf(s)>-1&&n.dispatch({effects:r})}),o))}}const Zs=ve.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(pc)?n=[t.value].concat(n):t.is(mc)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>en.computeN([n],e=>e.field(n))}),pc=V.define(),mc=V.define();function nm(n,e,t){let i=e.content?e.content(n,()=>o(null)):null;if(!i){if(i=J("form"),e.input){let l=J("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(J("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(J("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l<s.length;l++){let a=s[l];a.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let r=J("div",i,J("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&n.focus(),t(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class St extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}St.prototype.elementClass="";St.prototype.toDOM=void 0;St.prototype.mapMode=be.TrackBefore;St.prototype.startSide=St.prototype.endSide=-1;St.prototype.point=!0;const Zn=P.define(),sm=P.define(),rm={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>q.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Ui=P.define();function om(n){return[gc(),Ui.of({...rm,...n})]}const Jl=P.define({combine:n=>n.some(e=>e)});function gc(n){return[lm]}const lm=le.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Ui).map(e=>new Zl(n,e)),this.fixed=!n.state.facet(Jl);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Jl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=q.iter(this.view.state.facet(Zn),this.view.viewport.from),i=[],s=this.gutters.map(r=>new am(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==xe.Text&&o){Gr(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==xe.Text){Gr(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(Ui),t=n.state.facet(Ui),i=n.docChanged||n.heightChanged||n.viewportChanged||!q.eq(n.startState.facet(Zn),n.state.facet(Zn),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Zl(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>_.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ee.LTR?{left:i,right:s}:{right:i,left:s}})});function Ql(n){return Array.isArray(n)?n:[n]}function Gr(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class am{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=q.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new yc(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Gr(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),s=i?[i]:null;for(let r of e.state.facet(sm)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Zl{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=Ql(t.markers(e)),t.initialSpacer&&(this.spacer=new yc(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Ql(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!q.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class yc{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),hm(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<t.length?t[r++]:null,h=!1;if(a){let c=a.elementClass;c&&(i+=" "+c);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,h=!0;break}}else l=this.markers.length;for(;o<l;){let c=this.markers[o++];if(c.toDOM){c.destroy(s);let f=s.nextSibling;s.remove(),s=f}}if(!a)break;a.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(a.toDOM(e),s)),h&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function hm(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const cm=P.define(),fm=P.define(),ci=P.define({combine(n){return mt(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let s in t){let r=i[s],o=t[s];i[s]=r?(l,a,h)=>r(l,a,h)||o(l,a,h):o}return i}})}});class er extends St{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function tr(n,e){return n.state.facet(ci).formatNumber(e,n.state)}const um=Ui.compute([ci],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(cm)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new er(tr(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let s of e.state.facet(fm)){let r=s(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(ci)!=e.state.facet(ci),initialSpacer(e){return new er(tr(e,ea(e.state.doc.lines)))},updateSpacer(e,t){let i=tr(t.view,ea(t.view.state.doc.lines));return i==e.number?e:new er(i)},domEventHandlers:n.facet(ci).domEventHandlers,side:"before"}));function dm(n={}){return[ci.of(n),gc(),um]}function ea(n){let e=9;for(;e<n;)e=e*10+9;return e}const pm=new class extends St{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},mm=Zn.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(pm.range(s)))}return q.of(e)});function gm(){return mm}const ym=1024;let bm=0;class je{constructor(e,t){this.from=e,this.to=t}}class z{constructor(e={}){this.id=bm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=De.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}z.closedBy=new z({deserialize:n=>n.split(" ")});z.openedBy=new z({deserialize:n=>n.split(" ")});z.group=new z({deserialize:n=>n.split(" ")});z.isolate=new z({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});z.contextHash=new z({perNode:!0});z.lookAhead=new z({perNode:!0});z.mounted=new z({perNode:!0});class gi{constructor(e,t,i,s=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=s}static get(e){return e&&e.props&&e.props[z.mounted.id]}}const xm=Object.create(null);class De{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):xm,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new De(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(z.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(z.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}De.none=new De("",Object.create(null),0,8);class To{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let s=null;for(let r of e){let o=r(i);if(o){s||(s=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in s&&(l=a.combine(s[a.id],l)),s[a.id]=l}}t.push(s?new De(i.name,s,i.id,i.flags):i)}return new To(t)}}const In=new WeakMap,ta=new WeakMap;var Z;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Z||(Z={}));class te{constructor(e,t,i,s,r){if(this.type=e,this.children=t,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=gi.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let s=i.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new ds(this.topNode,e)}cursorAt(e,t=0,i=0){let s=In.get(this)||this.topNode,r=new ds(s);return r.moveTo(e,t),In.set(this,r._tree),r}get topNode(){return new ke(this,0,0,null)}resolve(e,t=0){let i=tn(In.get(this)||this.topNode,e,t,!1);return In.set(this,i),i}resolveInner(e,t=0){let i=tn(ta.get(this)||this.topNode,e,t,!0);return ta.set(this,i),i}resolveStack(e,t=0){return km(this,e,t)}iterate(e){let{enter:t,leave:i,from:s=0,to:r=this.length}=e,o=e.mode||0,l=(o&Z.IncludeAnonymous)>0;for(let a=this.cursor(o|Z.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Oo(De.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new te(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new te(De.none,t,i,s)))}static build(e){return Sm(e)}}te.empty=new te(De.none,[],[],0);class Do{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Do(this.buffer,this.index)}}class Wt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return De.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],s=this.set.types[t],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,i==e)return r;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,i,s,r){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(bc(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){r[a++]=s[l++],r[a++]=s[l++]-i;let h=r[a++]=s[l++]-i;r[a++]=s[l++]-e,o=Math.max(o,h)}return new Wt(r,o,this.set)}}function bc(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function tn(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof ke&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:Z.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof ke&&o.index<0&&((s=l.enter(e,t,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,r);if(!o)return n;n=o}}class xc{cursor(e=0){return new ds(this,e)}getChild(e,t=null,i=null){let s=ia(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ia(this,e,t,i)}resolve(e,t=0){return tn(this,e,t,!1)}resolveInner(e,t=0){return tn(this,e,t,!0)}matchContext(e){return Yr(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(i=t,t=s.prevSibling):t=s}return i}get node(){return this}get next(){return this.parent}}class ke extends xc{constructor(e,t,i,s){super(),this._tree=e,this.from=t,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,s,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(r&Z.EnterBracketed&&c instanceof te&&(u=gi.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!bc(s,i,f,f+c.length))){if(c instanceof Wt){if(r&Z.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,s);if(d>-1)return new ft(new vm(o,c,e,f),null,d)}else if(r&Z.IncludeAnonymous||!c.type.isAnonymous||Eo(c)){let d;if(!(r&Z.IgnoreMounts)&&(d=gi.get(c))&&!d.overlay)return new ke(d.tree,f,e,o);let p=new ke(c,f,e,o);return r&Z.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,s,r)}}}if(r&Z.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let s;if(!(i&Z.IgnoreOverlays)&&(s=gi.get(this._tree))&&s.overlay){let r=e-this.from,o=i&Z.EnterBracketed&&s.bracketed;for(let{from:l,to:a}of s.overlay)if((t>0||o?l<=r:l<r)&&(t<0||o?a>=r:a>r))return new ke(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ia(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Yr(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class vm{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class ft extends xc{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new ft(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&Z.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ft(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ft(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ft(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new te(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function vc(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>t.from||o.to<t.to)&&(t=o,e=r)}let i=t instanceof ke&&t.index<0?null:t.parent,s=n.slice();return i?s[e]=i:s.splice(e,1),new wm(s,t)}class wm{constructor(e,t){this.heads=e,this.node=t}get next(){return vc(this.heads)}}function km(n,e,t){let i=n.resolveInner(e,t),s=null;for(let r=i instanceof ke?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[i])).push(o.resolve(e,t)),r=o}else{let o=gi.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new ke(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(tn(l,e,t,!1))}}return s?vc(s):i}class ds{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Z.EnterBracketed,e instanceof ke)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof ke?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Z.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Z.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Z.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:t,parent:i}=s)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&Z.IncludeAnonymous||l instanceof Wt||!l.type.isAnonymous||Eo(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s<this.stack.length;s++)t=new ft(this.buffer,t,this.stack[s]);return this.bufferNode=new ft(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return Yr(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return Yr(this._tree,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Eo(n){return n.children.some(e=>e instanceof Wt||!e.type.isAnonymous||Eo(e))}function Sm(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=ym,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Do(t,t.length):t,a=i.types,h=0,c=0;function f(M,T,D,F,H,G){let{id:W,start:B,end:U,size:K}=l,X=c,pe=h;if(K<0)if(l.next(),K==-1){let Xe=r[W];D.push(Xe),F.push(B-M);return}else if(K==-3){h=W;return}else if(K==-4){c=W;return}else throw new RangeError(`Unrecognized record size: ${K}`);let Ce=a[W],We,he,Ee=B-M;if(U-B<=s&&(he=g(l.pos-T,H))){let Xe=new Uint16Array(he.size-he.skip),Oe=l.pos-he.size,_e=Xe.length;for(;l.pos>Oe;)_e=b(he.start,Xe,_e);We=new Wt(Xe,U-he.start,i),Ee=he.start-M}else{let Xe=l.pos-K;l.next();let Oe=[],_e=[],it=W>=o?W:-1,At=0,He=U;for(;l.pos>Xe;)it>=0&&l.id==it&&l.size>=0?(l.end<=He-s&&(p(Oe,_e,B,At,l.end,He,it,X,pe),At=Oe.length,He=l.end),l.next()):G>2500?u(B,Xe,Oe,_e):f(B,Xe,Oe,_e,it,G+1);if(it>=0&&At>0&&At<Oe.length&&p(Oe,_e,B,At,B,He,it,X,pe),Oe.reverse(),_e.reverse(),it>-1&&At>0){let _i=d(Ce,pe);We=Oo(Ce,Oe,_e,0,Oe.length,0,U-B,_i,_i)}else We=m(Ce,Oe,_e,U-B,X-U,pe)}D.push(We),F.push(Ee)}function u(M,T,D,F){let H=[],G=0,W=-1;for(;l.pos>T;){let{id:B,start:U,end:K,size:X}=l;if(X>4)l.next();else{if(W>-1&&U<W)break;W<0&&(W=K-s),H.push(B,U,K),G++,l.next()}}if(G){let B=new Uint16Array(G*4),U=H[H.length-2];for(let K=H.length-3,X=0;K>=0;K-=3)B[X++]=H[K],B[X++]=H[K+1]-U,B[X++]=H[K+2]-U,B[X++]=X;D.push(new Wt(B,H[2]-U,i)),F.push(U-M)}}function d(M,T){return(D,F,H)=>{let G=0,W=D.length-1,B,U;if(W>=0&&(B=D[W])instanceof te){if(!W&&B.type==M&&B.length==H)return B;(U=B.prop(z.lookAhead))&&(G=F[W]+B.length+U)}return m(M,D,F,H,G,T)}}function p(M,T,D,F,H,G,W,B,U){let K=[],X=[];for(;M.length>F;)K.push(M.pop()),X.push(T.pop()+D-H);M.push(m(i.types[W],K,X,G-H,B-G,U)),T.push(H-D)}function m(M,T,D,F,H,G,W){if(G){let B=[z.contextHash,G];W=W?[B].concat(W):[B]}if(H>25){let B=[z.lookAhead,H];W=W?[B].concat(W):[B]}return new te(M,T,D,F,W)}function g(M,T){let D=l.fork(),F=0,H=0,G=0,W=D.end-s,B={size:0,start:0,skip:0};e:for(let U=D.pos-M;D.pos>U;){let K=D.size;if(D.id==T&&K>=0){B.size=F,B.start=H,B.skip=G,G+=4,F+=4,D.next();continue}let X=D.pos-K;if(K<0||X<U||D.start<W)break;let pe=D.id>=o?4:0,Ce=D.start;for(D.next();D.pos>X;){if(D.size<0)if(D.size==-3||D.size==-4)pe+=4;else break e;else D.id>=o&&(pe+=4);D.next()}H=Ce,F+=K,G+=pe}return(T<0||F==M)&&(B.size=F,B.start=H,B.skip=G),B.size>4?B:void 0}function b(M,T,D){let{id:F,start:H,end:G,size:W}=l;if(l.next(),W>=0&&F<o){let B=D;if(W>4){let U=l.pos-(W-4);for(;l.pos>U;)D=b(M,T,D)}T[--D]=B,T[--D]=G-M,T[--D]=H-M,T[--D]=F}else W==-3?h=F:W==-4&&(c=F);return D}let C=[],k=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,C,k,-1,0);let R=(e=n.length)!==null&&e!==void 0?e:C.length?k[0]+C[0].length:0;return new te(a[n.topID],C.reverse(),k.reverse(),R)}const na=new WeakMap;function es(n,e){if(!n.isAnonymous||e instanceof Wt||e.type!=n)return 1;let t=na.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof te)){t=1;break}t+=es(n,i)}na.set(e,t)}return t}function Oo(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p<s;p++)h+=es(n,e[p]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(p,m,g,b,C){for(let k=g;k<b;){let R=k,M=m[k],T=es(n,p[k]);for(k++;k<b;k++){let D=es(n,p[k]);if(T+D>=c)break;T+=D}if(k==R+1){if(T>c){let D=p[R];d(D.children,D.positions,0,D.children.length,m[R]+C);continue}f.push(p[R])}else{let D=m[k-1]+p[k-1].length-M;f.push(Oo(n,p,m,R,k,M,D,null,a))}u.push(M+C-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Hb{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ft?this.setBuffer(e.context.buffer,e.index,t):e instanceof ke&&this.map.set(e.tree,t)}get(e){return e instanceof ft?this.getBuffer(e.context.buffer,e.index):e instanceof ke?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class xt{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new xt(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new xt(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=r<e.length?e[r++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return s}}class wc{startParse(e,t,i){return typeof e=="string"&&(e=new Cm(e)),i=i?i.length?i.map(s=>new je(s.from,s.to)):[new je(0,0)]:[new je(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Cm{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function zb(n){return(e,t,i,s)=>new Mm(e,n,t,i,s)}class sa{constructor(e,t,i,s,r,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=s,this.target=r,this.from=o}}function ra(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class Am{constructor(e,t,i,s,r,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Xr=new z({perNode:!0});class Mm{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new te(i.type,i.children,i.positions,i.length,i.propValues.concat([[Xr,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[z.mounted.id]=new gi(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new Em(this.fragments),t=null,i=null,s=new ds(new ke(this.baseTree,this.ranges[0].from,0,null),Z.IncludeAnonymous|Z.IgnoreMounts);e:for(let r,o;;){let l=!0,a;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(t){let h=t.mounts.find(c=>c.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.from<u&&d.to>f)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Tm(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.from<s.to||!r.overlay)){s.tree||(Dm(s),t&&t.depth++,i&&i.depth++);let h=e.findMounts(s.from,r.parser);if(typeof r.overlay=="function")t=new Am(r.parser,r.overlay,h,this.inner.length,s.from,!!r.bracketed,s.tree,t);else{let c=aa(this.ranges,r.overlay||(s.from<s.to?[new je(s.from,s.to)]:[]));c.length&&ra(c),(c.length||!r.overlay)&&this.inner.push(new sa(r.parser,c.length?r.parser.startParse(this.input,ha(h,c),c):r.parser.startParse(""),r.overlay?r.overlay.map(f=>new je(f.from-s.from,f.to-s.from)):null,!!r.bracketed,s.tree,c.length?c[0].from:s.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(s))&&(a===!0&&(a=new je(s.from,s.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&s.firstChild())t&&t.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let h=aa(this.ranges,t.ranges);h.length&&(ra(h),this.inner.splice(t.index,0,new sa(t.parser,t.parser.startParse(this.input,ha(t.mounts,h),h),t.ranges.map(c=>new je(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Tm(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function oa(n,e,t,i,s,r){if(e<t){let o=n.buffer[e+1];i.push(n.slice(e,t,o)),s.push(o-r)}}function Dm(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let s=n.tree,r=s.children.indexOf(i),o=s.children[r],l=o.buffer,a=[r];function h(c,f,u,d,p,m){let g=t[m],b=[],C=[];oa(o,c,g,b,C,d);let k=l[g+1],R=l[g+2];a.push(b.length);let M=m?h(g+4,l[g+3],o.set.types[l[g]],k,R-k,m-1):e.toTree();return b.push(M),C.push(k-d),oa(o,l[g+3],f,b,C,d),new te(u,b,C,p)}s.children[r]=h(0,l.length,De.none,0,o.length,t.length-1);for(let c of a){let f=n.tree.children[c],u=n.tree.positions[c];n.yield(new ke(f,u+n.from,c,n._tree))}}class la{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Z.IncludeAnonymous|Z.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)if(!(t.to>=e&&t.enter(i,1,Z.IgnoreOverlays|Z.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof te)t=t.children[0];else break}return!1}}class Em{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Xr))!==null&&t!==void 0?t:i.to,this.inner=new la(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Xr))!==null&&e!==void 0?e:t.to,this.inner=new la(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(z.mounted);if(o&&o.parser==t)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function aa(n,e){let t=null,i=e;for(let s=1,r=0;s<n.length;s++){let o=n[s-1].to,l=n[s].from;for(;r<i.length;r++){let a=i[r];if(a.from>=l)break;a.to<=o||(t||(i=t=e.slice()),a.from<o?(t[r]=new je(a.from,o),a.to>l&&t.splice(r+1,0,new je(l,a.to))):a.to>l?t[r--]=new je(l,a.to):t.splice(r--,1))}}return i}function Om(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);u<d&&h.push(new je(u,d))}if(a=Math.min(c,f),a==1e9)break;c==a&&(o?(o=!1,s++):o=!0),f==a&&(l?(l=!1,r++):l=!0)}return h}function ha(n,e){let t=[];for(let{pos:i,mount:s,frag:r}of n){let o=i+(s.overlay?s.overlay[0].from:0),l=o+s.tree.length,a=Math.max(r.from,o),h=Math.min(r.to,l);if(s.overlay){let c=s.overlay.map(u=>new je(u.from+i,u.to+i)),f=Om(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new xt(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new xt(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let _m=0;class qe{constructor(e,t,i,s){this.name=e,this.set=t,this.base=i,this.modified=s,this.id=_m++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof qe&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new qe(i,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new ps(e);return i=>i.modified.indexOf(t)>-1?i:ps.get(i.base||i,i.modified.concat(t).sort((s,r)=>s.id-r.id))}}let Lm=0;class ps{constructor(e){this.name=e,this.instances=[],this.id=Lm++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Pm(t,l.modified));if(i)return i;let s=[],r=new qe(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=Rm(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(ps.get(l,a));return r}}function Pm(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Rm(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,s=e.length;i<s;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function Im(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new nn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return kc.add(e)}const kc=new z({combine(n,e){let t,i,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let r=new nn(s.tags,s.mode,s.context);t?t.next=r:i=r,t=r}return i}});class nn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}nn.empty=new nn([],2,null);function Sc(n,e){let t=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))t[r.tag.id]=r.class;else for(let o of r.tag)t[o.id]=r.class;let{scope:i,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Bm(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Nm(n,e,t,i=0,s=n.length){let r=new Vm(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Vm{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Fm(e)||nn.empty,f=Bm(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(z.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,b=l;;g++){let C=g<u.overlay.length?u.overlay[g]:null,k=C?C.from+l:a,R=Math.max(t,b),M=Math.min(i,k);if(R<M&&m)for(;e.from<M&&(this.highlightRange(e,R,M,s,r),this.startSpan(Math.min(M,e.to),h),!(e.to>=k||!e.nextSibling())););if(!C||k>i)break;b=C.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,C.from+l),Math.min(i,b),"",p),this.startSpan(Math.min(i,b),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Fm(n){let e=n.type.prop(kc);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const O=qe.define,Bn=O(),Ot=O(),ca=O(Ot),fa=O(Ot),_t=O(),Nn=O(_t),ir=O(_t),ot=O(),Kt=O(ot),st=O(),rt=O(),Jr=O(),Bi=O(Jr),Vn=O(),A={comment:Bn,lineComment:O(Bn),blockComment:O(Bn),docComment:O(Bn),name:Ot,variableName:O(Ot),typeName:ca,tagName:O(ca),propertyName:fa,attributeName:O(fa),className:O(Ot),labelName:O(Ot),namespace:O(Ot),macroName:O(Ot),literal:_t,string:Nn,docString:O(Nn),character:O(Nn),attributeValue:O(Nn),number:ir,integer:O(ir),float:O(ir),bool:O(_t),regexp:O(_t),escape:O(_t),color:O(_t),url:O(_t),keyword:st,self:O(st),null:O(st),atom:O(st),unit:O(st),modifier:O(st),operatorKeyword:O(st),controlKeyword:O(st),definitionKeyword:O(st),moduleKeyword:O(st),operator:rt,derefOperator:O(rt),arithmeticOperator:O(rt),logicOperator:O(rt),bitwiseOperator:O(rt),compareOperator:O(rt),updateOperator:O(rt),definitionOperator:O(rt),typeOperator:O(rt),controlOperator:O(rt),punctuation:Jr,separator:O(Jr),bracket:Bi,angleBracket:O(Bi),squareBracket:O(Bi),paren:O(Bi),brace:O(Bi),content:ot,heading:Kt,heading1:O(Kt),heading2:O(Kt),heading3:O(Kt),heading4:O(Kt),heading5:O(Kt),heading6:O(Kt),contentSeparator:O(ot),list:O(ot),quote:O(ot),emphasis:O(ot),strong:O(ot),link:O(ot),monospace:O(ot),strikethrough:O(ot),inserted:O(),deleted:O(),changed:O(),invalid:O(),meta:Vn,documentMeta:O(Vn),annotation:O(Vn),processingInstruction:O(Vn),definition:qe.defineModifier("definition"),constant:qe.defineModifier("constant"),function:qe.defineModifier("function"),standard:qe.defineModifier("standard"),local:qe.defineModifier("local"),special:qe.defineModifier("special")};for(let n in A){let e=A[n];e instanceof qe&&(e.name=n)}Sc([{tag:A.link,class:"tok-link"},{tag:A.heading,class:"tok-heading"},{tag:A.emphasis,class:"tok-emphasis"},{tag:A.strong,class:"tok-strong"},{tag:A.keyword,class:"tok-keyword"},{tag:A.atom,class:"tok-atom"},{tag:A.bool,class:"tok-bool"},{tag:A.url,class:"tok-url"},{tag:A.labelName,class:"tok-labelName"},{tag:A.inserted,class:"tok-inserted"},{tag:A.deleted,class:"tok-deleted"},{tag:A.literal,class:"tok-literal"},{tag:A.string,class:"tok-string"},{tag:A.number,class:"tok-number"},{tag:[A.regexp,A.escape,A.special(A.string)],class:"tok-string2"},{tag:A.variableName,class:"tok-variableName"},{tag:A.local(A.variableName),class:"tok-variableName tok-local"},{tag:A.definition(A.variableName),class:"tok-variableName tok-definition"},{tag:A.special(A.variableName),class:"tok-variableName2"},{tag:A.definition(A.propertyName),class:"tok-propertyName tok-definition"},{tag:A.typeName,class:"tok-typeName"},{tag:A.namespace,class:"tok-namespace"},{tag:A.className,class:"tok-className"},{tag:A.macroName,class:"tok-macroName"},{tag:A.propertyName,class:"tok-propertyName"},{tag:A.operator,class:"tok-operator"},{tag:A.comment,class:"tok-comment"},{tag:A.meta,class:"tok-meta"},{tag:A.invalid,class:"tok-invalid"},{tag:A.punctuation,class:"tok-punctuation"}]);var nr;const Jt=new z;function Cc(n){return P.define({combine:n?e=>e.concat(n):void 0})}const Wm=new z;class Ke{constructor(e,t,i=[],s=""){this.data=e,this.name=s,$.prototype.hasOwnProperty("tree")||Object.defineProperty($.prototype,"tree",{get(){return de(this)}}),this.parser=t,this.extension=[Ht.of(this),$.languageData.of((r,o,l)=>{let a=ua(r,o,l),h=a.type.prop(Jt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Wm);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return ua(e,t,i).type.prop(Jt)==this.data}findRegions(e){let t=e.facet(Ht);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Jt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(z.mounted);if(l){if(l.tree.prop(Jt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let h=r.children[a];h instanceof te&&s(h,r.positions[a]+o)}};return s(de(e),0),i}get allowsNesting(){return!0}}Ke.setState=V.define();function ua(n,e,t){let i=n.facet(Ht),s=de(n).topNode;if(!i||i.allowsNesting)for(let r=s;r;r=r.enter(e,t,Z.ExcludeBuffers|Z.EnterBracketed))r.type.isTop&&(s=r);return s}class Qr extends Ke{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=Cc(e.languageData);return new Qr(t,e.parser.configure({props:[Jt.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new Qr(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function de(n){let e=n.field(Ke.state,!1);return e?e.tree:te.empty}class Hm{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Ni=null;class Ci{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ci(e,t,[],te.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Hm(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=te.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(xt.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ni;Ni=this;try{return e()}finally{Ni=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=da(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=xt.applyChanges(i,a),s=te.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);c<f&&l.push({from:c,to:f})}}}return new Ci(this.parser,t,i,s,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:r}=this.skipped[i];s<e.to&&r>e.from&&(this.fragments=da(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends wc{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Ni;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new te(De.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Ni}}function da(n,e,t){return xt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ai{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ai(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ci.create(e.facet(Ht).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ai(i)}}Ke.state=ve.define({create:Ai.init,update(n,e){for(let t of e.effects)if(t.is(Ke.setState))return t.value;return e.startState.facet(Ht)!=e.state.facet(Ht)?Ai.init(e.state):n.apply(e)}});let Ac=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ac=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const sr=typeof navigator<"u"&&(!((nr=navigator.scheduling)===null||nr===void 0)&&nr.isInputPending)?()=>navigator.scheduling.isInputPending():null,zm=le.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ke.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ke.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ac(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,r=i.field(Ke.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!sr?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>sr&&sr()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ke.setState.of(new Ai(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ht=P.define({combine(n){return n.length?n[0]:null},enables:n=>[Ke.state,zm,_.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class qm{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class y{constructor(e,t,i,s,r,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=s,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new y(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let s of e)if(s.filename&&s.filename.test(t))return s;let i=/\.([^.]+)$/.exec(t);if(i){for(let s of e)if(s.extensions.indexOf(i[1])>-1)return s}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let s of e)if(s.alias.some(r=>r==t))return s;if(i)for(let s of e)for(let r of s.alias){let o=t.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+r.length])))return s}return null}}const $m=P.define(),Ls=P.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function si(n){let e=n.facet(Ls);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function sn(n,e){let t="",i=n.tabSize,s=n.facet(Ls)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r<e;r++)t+=s;return t}function _o(n,e){n instanceof $&&(n=new Ps(n));for(let i of n.state.facet($m)){let s=i(n,e);if(s!==void 0)return s}let t=de(n.state);return t.length>=e?jm(n,t,e):null}class Ps{constructor(e,t={}){this.state=e,this.options=t,this.unit=si(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(e,t);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.countColumn(i,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ti(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Mc=new z;function jm(n,e,t){let i=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Tc(i,n,t)}function Tc(n,e,t){for(let i=n;i;i=i.next){let s=Um(i.node);if(s)return s(Lo.create(e,t,i))}return 0}function Km(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Um(n){let e=n.type.prop(Mc);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(z.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Dc(o,!0,1,void 0,r&&!Km(o)?s.from:void 0)}return n.parent==null?Gm:null}function Gm(){return 0}class Lo extends Ps{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Lo(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Ym(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Tc(this.context.next,this.base,this.pos)}}function Ym(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Xm(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function $b({closing:n,align:e=!0,units:t=1}){return i=>Dc(i,e,t,n)}function Dc(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?Xm(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const jb=n=>n.baseIndent;function Kb({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Jm=200;function Qm(){return $.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+Jm)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=_o(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=sn(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const Zm=P.define(),eg=new z;function Ub(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function tg(n,e,t){let i=de(n);if(i.length<t)return null;let s=i.resolveStack(t,1),r=null;for(let o=s;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(r&&l.from<e)break;let a=l.type.prop(eg);if(a&&(l.to<i.length-50||i.length==n.doc.length||!ig(l))){let h=a(l,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(r=h)}}return r}function ig(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function ms(n,e,t){for(let i of n.facet(Zm)){let s=i(n,e,t);if(s)return s}return tg(n,e,t)}function Ec(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Rs=V.define({map:Ec}),gn=V.define({map:Ec});function Oc(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const ri=ve.define({create(){return I.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,s)=>n=pa(n,i,s)),n=n.map(e.changes);let t=[];for(let i of e.effects)i.is(Rs)&&!ng(n,i.value.from,i.value.to)?t.push(i.value):i.is(gn)&&(n=n.update({filter:(s,r)=>i.value.from!=s||i.value.to!=r,filterFrom:i.value.from,filterTo:i.value.to}));if(t.length){let{preparePlaceholder:i}=e.state.facet(Pc),s=t.map(r=>(i?I.replace({widget:new cg(i(e.state,r))}):ma).range(r.from,r.to));n=n.update({add:s})}return e.selection&&(n=pa(n,e.selection.main.head)),n},provide:n=>_.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],s=n[t++];if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(ma.range(i,s))}return I.set(e,!0)}});function pa(n,e,t=e){let i=!1;return n.between(e,t,(s,r)=>{s<t&&r>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(s,r)=>s>=t||r<=e}):n}function gs(n,e,t){var i;let s=null;return(i=n.field(ri,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function ng(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function _c(n,e){return n.field(ri,!1)?e:e.concat(V.appendConfig.of(Rc()))}const sg=n=>{for(let e of Oc(n)){let t=ms(n.state,e.from,e.to);if(t)return n.dispatch({effects:_c(n.state,[Rs.of(t),Lc(n,t)])}),!0}return!1},rg=n=>{if(!n.state.field(ri,!1))return!1;let e=[];for(let t of Oc(n)){let i=gs(n.state,t.from,t.to);i&&e.push(gn.of(i),Lc(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Lc(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return _.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const og=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let s=n.lineBlockAt(i),r=ms(e,s.from,s.to);r&&t.push(Rs.of(r)),i=(r?n.lineBlockAt(r.to):s).to+1}return t.length&&n.dispatch({effects:_c(n.state,t)}),!!t.length},lg=n=>{let e=n.state.field(ri,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(gn.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},ag=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:sg},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:rg},{key:"Ctrl-Alt-[",run:og},{key:"Ctrl-Alt-]",run:lg}],hg={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Pc=P.define({combine(n){return mt(n,hg)}});function Rc(n){return[ri,dg]}function Ic(n,e){let{state:t}=n,i=t.facet(Pc),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=gs(n.state,l.from,l.to);a&&n.dispatch({effects:gn.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const ma=I.replace({widget:new class extends gt{toDOM(n){return Ic(n,null)}}});class cg extends gt{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ic(e,this.value)}}const fg={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class rr extends St{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function ug(n={}){let e={...fg,...n},t=new rr(e,!0),i=new rr(e,!1),s=le.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ht)!=o.state.facet(Ht)||o.startState.field(ri,!1)!=o.state.field(ri,!1)||de(o.startState)!=de(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new wt;for(let a of o.viewportLineBlocks){let h=gs(o.state,a.from,a.to)?i:ms(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,om({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||q.empty},initialSpacer(){return new rr(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=gs(o.state,l.from,l.to);if(h)return o.dispatch({effects:gn.of(h)}),!0;let c=ms(o.state,l.from,l.to);return c?(o.dispatch({effects:Rs.of(c)}),!0):!1}}}),Rc()]}const dg=_.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class yn{constructor(e,t){this.specs=e;let i;function s(l){let a=Nt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Ke?l=>l.prop(Jt)==o.data:o?l=>l==o:void 0,this.style=Sc(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new Nt(i):null,this.themeType=t.themeType}static define(e,t){return new yn(e,t||{})}}const Zr=P.define(),Bc=P.define({combine(n){return n.length?[n[0]]:null}});function or(n){let e=n.facet(Zr);return e.length?e:n.facet(Bc)}function Nc(n,e){let t=[mg],i;return n instanceof yn&&(n.module&&t.push(_.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(Bc.of(n)):i?t.push(Zr.computeN([_.darkTheme],s=>s.facet(_.darkTheme)==(i=="dark")?[n]:[])):t.push(Zr.of(n)),t}class pg{constructor(e){this.markCache=Object.create(null),this.tree=de(e.state),this.decorations=this.buildDeco(e,or(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=de(e.state),i=or(e.state),s=i!=or(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!s&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return I.none;let i=new wt;for(let{from:s,to:r}of e.visibleRanges)Nm(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=I.mark({class:a})))},s,r);return i.finish()}}const mg=qt.high(le.fromClass(pg,{decorations:n=>n.decorations})),gg=yn.define([{tag:A.meta,color:"#404740"},{tag:A.link,textDecoration:"underline"},{tag:A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.keyword,color:"#708"},{tag:[A.atom,A.bool,A.url,A.contentSeparator,A.labelName],color:"#219"},{tag:[A.literal,A.inserted],color:"#164"},{tag:[A.string,A.deleted],color:"#a11"},{tag:[A.regexp,A.escape,A.special(A.string)],color:"#e40"},{tag:A.definition(A.variableName),color:"#00f"},{tag:A.local(A.variableName),color:"#30a"},{tag:[A.typeName,A.namespace],color:"#085"},{tag:A.className,color:"#167"},{tag:[A.special(A.variableName),A.macroName],color:"#256"},{tag:A.definition(A.propertyName),color:"#00c"},{tag:A.comment,color:"#940"},{tag:A.invalid,color:"#f00"}]),yg=_.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vc=1e4,Fc="()[]{}",Wc=P.define({combine(n){return mt(n,{afterCursor:!0,brackets:Fc,maxScanDistance:Vc,renderMatch:vg})}}),bg=I.mark({class:"cm-matchingBracket"}),xg=I.mark({class:"cm-nonmatchingBracket"});function vg(n){let e=[],t=n.matched?bg:xg;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function ga(n){let e=[],t=n.facet(Wc);for(let i of n.selection.ranges){if(!i.empty)continue;let s=ut(n,i.head,-1,t)||i.head>0&&ut(n,i.head-1,1,t)||t.afterCursor&&(ut(n,i.head,1,t)||i.head<n.doc.length&&ut(n,i.head+1,-1,t));s&&(e=e.concat(t.renderMatch(s,n)))}return I.set(e,!0)}const wg=le.fromClass(class{constructor(n){this.paused=!1,this.decorations=ga(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=ga(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),kg=[wg,yg];function Sg(n={}){return[Wc.of(n),kg]}const Cg=new z;function eo(n,e,t){let i=n.prop(e<0?z.openedBy:z.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function to(n){let e=n.type.prop(Cg);return e?e(n.node):n}function ut(n,e,t,i={}){let s=i.maxScanDistance||Vc,r=i.brackets||Fc,o=de(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=eo(a.type,t,r);if(h&&a.from<a.to){let c=to(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Ag(n,e,t,a,c,h,r)}}return Mg(n,e,t,o,l.type,s,r)}function Ag(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from<c.to){let f=to(c);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(eo(c.type,t,o))h++;else if(eo(c.type,-t,o)){if(h==0){let f=to(c);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}h--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function Mg(n,e,t,i,s,r,o){if(t<0?!e:e==n.doc.length)return null;let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let b=o.indexOf(d[m]);if(!(b<0||i.resolveInner(p+m,1).type!=s))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function ya(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o<e;o++)n.charCodeAt(o)==9?r+=t-r%t:r++;return r}class Hc{constructor(e,t,i,s){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ya(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:ya(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let s=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Tg(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Dg,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Io,mergeTokens:n.mergeTokens!==!1}}function Dg(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const ba=new WeakMap;class Po extends Ke{constructor(e){let t=Cc(e.languageData),i=Tg(e),s,r=new class extends wc{createParse(o,l,a){return new Og(s,o,l,a)}};super(t,r,[],e.name),this.topNode=Pg(t,this),s=this,this.streamParser=i,this.stateAfter=new z({perNode:!0}),this.tokenTable=e.tokenTable?new jc(i.tokenTable):Lg}static define(e){return new Po(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=ba.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let s=Ro(this,e.node.tree,e.node.from,e.node.from,t??e.pos),r,o;if(s?(o=s.state,r=s.pos+1):(o=this.streamParser.startState(e.unit),r=e.node.from),e.pos-r>1e4)return null;for(;r<e.pos;){let a=e.state.doc.lineAt(r),h=Math.min(e.pos,a.to);if(a.length){let c=i?i(a.from):-1,f=new Hc(a.text,e.state.tabSize,e.unit,c<0?void 0:c);for(;f.pos<h-a.from;)qc(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,e.unit);if(h==e.pos)break;r=a.to+1}let l=e.lineAt(e.pos);return i&&t==null&&ba.set(e.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function Ro(n,e,t,i,s){let r=t>=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof te&&a<s&&Ro(n,l,a,i,s);if(h)return h}return null}function zc(n,e,t,i,s){if(s&&t<=0&&i>=e.length)return e;!s&&t==0&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(o<i&&l instanceof te){if(!(a=zc(n,l,t-o,i-o,s)))break;return s?new te(e.type,e.children.slice(0,r).concat(a),e.positions.slice(0,r+1),o+a.length):a}}return null}function Eg(n,e,t,i,s){for(let r of e){let o=r.from+(r.openStart?25:0),l=r.to-(r.openEnd?25:0),a=o<=t&&l>t&&Ro(n,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=zc(n,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:n.streamParser.startState(s?si(s):4),tree:te.empty}}class Og{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Ci.get(),o=s[0].from,{state:l,tree:a}=Eg(e,i,o,this.to,r?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);r&&this.parsedPos<r.viewport.from-1e5&&s.some(h=>h.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(si(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Ci.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
13
13
  `&&(t="");else{let i=t.indexOf(`
14
14
  `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Hc(t,e?e.state.tabSize:4,e?si(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=qc(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=te.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:_g,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new te(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new te(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function qc(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Io=Object.create(null),rn=[De.none],_g=new To(rn),xa=[],va=Object.create(null),$c=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])$c[n]=Kc(Io,e);class jc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),$c)}resolve(e){return e?this.table[e]||(this.table[e]=Kc(this.extra,e)):0}}const Lg=new jc(Io);function lr(n,e){xa.indexOf(n)>-1||(xa.push(n),console.warn(e))}function Kc(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=n[h]||A[h];c?typeof c=="function"?a.length?a=a.map(c):lr(h,`Modifier ${h} used at start of tag`):a.length?lr(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:lr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=va[s];if(r)return r.id;let o=va[s]=De.define({id:rn.length,name:i,props:[Im({[i]:t})]});return rn.push(o),o.id}function Pg(n,e){let t=De.define({id:rn.length,name:"Document",props:[Jt.add(()=>n),Mc.add(()=>i=>e.getIndent(i))],top:!0});return rn.push(t),t}ee.RTL,ee.LTR;const Rg=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=No(n.state,t.from);return i.line?Ig(n):i.block?Ng(n):!1};function Bo(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Ig=Bo(Wg,0),Bg=Bo(Uc,0),Ng=Bo((n,e)=>Uc(n,e,Fg(e)),0);function No(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Vi=50;function Vg(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Vi,i),o=n.sliceDoc(s,s+Vi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Vi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Vi),f=n.sliceDoc(s-Vi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Fg(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function Uc(n,e,t=e.selection.ranges){let i=t.map(r=>No(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Vg(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:h,close:c}=l;r.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:r}}return null}function Wg(n,e,t=e.selection.ranges){let i=[],s=-1;e:for(let{from:r,to:o}of t){let l=i.length,a=1e9,h;for(let c=r;c<=o;){let f=e.doc.lineAt(c);if(h==null&&(h=No(e,f.from).line,!h))continue e;if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;u<f.text.length&&u<a&&(a=u),i.push({line:f,comment:p,token:h,indent:u,empty:d,single:!1})}c=f.to+1}if(a<1e9)for(let c=l;c<i.length;c++)i[c].indent<i[c].line.text.length&&(i[c].indent=a);i.length==l+1&&(i[l].single=!0)}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const io=Ct.define(),Hg=Ct.define(),zg=P.define(),Gc=P.define({combine(n){return mt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),Yc=ve.define({create(){return dt.empty},update(n,e){let t=e.state.facet(Gc),i=e.annotation(io);if(i){let a=Be.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=ys(c,c.length,t.minDepth,a):c=Qc(c,e.startState.selection),new dt(h==0?i.rest:c,h==0?c:i.rest)}let s=e.annotation(Hg);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ae.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Be.fromTransaction(e),o=e.annotation(ae.time),l=e.annotation(ae.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new dt(n.done.map(Be.fromJSON),n.undone.map(Be.fromJSON))}});function qg(n={}){return[Yc,Gc.of(n),_.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Xc:e.inputType=="historyRedo"?no:null;return i?(e.preventDefault(),i(t)):!1}})]}function Is(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Yc,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Xc=Is(0,!1),no=Is(1,!1),$g=Is(0,!0),jg=Is(1,!0);class Be{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Be(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Be(e.changes&&ce.fromJSON(e.changes),[],e.mapped&&pt.fromJSON(e.mapped),e.startSelection&&w.fromJSON(e.startSelection),e.selectionsAfter.map(w.fromJSON))}static fromTransaction(e,t){let i=Ue;for(let s of e.startState.facet(zg)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Be(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Ue)}static selection(e){return new Be(void 0,Ue,void 0,void 0,e)}}function ys(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Kg(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<t.length;){let h=t[a++],c=t[a++];l>=h&&o<=c&&(i=!0)}}),i}function Ug(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Jc(n,e){return n.length?e.length?n.concat(e):n:e}const Ue=[],Gg=200;function Qc(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Gg));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),ys(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Be.selection([e])]}function Yg(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ar(n,e){if(!n.length)return n;let t=n.length,i=Ue;for(;t;){let s=Xg(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Be.selection(i)]:Ue}function Xg(n,e,t){let i=Jc(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Ue,t);if(!n.changes)return Be.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Be(s,V.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Jg=/^(input\.type|delete)($|\.)/;class dt{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new dt(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Jg.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,Kg(l.changes,e.changes))||i=="input.type.compose")?o=ys(o,o.length-1,s.minDepth,new Be(e.changes.compose(l.changes),Jc(V.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Ue)):o=ys(o,o.length,s.minDepth,e),new dt(o,Ue,t,i)}addSelection(e,t,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Ue;return r.length>0&&t-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Ug(r[r.length-1],e)?this:new dt(Qc(this.done,e),this.undone,t,i)}addMapping(e){return new dt(ar(this.done,e),ar(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:io.of({side:e,rest:Yg(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Ue:s.slice(0,s.length-1);return r.mapped&&(l=ar(l,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:io.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}dt.empty=new dt(Ue,Ue);const Qg=[{key:"Mod-z",run:Xc,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:no,preventDefault:!0},{linux:"Ctrl-Shift-z",run:no,preventDefault:!0},{key:"Mod-u",run:$g,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:jg,preventDefault:!0}];function Di(n,e){return w.create(n.ranges.map(e),n.mainIndex)}function et(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function tt({state:n,dispatch:e},t){let i=Di(n.selection,t);return i.eq(n.selection,!0)?!1:(e(et(n,i)),!0)}function Bs(n,e){return w.cursor(e?n.to:n.from)}function Zc(n,e){return tt(n,t=>t.empty?n.moveByChar(t,e):Bs(t,e))}function Se(n){return n.textDirectionAt(n.state.selection.main.head)==ee.LTR}const ef=n=>Zc(n,!Se(n)),tf=n=>Zc(n,Se(n));function nf(n,e){return tt(n,t=>t.empty?n.moveByGroup(t,e):Bs(t,e))}const Zg=n=>nf(n,!Se(n)),e0=n=>nf(n,Se(n));function t0(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Ns(n,e,t){let i=de(n).resolveInner(e.head),s=t?z.closedBy:z.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;t0(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?ut(n,i.from,1):ut(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,w.cursor(l,t?-1:1)}const i0=n=>tt(n,e=>Ns(n.state,e,!Se(n))),n0=n=>tt(n,e=>Ns(n.state,e,Se(n)));function sf(n,e){return tt(n,t=>{if(!t.empty)return Bs(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const rf=n=>sf(n,!1),of=n=>sf(n,!0);function lf(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,s;if(e){for(let r of n.state.facet(_.scrollMargins)){let o=r(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(i=Math.max(o?.bottom,i))}s=n.scrollDOM.clientHeight-t-i}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function af(n,e){let t=lf(n),{state:i}=n,s=Di(i.selection,o=>o.empty?n.moveVertically(o,e,t.height):Bs(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottom<h&&(r=_.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-a}))}return n.dispatch(et(i,s),{effects:r}),!0}const wa=n=>af(n,!1),so=n=>af(n,!0);function $t(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=w.cursor(i.from+r))}return s}const s0=n=>tt(n,e=>$t(n,e,!0)),r0=n=>tt(n,e=>$t(n,e,!1)),o0=n=>tt(n,e=>$t(n,e,!Se(n))),l0=n=>tt(n,e=>$t(n,e,Se(n))),a0=n=>tt(n,e=>w.cursor(n.lineBlockAt(e.head).from,1)),h0=n=>tt(n,e=>w.cursor(n.lineBlockAt(e.head).to,-1));function c0(n,e,t){let i=!1,s=Di(n.selection,r=>{let o=ut(n,r.head,-1)||ut(n,r.head,1)||r.head>0&&ut(n,r.head-1,1)||r.head<n.doc.length&&ut(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return w.cursor(l)});return i?(e(et(n,s)),!0):!1}const f0=({state:n,dispatch:e})=>c0(n,e);function Ye(n,e,t){let i=Di(n.state.selection,s=>{s.undirectional&&s.head>=s.anchor!=e&&(s=w.range(s.head,s.anchor));let r=t(s);return w.range(s.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return i.eq(n.state.selection)?!1:(n.dispatch(et(n.state,i)),!0)}function hf(n,e){return Ye(n,e,t=>n.moveByChar(t,e))}const cf=n=>hf(n,!Se(n)),ff=n=>hf(n,Se(n));function uf(n,e){return Ye(n,e,t=>n.moveByGroup(t,e))}const u0=n=>uf(n,!Se(n)),d0=n=>uf(n,Se(n)),p0=n=>{let e=!Se(n);return Ye(n,e,t=>Ns(n.state,t,e))},m0=n=>{let e=Se(n);return Ye(n,e,t=>Ns(n.state,t,e))};function df(n,e){return Ye(n,e,t=>n.moveVertically(t,e))}const pf=n=>df(n,!1),mf=n=>df(n,!0);function gf(n,e){return Ye(n,e,t=>n.moveVertically(t,e,lf(n).height))}const ka=n=>gf(n,!1),Sa=n=>gf(n,!0),g0=n=>Ye(n,!0,e=>$t(n,e,!0)),y0=n=>Ye(n,!1,e=>$t(n,e,!1)),b0=n=>{let e=!Se(n);return Ye(n,e,t=>$t(n,t,e))},x0=n=>{let e=Se(n);return Ye(n,e,t=>$t(n,t,e))},v0=n=>Ye(n,!1,e=>w.cursor(n.lineBlockAt(e.head).from)),w0=n=>Ye(n,!0,e=>w.cursor(n.lineBlockAt(e.head).to)),Ca=({state:n,dispatch:e})=>(e(et(n,{anchor:0})),!0),Aa=({state:n,dispatch:e})=>(e(et(n,{anchor:n.doc.length})),!0),Ma=({state:n,dispatch:e})=>(e(et(n,{anchor:n.selection.main.anchor,head:0})),!0),Ta=({state:n,dispatch:e})=>(e(et(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),k0=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),S0=({state:n,dispatch:e})=>{let t=Vs(n).map(({from:i,to:s})=>w.undirectionalRange(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:w.create(t),userEvent:"select"})),!0},C0=({state:n,dispatch:e})=>{let t=Di(n.selection,i=>{let s=de(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return w.undirectionalRange(l.from,l.to)}return i});return t.eq(n.selection)?!1:(e(et(n,t)),!0)};function yf(n,e){let{state:t}=n,i=t.selection,s=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to<n.state.doc.length:o.from>0)for(let l=r;;){let a=n.moveVertically(l,e);if(a.head<o.from||a.head>o.to){s.some(h=>h.head==a.head)||s.push(a);break}else{if(a.head==l.head)break;l=a}}}return s.length==i.ranges.length?!1:(n.dispatch(et(t,w.create(s,s.length-1))),!0)}const A0=n=>yf(n,!1),M0=n=>yf(n,!0),T0=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=w.create([t.main]):t.main.empty||(i=w.create([w.cursor(t.main.head)])),i?(e(et(n,i)),!0):!1};function bn(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);a<o?(t="delete.backward",a=Fn(n,a,!1)):a>o&&(t="delete.forward",a=Fn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Fn(n,o,!1),l=Fn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:w.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?_.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Fn(n,e,t){if(n instanceof _)for(let i of n.state.facet(_.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{s<e&&r>e&&(e=t?r:s)});return e}const bf=(n,e,t)=>bn(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]==" ")return s-1;let h=Ti(l,r.tabSize),c=h%si(r)||si(r);for(let f=0;f<c&&l[l.length-1-f]==" ";f++)s--;a=s}else a=ue(o.text,s-o.from,e,e)+o.from,a==s&&o.number!=(e?r.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,s-o.from))&&(a=ue(o.text,a-o.from,!1,!1)+o.from);return a}),ro=n=>bf(n,!1,!0),xf=n=>bf(n,!0,!1),vf=(n,e)=>bn(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ue(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),wf=n=>vf(n,!1),D0=n=>vf(n,!0),E0=n=>bn(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),O0=n=>bn(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),_0=n=>bn(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),L0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:j.of(["",""])},range:w.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},P0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ue(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ue(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:w.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Vs(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function kf(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Vs(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(w.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(w.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:w.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const R0=({state:n,dispatch:e})=>kf(n,e,!1),I0=({state:n,dispatch:e})=>kf(n,e,!0);function Sf(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of Vs(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let s=n.changes(i);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const B0=({state:n,dispatch:e})=>Sf(n,e,!1),N0=({state:n,dispatch:e})=>Sf(n,e,!0),V0=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Vs(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),i=Di(e.selection,s=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function F0(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=de(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(z.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Da=Cf(!1),W0=Cf(!0);function Cf(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&F0(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Ps(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=_o(h,r);for(c==null&&(c=Ti(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let f=["",sn(e,c)];return a&&f.push(sn(e,h.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:j.of(f)},range:w.cursor(r+1+f[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Vo(n,e){let t=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:w.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const H0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Ps(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Vo(n,(r,o,l)=>{let a=_o(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=sn(n,a);(h!=c||l.from<r.from+h.length)&&(t[r.from]=a,o.push({from:r.from,to:r.from+h.length,insert:c}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},z0=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Vo(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Ls)})}),{userEvent:"input.indent"})),!0),q0=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Vo(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Ti(s,n.tabSize),o=0,l=sn(n,Math.max(0,r-si(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:t.from+o,to:t.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),$0=n=>(n.setTabFocusMode(),!0),j0=[{key:"Ctrl-b",run:ef,shift:cf,preventDefault:!0},{key:"Ctrl-f",run:tf,shift:ff},{key:"Ctrl-p",run:rf,shift:pf},{key:"Ctrl-n",run:of,shift:mf},{key:"Ctrl-a",run:a0,shift:v0},{key:"Ctrl-e",run:h0,shift:w0},{key:"Ctrl-d",run:xf},{key:"Ctrl-h",run:ro},{key:"Ctrl-k",run:E0},{key:"Ctrl-Alt-h",run:wf},{key:"Ctrl-o",run:L0},{key:"Ctrl-t",run:P0},{key:"Ctrl-v",run:so}],K0=[{key:"ArrowLeft",run:ef,shift:cf,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Zg,shift:u0,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:o0,shift:b0,preventDefault:!0},{key:"ArrowRight",run:tf,shift:ff,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e0,shift:d0,preventDefault:!0},{mac:"Cmd-ArrowRight",run:l0,shift:x0,preventDefault:!0},{key:"ArrowUp",run:rf,shift:pf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ca,shift:Ma},{mac:"Ctrl-ArrowUp",run:wa,shift:ka},{key:"ArrowDown",run:of,shift:mf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Aa,shift:Ta},{mac:"Ctrl-ArrowDown",run:so,shift:Sa},{key:"PageUp",run:wa,shift:ka},{key:"PageDown",run:so,shift:Sa},{key:"Home",run:r0,shift:y0,preventDefault:!0},{key:"Mod-Home",run:Ca,shift:Ma},{key:"End",run:s0,shift:g0,preventDefault:!0},{key:"Mod-End",run:Aa,shift:Ta},{key:"Enter",run:Da,shift:Da},{key:"Mod-a",run:k0},{key:"Backspace",run:ro,shift:ro,preventDefault:!0},{key:"Delete",run:xf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:wf,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:D0,preventDefault:!0},{mac:"Mod-Backspace",run:O0,preventDefault:!0},{mac:"Mod-Delete",run:_0,preventDefault:!0}].concat(j0.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),U0=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:i0,shift:p0},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:n0,shift:m0},{key:"Alt-ArrowUp",run:R0},{key:"Shift-Alt-ArrowUp",run:B0},{key:"Alt-ArrowDown",run:I0},{key:"Shift-Alt-ArrowDown",run:N0},{key:"Mod-Alt-ArrowUp",run:A0},{key:"Mod-Alt-ArrowDown",run:M0},{key:"Escape",run:T0},{key:"Mod-Enter",run:W0},{key:"Alt-l",mac:"Ctrl-l",run:S0},{key:"Mod-i",run:C0,preventDefault:!0},{key:"Mod-[",run:q0},{key:"Mod-]",run:z0},{key:"Mod-Alt-\\",run:H0},{key:"Shift-Mod-k",run:V0},{key:"Shift-Mod-\\",run:f0},{key:"Mod-/",run:Rg},{key:"Alt-A",mac:"Ctrl-A",run:Bg},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$0}].concat(K0),Ea=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Mi{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Ea(l)):Ea,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Le(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=lo(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=at(e);let s=this.normalize(t);if(s.length)for(let r=0,o=i,l=!0;;r++){let a=s.charCodeAt(r),h=this.match(a,o,l,this.bufferPos+this.bufferStart,r==s.length-1);if(h)return this.value=h,this;if(r==s.length-1)break;l&&r<t.length&&t.charCodeAt(r)==a?o++:l=!1}}}match(e,t,i,s,r){let o=null;for(let l=0;l<this.matches.length;){let a=this.matches[l],h=!1;this.query.charCodeAt(a.index)==e&&(a.index==this.query.length-1?o={from:a.from,to:s,precise:r&&a.precise}:(a.index++,h=!0)),h?l++:this.matches.splice(l,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:t,to:s,precise:i&&r}:this.matches.push({from:t,index:1,precise:i})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(Mi.prototype[Symbol.iterator]=function(){return this});const Af={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Fo="gm"+(/x/.unicode==null?"":"u");class Mf{constructor(e,t,i,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Af,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Tf(e,t,i,s,r);this.re=new RegExp(t,Fo+(i?.ignoreCase?"i":"")),this.test=i?.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=bs(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=bs(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const hr=new WeakMap;class yi{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let s=hr.get(e);if(!s||s.from>=i||s.to<=t){let l=new yi(t,e.sliceString(t,i));return hr.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to<i&&(r+=e.sliceString(s.to,i)),hr.set(e,new yi(o,r)),new yi(t,r.slice(t-o,i-o))}}class Tf{constructor(e,t,i,s,r){this.text=e,this.to=r,this.done=!1,this.value=Af,this.matchPos=bs(e,s),this.re=new RegExp(t,Fo+(i?.ignoreCase?"i":"")),this.test=i?.test,this.flat=yi.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,precise:!0,match:t},this.matchPos=bs(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=yi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Mf.prototype[Symbol.iterator]=Tf.prototype[Symbol.iterator]=function(){return this});function G0(n){try{return new RegExp(n,Fo),!0}catch{return!1}}function bs(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}const Y0=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:s}=im(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return s.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){n.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,f]=o,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),m=w.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[i,_.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},X0={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},J0=P.define({combine(n){return mt(n,X0,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Q0(n){return[ny,iy]}const Z0=I.mark({class:"cm-selectionMatch"}),ey=I.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Oa(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=ne.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=ne.Word)}function ty(n,e,t,i){return n(e.sliceDoc(t,t+1))==ne.Word&&n(e.sliceDoc(i-1,i))==ne.Word}const iy=le.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(J0),{state:t}=n,i=t.selection;if(i.ranges.length>1)return I.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return I.none;let a=t.wordAt(s.head);if(!a)return I.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<e.minSelectionLength||a>200)return I.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Oa(o,t,s.from,s.to)&&ty(o,t,s.from,s.to)))return I.none}else if(r=t.sliceDoc(s.from,s.to),!r)return I.none}let l=[];for(let a of n.visibleRanges){let h=new Mi(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Oa(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(ey.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Z0.range(c,f)),l.length>e.maxMatches))return I.none}}return I.set(l)}},{decorations:n=>n.decorations}),ny=_.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),sy=({state:n,dispatch:e})=>{let{selection:t}=n,i=w.create(t.ranges.map(s=>n.wordAt(s.head)||w.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function ry(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Mi(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Mi(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const oy=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return sy({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=ry(n,i);return s?(e(n.update({selection:n.selection.addRange(w.range(s.from,s.to),!1),effects:_.scrollIntoView(s.to)})),!0):!1},Ei=P.define({combine(n){return mt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new wy(e),scrollToMatch:e=>_.scrollIntoView(e)})}});class Df{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||G0(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
15
- `:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new uy(this):new hy(this)}getCursor(e,t=0,i){let s=e.doc?e:$.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?ai(this,s,t,i):li(this,s,t,i)}}class Ef{constructor(e){this.spec=e}}function ly(n,e,t){return(i,s,r,o)=>{if(t&&!t(i,s,r,o))return!1;let l=i>=o&&s<=o+r.length?r.slice(i-o,s-o):e.doc.sliceString(i,s);return n(l,e,i,s)}}function li(n,e,t,i){let s;return n.wholeWord&&(s=ay(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=ly(n.test,e,s)),new Mi(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),s)}function ay(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(xs(s,t-r))!=ne.Word||e(vs(s,t-r))!=ne.Word)&&(e(vs(s,i-r))!=ne.Word||e(xs(s,i-r))!=ne.Word))}class hy extends Ef{constructor(e){super(e)}nextMatch(e,t,i){let s=li(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=li(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=li(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=li(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=li(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function cy(n,e,t){return(i,s,r)=>(!t||t(i,s,r))&&n(r[0],e,i,s)}function ai(n,e,t,i){let s;return n.wholeWord&&(s=fy(e.charCategorizer(e.selection.main.head))),n.test&&(s=cy(n.test,e,s)),new Mf(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,i)}function xs(n,e){return n.slice(ue(n,e,!1),e)}function vs(n,e){return n.slice(e,ue(n,e))}function fy(n){return(e,t,i)=>!i[0].length||(n(xs(i.input,i.index))!=ne.Word||n(vs(i.input,i.index))!=ne.Word)&&(n(vs(i.input,i.index+i[0].length))!=ne.Word||n(xs(i.input,i.index+i[0].length))!=ne.Word)}class uy extends Ef{nextMatch(e,t,i){let s=ai(this.spec,e,i,e.doc.length).next();return s.done&&(s=ai(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=ai(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+i.slice(s)}return t})}matchAll(e,t){let i=ai(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=ai(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const on=V.define(),Wo=V.define(),vt=ve.define({create(n){return new cr(oo(n).create(),null)},update(n,e){for(let t of e.effects)t.is(on)?n=new cr(t.value.create(),n.panel):t.is(Wo)&&(n=new cr(n.query,t.value?Ho:null));return n},provide:n=>en.from(n,e=>e.panel)});function dy(n){var e;return((e=n.field(vt,!1))===null||e===void 0?void 0:e.panel)!=null}class cr{constructor(e,t){this.query=e,this.panel=t}}const py=I.mark({class:"cm-searchMatch"}),my=I.mark({class:"cm-searchMatch cm-searchMatch-selected"}),gy=le.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(vt))}update(n){let e=n.state.field(vt);(e!=n.startState.field(vt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return I.none;let{view:t}=this,i=new wt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?my:py)})}return i.finish()}},{decorations:n=>n.decorations});function xn(n){return e=>{let t=e.state.field(vt,!1);return t&&t.query.spec.valid?n(e,t):Ss(e)}}const ws=xn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=w.single(i.from,i.to),r=n.state.facet(Ei);return n.dispatch({selection:s,effects:[qo(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),_f(n),!0}),ks=xn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=w.single(s.from,s.to),o=n.state.facet(Ei);return n.dispatch({selection:r,effects:[qo(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),_f(n),!0}),yy=xn((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:w.create(t.map(i=>w.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),by=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Mi(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(w.range(l.value.from,l.value.to))}return e(n.update({selection:w.create(r,o),userEvent:"select.search.matches"})),!0},_a=xn((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==s&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(_.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=n.state.changes(l);return o&&(a=w.single(o.from,o.to).map(f),c.push(qo(n,o)),c.push(t.facet(Ei).scrollToMatch(a.main,n))),n.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),xy=xn((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let s of e.matchAll(n.state,1e9)){let{from:r,to:o,precise:l}=s;l&&t.push({from:r,to:o,insert:e.getReplacement(s)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:_.announce.of(i),userEvent:"input.replace.all"}),!0});function Ho(n){return n.state.facet(Ei).createPanel(n)}function oo(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(Ei);return new Df({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Of(n){let e=Mo(n,Ho);return e&&e.dom.querySelector("[main-field]")}function _f(n){let e=Of(n);e&&e==n.root.activeElement&&e.select()}const Ss=n=>{let e=n.state.field(vt,!1);if(e&&e.panel){let t=Of(n);if(t&&t!=n.root.activeElement){let i=oo(n.state,e.query.spec);i.valid&&n.dispatch({effects:on.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Wo.of(!0),e?on.of(oo(n.state,e.query.spec)):V.appendConfig.of(Sy)]});return!0},zo=n=>{let e=n.state.field(vt,!1);if(!e||!e.panel)return!1;let t=Mo(n,Ho);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Wo.of(!1)}),!0},vy=[{key:"Mod-f",run:Ss,scope:"editor search-panel"},{key:"F3",run:ws,shift:ks,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ws,shift:ks,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:zo,scope:"editor search-panel"},{key:"Mod-Shift-l",run:by},{key:"Mod-Alt-g",run:Y0},{key:"Mod-d",run:oy,preventDefault:!0}];class wy{constructor(e){this.view=e;let t=this.query=e.state.field(vt).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:t.search,placeholder:Ne(e,"Find"),"aria-label":Ne(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:t.replace,placeholder:Ne(e,"Replace"),"aria-label":Ne(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return J("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=J("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>ws(e),[Ne(e,"next")]),i("prev",()=>ks(e),[Ne(e,"previous")]),i("select",()=>yy(e),[Ne(e,"all")]),J("label",null,[this.caseField,Ne(e,"match case")]),J("label",null,[this.reField,Ne(e,"regexp")]),J("label",null,[this.wordField,Ne(e,"by word")]),...e.state.readOnly?[]:[J("br"),this.replaceField,i("replace",()=>_a(e),[Ne(e,"replace")]),i("replaceAll",()=>xy(e),[Ne(e,"replace all")])],J("button",{name:"close",onclick:()=>zo(e),"aria-label":Ne(e,"close"),type:"button"},["×"])])}commit(){let e=new Df({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:on.of(e)}))}keydown(e){up(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ks:ws)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),_a(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(on)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ei).top}}function Ne(n,e){return n.state.phrase(e)}const Wn=30,Hn=/[\s\.,:;?!]/;function qo(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Wn),o=Math.min(s,t+Wn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<Wn;a++)if(!Hn.test(l[a+1])&&Hn.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-Wn;a--)if(!Hn.test(l[a-1])&&Hn.test(l[a])){l=l.slice(0,a);break}}return _.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const ky=_.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Sy=[vt,qt.low(gy),ky];class Lf{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=de(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Pf(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function La(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Cy(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;r<s.length;r++)t[s[r]]=!0}let i=La(e)+La(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Ay(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Cy(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Gb(n,e){return t=>{for(let i=de(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Pa{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ei(n){return n.selection.main.from}function Pf(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const $o=Ct.define();function My(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:w.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Ra=new WeakMap;function Ty(n){if(!Array.isArray(n))return n;let e=Ra.get(n);return e||Ra.set(n,e=Ay(n)),e}const Cs=V.define(),ln=V.define();class Dy{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Le(e,t),s=at(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push(Le(o==r?r.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:r,byWord:o}=this;if(t.length==1){let C=Le(e,0),k=at(C),R=k==e.length?0:-100;if(C!=t[0])if(C==i[0])R+=-200;else return null;return this.ret(R,[0,k])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,h=0;if(l<0){for(let C=0,k=Math.min(e.length,200);C<k&&h<a;){let R=Le(e,C);(R==t[h]||R==i[h])&&(s[h++]=C),C+=at(R)}if(h<a)return null}let c=0,f=0,u=!1,d=0,p=-1,m=-1,g=/[a-z]/.test(e),b=!0;for(let C=0,k=Math.min(e.length,200),R=0;C<k&&f<a;){let M=Le(e,C);l<0&&(c<a&&M==t[c]&&(r[c++]=C),d<a&&(M==t[d]||M==i[d]?(d==0&&(p=C),m=C+1,d++):d=0));let T,D=M<255?M>=48&&M<=57||M>=97&&M<=122?2:M>=65&&M<=90?1:0:(T=lo(M))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!C||D==1&&g||R==0&&D!=0)&&(t[f]==M||i[f]==M&&(u=!0)?o[f++]=C:o.length&&(b=!1)),R=D,C+=at(M)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?at(Le(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class Ey{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const fe=P.define({combine(n){return mt(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Oy,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Ia(e(i),t(i)),optionClass:(e,t)=>i=>Ia(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Ia(n,e){return n?e?n+" "+e:n:e}function Oy(n,e,t,i,s,r){let o=n.textDirection==ee.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))c=Math.max(s.top,Math.min(t.top,s.bottom-m))-e.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?e.right:s.right-e.left)-30);let C=s.bottom-e.bottom;C>=m||C>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,b=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}const jo=V.define();function _y(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;h<r.length;){let c=r[h++],f=r[h++];c>a&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function fr(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class Ly{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(fe);this.optionContent=_y(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=fr(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<h.length){this.applyCompletion(e,h[+f[1]]),a.preventDefault();return}if(a.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&a.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&a.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:jo.of(c)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(fe).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ln.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=fr(r.length,o,e.state.facet(fe).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=fr(t.options.length,t.selected,this.view.state.facet(fe).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>Ie(this.view.state,l,"completion info")):(this.addInfoPane(o,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&Ry(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(fe).positionInfo(this.view,t,s,i,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=e[o],{section:h}=l;if(h){let u=typeof h=="string"?h:h.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Py(n,e){return t=>new Ly(t,n,e)}function Ry(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/s:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function Ba(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Iy(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f=="string"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f=="string"?{name:u}:f)}},o=e.facet(fe);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new Pa(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new Ey(u):new Dy(u);for(let m of c.result.options)if(d=p.match(m.label)){let g=m.displayLabel?f?f(m,d.matched):[]:d.matched,b=d.score+(m.boost||0);if(r(new Pa(m,c.source,g,b)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:C}=m.section;s||(s=Object.create(null)),s[C]=Math.max(b,s[C]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?s[p.name]-s[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of i.sort(u))f-=1e5,c[d.name]=f;for(let d of t){let{section:p}=d.completion;p&&(d.score+=c[typeof p=="string"?p:p.name])}}let l=[],a=null,h=o.compareCompletions;for(let c of t.sort((f,u)=>u.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):Ba(c.completion)>Ba(a)&&(l[l.length-1]=c),a=c.completion}return l}class fi{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new fi(this.options,Na(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=Iy(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(fe).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;c<l.length;c++)if(l[c].completion==h){a=c;break}}return new fi(l,Na(i,a),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:Hy,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new fi(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new fi(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class As{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new As(Fy,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(fe),r=(i.override||t.languageDataAt("autocomplete",ei(t)).map(Ty)).map(a=>(this.active.find(c=>c.source==a)||new Ge(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(Ko));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!By(r,this.active)||l?o=fi.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Ge(a.source,0):a));for(let a of e.effects)a.is(jo)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new As(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Ny:Vy}}function By(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let s=t==n.length,r=i==e.length;if(s||r)return s==r;if(n[t++].result!=e[i++].result)return!1}}const Ny={"aria-autocomplete":"list"},Vy={};function Na(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Fy=[];function Rf(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation($o);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ge{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=Rf(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Ge(s.source,0)),i&4&&s.state==0&&(s=new Ge(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(Cs))s=new Ge(s.source,1,r.value);else if(r.is(ln))s=new Ge(s.source,0);else if(r.is(Ko))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ei(e.state))}}class bi extends Ge{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ei(e.state);if(l>o||!s||t&2&&(ei(e.startState)==this.from||l<this.limit))return new Ge(this.source,t&4?1:0);let a=e.changes.mapPos(this.limit);return Wy(s.validFor,e.state,r,o)?new bi(this.source,this.explicit,a,s,r,o):s.update&&(s=s.update(s,r,o,new Lf(e.state,l,!1)))?new bi(this.source,this.explicit,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:ei(e.state)):new Ge(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new bi(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new Ge(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Wy(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Pf(n,!0).test(s)}const Ko=V.define({map(n,e){return n.map(t=>t.map(e))}}),Pe=ve.define({create(){return As.start()},update(n,e){return n.update(e)},provide:n=>[Ao.from(n,e=>e.tooltip),_.contentAttributes.from(n,e=>e.attrs)]});function Uo(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Pe).active.find(s=>s.source==e.source);return i instanceof bi?(typeof t=="string"?n.dispatch({...My(n.state,t,i.from,i.to),annotations:$o.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const Hy=Py(Pe,Uo);function zn(n,e="option"){return t=>{let i=t.state.field(Pe,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(fe).interactionDelay)return!1;let s=1,r;e=="page"&&(r=uc(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:jo.of(l)}),!0}}const zy=n=>{let e=n.state.field(Pe,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(fe).interactionDelay?!1:Uo(n,e.open.options[e.open.selected])},ur=n=>n.state.field(Pe,!1)?(n.dispatch({effects:Cs.of(!0)}),!0):!1,qy=n=>{let e=n.state.field(Pe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ln.of(null)}),!0)};class $y{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const jy=50,Ky=1e3,Uy=le.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Pe).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Pe),t=n.state.facet(fe);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Pe)==e)return;let i=n.transactions.some(r=>{let o=Rf(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>jy&&Date.now()-o.time>Ky){for(let l of o.context.abortListeners)try{l()}catch(a){Ie(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Cs)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Pe);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fe).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=ei(e),i=new Lf(e,t,n.explicit,this.view),s=new $y(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:ln.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fe).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(fe),i=this.view.state.field(Pe);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=ei(r.updates.length?r.updates[0].startState:this.view.state),a=Math.min(l,r.done.from+(r.active.explicit?0:1)),h=new bi(r.active.source,r.active.explicit,a,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let c of r.updates)h=h.update(c,t);if(h.hasResult()){e.push(h);continue}}let o=i.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ge(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Ko.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Pe,!1);if(e&&e.tooltip&&this.view.state.facet(fe).closeOnBlur){let t=e.open&&uc(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ln.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Cs.of(!1)}),20),this.composing=0}}}),Gy=typeof navigator=="object"&&/Win/.test(navigator.platform),Yy=qt.highest(_.domEventHandlers({keydown(n,e){let t=e.state.field(Pe,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(Gy&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Uo(e,i),!1}})),If=_.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Xy{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class Go{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,be.TrackDel),i=e.mapPos(this.to,1,be.TrackDel);return t==null||i==null?null:new Go(this.field,t,i)}}class Yo{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;f<c;f++)h+=e.facet(Ls);s.push(t+h.length-c),a=h+a.slice(c)}i.push(a),t+=a.length+1}let l=this.fieldPositions.map(a=>new Go(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;l===0&&(l=1e9);let c=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(l!=null?t[f].seq==l:c&&t[f].name==c)&&(h=f);if(h<0){let f=0;for(;f<t.length&&(l==null||t[f].seq!=null&&t[f].seq<l);)f++;t.splice(f,0,{seq:l,name:c}),h=f;for(let u of s)u.field>=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||"").length:2;f.from-=u,f.to-=u}s.push(new Xy(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new Yo(i,s)}}let Jy=I.widget({widget:new class extends gt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Qy=I.mark({class:"cm-snippetField"});class Oi{constructor(e,t){this.ranges=e,this.active=t,this.deco=I.set(e.map(i=>(i.from==i.to?Jy:Qy).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Oi(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const vn=V.define({map(n,e){return n&&n.map(e)}}),Zy=V.define(),an=ve.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(vn))return t.value;if(t.is(Zy)&&n)return new Oi(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>_.decorations.from(n,e=>e?e.deco:I.none)});function Xo(n,e){return w.create(n.filter(t=>t.field==e).map(t=>w.range(t.from,t.to)))}function eb(n){let e=Yo.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:j.of(o)},scrollIntoView:!0,annotations:i?[$o.of(i),ae.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=Xo(l,0)),l.some(c=>c.field>0)){let c=new Oi(l,0),f=h.effects=[vn.of(c)];t.state.field(an,!1)===void 0&&f.push(V.appendConfig.of([an,rb,ob,If]))}t.dispatch(t.state.update(h))}}function Bf(n){return({state:e,dispatch:t})=>{let i=e.field(an,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Xo(i.ranges,s),effects:vn.of(r?null:new Oi(i.ranges,s)),scrollIntoView:!0})),!0}}const tb=({state:n,dispatch:e})=>n.field(an,!1)?(e(n.update({effects:vn.of(null)})),!0):!1,ib=Bf(1),nb=Bf(-1),sb=[{key:"Tab",run:ib,shift:nb},{key:"Escape",run:tb}],Va=P.define({combine(n){return n.length?n[0]:sb}}),rb=qt.highest(mn.compute([Va],n=>n.facet(Va)));function Yb(n,e){return{...e,apply:eb(n)}}const ob=_.domEventHandlers({mousedown(n,e){let t=e.state.field(an,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Xo(t.ranges,s.field),effects:vn.of(t.ranges.some(r=>r.field>s.field)?new Oi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),hn={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Qt=V.define({map(n,e){let t=e.mapPos(n,-1,be.TrackAfter);return t??void 0}}),Jo=new class extends Bt{};Jo.startSide=1;Jo.endSide=-1;const Nf=ve.define({create(){return q.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(Qt)&&(n=n.update({add:[Jo.range(t.value,t.value+1)]}));return n}});function lb(){return[hb,Nf]}const dr="()[]{}<>«»»«[]{}";function Vf(n){for(let e=0;e<dr.length;e+=2)if(dr.charCodeAt(e)==n)return dr.charAt(e+1);return lo(n<128?n:n+1)}function Ff(n,e){return n.languageDataAt("closeBrackets",e)[0]||hn}const ab=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),hb=_.inputHandler.of((n,e,t,i)=>{if((ab?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&at(Le(i,0))==1||e!=s.from||t!=s.to)return!1;let r=ub(n.state,i);return r?(n.dispatch(r),!0):!1}),cb=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Ff(n,n.selection.main.head).brackets||hn.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=db(n.doc,o.head);for(let a of i)if(a==l&&Fs(n.doc,o.head)==Vf(Le(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:w.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},fb=[{key:"Backspace",run:cb}];function ub(n,e){let t=Ff(n,n.selection.main.head),i=t.brackets||hn.brackets;for(let s of i){let r=Vf(Le(s,0));if(e==s)return r==s?gb(n,s,i.indexOf(s+s+s)>-1,t):pb(n,s,r,t.before||hn.before);if(e==r&&Wf(n,n.selection.main.from))return mb(n,s,r)}return null}function Wf(n,e){let t=!1;return n.field(Nf).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Fs(n,e){let t=n.sliceString(e,e+2);return t.slice(0,at(Le(t,0)))}function db(n,e){let t=n.sliceString(e-2,e);return at(Le(t,0))==t.length?t:t.slice(1)}function pb(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Qt.of(o.to+e.length),range:w.range(o.anchor+e.length,o.head+e.length)};let l=Fs(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Qt.of(o.head+e.length),range:w.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function mb(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Fs(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:w.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function gb(n,e,t,i){let s=i.stringPrefixes||hn.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Qt.of(l.to+e.length),range:w.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Fs(n.doc,a),c;if(h==e){if(Fa(n,a))return{changes:{insert:e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)};if(Wf(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:w.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=Wa(n,a-2*e.length,s))>-1&&Fa(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=ne.Word&&Wa(n,a,s)>-1&&!yb(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Fa(n,e){let t=de(n).resolveInner(e+1);return t.parent&&t.from==e}function yb(n,e,t,i){let s=de(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Wa(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=ne.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=ne.Word)return r}return-1}function Hf(n={}){return[Yy,Pe,fe.of(n),Uy,bb,If]}const zf=[{key:"Ctrl-Space",run:ur},{mac:"Alt-`",run:ur},{mac:"Alt-i",run:ur},{key:"Escape",run:qy},{key:"ArrowDown",run:zn(!0)},{key:"ArrowUp",run:zn(!1)},{key:"PageDown",run:zn(!0,"page")},{key:"PageUp",run:zn(!1,"page")},{key:"Enter",run:zy}],bb=qt.highest(mn.computeN([fe],n=>n.facet(fe).defaultKeymap?[zf]:[]));class Ha{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Yt{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(cn).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new wt,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let m,g;if(l.length)m=a,g=l.reduce((k,R)=>Math.min(k,R.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;g=p.to,l.push(p),d++}for(;d<r.length;){let k=r[d];if(k.from==m&&(k.to>k.from||k.to==m))l.push(k),d++,g=Math.min(k.to,g);else{g=Math.min(k.from,g);break}}g=Math.min(g,f);let b=!1;if(l.some(k=>k.from==m&&(k.to==g||g==f))&&(b=m==g,!b&&g-m<10)){let k=m-(c+h.value.length);k>0&&(h.next(k),c=m);for(let R=m;;){if(R>=g){b=!0;break}if(!h.lineBreak&&c+h.value.length>R)break;R=c+h.value.length,c+=h.value.length,h.next()}}let C=_b(l);if(b)o.add(m,m,I.widget({widget:new Tb(C),diagnostics:l.slice()}));else{let k=l.reduce((R,M)=>M.markClass?R+" "+M.markClass:R,"");o.add(m,g,I.mark({class:"cm-lintRange cm-lintRange-"+C+k,diagnostics:l.slice(),inclusiveEnd:l.some(R=>R.to>g)}))}if(a=g,a==f)break;for(let k=0;k<l.length;k++)l[k].to<=a&&l.splice(k--,1)}let u=o.finish();return new Yt(u,t,zt(u))}}function zt(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new Ha(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Ha(i.from,r,i.diagnostic)}}),i}function xb(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(cn).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(qf))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function vb(n,e){return n.field(Fe,!1)?e:e.concat(V.appendConfig.of(Lb))}const qf=V.define(),Qo=V.define(),$f=V.define(),Fe=ve.define({create(){return new Yt(I.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=zt(t,n.selected.diagnostic,r)||zt(t,null,r)}!t.size&&s&&e.state.facet(cn).autoPanel&&(s=null),n=new Yt(t,s,i)}for(let t of e.effects)if(t.is(qf)){let i=e.state.facet(cn).autoPanel?t.value.length?fn.open:null:n.panel;n=Yt.init(t.value,i,e.state)}else t.is(Qo)?n=new Yt(n.diagnostics,t.value?fn.open:null,n.selected):t.is($f)&&(n=new Yt(n.diagnostics,n.panel,t.value));return n},provide:n=>[en.from(n,e=>e.panel),_.decorations.from(n,e=>e.diagnostics)]}),wb=I.mark({class:"cm-lintRange cm-lintRange-active"});function kb(n,e,t){let{diagnostics:i}=n.state.field(Fe),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(e<h||t<0)))return s=c.diagnostics,r=a,o=h,!1});let l=n.state.facet(cn).tooltipFilter;return s&&l&&(s=l(s,n.state)),s?{pos:r,end:o,above:!0,create(){return{dom:Sb(n,s)}}}:null}function Sb(n,e){return J("ul",{class:"cm-tooltip-lint"},e.map(t=>Kf(n,t,!1)))}const Cb=n=>{let e=n.state.field(Fe,!1);(!e||!e.panel)&&n.dispatch({effects:vb(n.state,[Qo.of(!0)])});let t=Mo(n,fn.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},za=n=>{let e=n.state.field(Fe,!1);return!e||!e.panel?!1:(n.dispatch({effects:Qo.of(!1)}),!0)},Ab=n=>{let e=n.state.field(Fe,!1);if(!e)return!1;let t=n.state.selection.main,i=zt(e.diagnostics,null,t.to+1);return!i&&(i=zt(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),em(n,i.from,1,{tooltip:Uf,until:s=>s.docChanged||s.newSelection.main.head<i.from||s.newSelection.main.head>i.to}),!0)},Mb=[{key:"Mod-Shift-m",run:Cb,preventDefault:!0},{key:"F8",run:Ab}],cn=P.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...mt(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qa,tooltipFilter:qa,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function qa(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function jf(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let s=t[i];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Kf(n,e,t){var i;let s=t?jf(e.actions):[];return J("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},J("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=zt(n.state.field(Fe).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),J("u",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?" "+r.markClass:"";return J("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&J("div",{class:"cm-diagnosticSource"},e.source))}class Tb extends gt{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return J("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class $a{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Kf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class fn{constructor(e){this.view=e,this.items=[];let t=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)za(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=jf(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let a=zt(this.view.state.field(Fe).diagnostics,r);a&&r.actions[l].apply(e,a.from,a.to)}}else return;s.preventDefault()}},i=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=J("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=J("div",{class:"cm-panel-lint"},this.list,J("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>za(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Fe).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Fe),i=0,s=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:h})=>{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==c){f=d;break}f<0?(u=new $a(this.view,c),this.items.splice(i,0,u),s=!0):(u=this.items[f],f>i&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new $a(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/h:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Fe),i=zt(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:$f.of(i)})}static open(e){return new fn(e)}}function Db(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function qn(n){return Db(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Eb=_.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qn("#f11")},".cm-lintRange-warning":{backgroundImage:qn("orange")},".cm-lintRange-info":{backgroundImage:qn("#999")},".cm-lintRange-hint":{backgroundImage:qn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Ob(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function _b(n){let e="hint",t=1;for(let i of n){let s=Ob(i.severity);s>t&&(t=s,e=i.severity)}return e}const Uf=Zp(kb,{hideOn:xb}),Lb=[Fe,_.decorations.compute([Fe],n=>{let{selected:e,panel:t}=n.field(Fe);return!e||!t||e.from==e.to?I.none:I.set([wb.range(e.from,e.to)])}),Uf,Eb],Pb=[dm(),gm(),Op(),qg(),ug(),bp(),Cp(),$.allowMultipleSelections.of(!0),Qm(),Nc(gg,{fallback:!0}),Sg(),lb(),Hf(),zp(),jp(),Bp(),Q0(),mn.of([...fb,...U0,...vy,...Qg,...ag,...zf,...Mb])];function S(n){return new qm(Po.define(n))}function Et(n){return x(()=>import("./index-BeipYJv6.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>e.sql({dialect:e[n]}))}const $n=[y.of({name:"C",extensions:["c","h","ino"],load(){return x(()=>import("./index-D6945seh.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>n.cpp())}}),y.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return x(()=>import("./index-D6945seh.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>n.cpp())}}),y.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Et("Cassandra")}}),y.of({name:"CSS",extensions:["css"],load(){return x(()=>import("./index-C8DbmG_l.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>n.css())}}),y.of({name:"Go",extensions:["go"],load(){return x(()=>import("./index-CBs38naL.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>n.go())}}),y.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return x(()=>import("./index-BOhe9vs1.js"),__vite__mapDeps([8,1,6,2,3,4,9])).then(n=>n.html())}}),y.of({name:"Java",extensions:["java"],load(){return x(()=>import("./index-BYYx_GrI.js"),__vite__mapDeps([10,1,2,3,4])).then(n=>n.java())}}),y.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return x(()=>import("./index-DGlioDXJ.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript())}}),y.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return x(()=>import("./index-Tv4HGgSj.js"),__vite__mapDeps([11,8,1,6,2,3,4,9])).then(n=>n.jinja())}}),y.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return x(()=>import("./index-x9JuBH-H.js"),__vite__mapDeps([12,1,2,3,4])).then(n=>n.json())}}),y.of({name:"JSX",extensions:["jsx"],load(){return x(()=>import("./index-DGlioDXJ.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({jsx:!0}))}}),y.of({name:"LESS",extensions:["less"],load(){return x(()=>import("./index-sctirQW0.js"),__vite__mapDeps([13,6,1,2,3,4])).then(n=>n.less())}}),y.of({name:"Liquid",extensions:["liquid"],load(){return x(()=>import("./index-hP6Cb_NE.js"),__vite__mapDeps([14,8,1,6,2,3,4,9])).then(n=>n.liquid())}}),y.of({name:"MariaDB SQL",load(){return Et("MariaSQL")}}),y.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return x(()=>import("./index-B0P8j1yb.js"),__vite__mapDeps([15,8,1,6,2,3,4,9])).then(n=>n.markdown())}}),y.of({name:"MS SQL",load(){return Et("MSSQL")}}),y.of({name:"MySQL",load(){return Et("MySQL")}}),y.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return x(()=>import("./index-C_EAvnDF.js"),__vite__mapDeps([16,1,8,6,2,3,4,9])).then(n=>n.php())}}),y.of({name:"PLSQL",extensions:["pls"],load(){return Et("PLSQL")}}),y.of({name:"PostgreSQL",load(){return Et("PostgreSQL")}}),y.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return x(()=>import("./index-DU209g6d.js"),__vite__mapDeps([17,1,2,3,4])).then(n=>n.python())}}),y.of({name:"Rust",extensions:["rs"],load(){return x(()=>import("./index-BkC7CnZA.js"),__vite__mapDeps([18,1,2,3,4])).then(n=>n.rust())}}),y.of({name:"Sass",extensions:["sass"],load(){return x(()=>import("./index-W6jp3JVA.js"),__vite__mapDeps([19,1,6,2,3,4])).then(n=>n.sass({indented:!0}))}}),y.of({name:"SCSS",extensions:["scss"],load(){return x(()=>import("./index-W6jp3JVA.js"),__vite__mapDeps([19,1,6,2,3,4])).then(n=>n.sass())}}),y.of({name:"SQL",extensions:["sql"],load(){return Et("StandardSQL")}}),y.of({name:"SQLite",load(){return Et("SQLite")}}),y.of({name:"TSX",extensions:["tsx"],load(){return x(()=>import("./index-DGlioDXJ.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),y.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return x(()=>import("./index-DGlioDXJ.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({typescript:!0}))}}),y.of({name:"WebAssembly",extensions:["wat","wast"],load(){return x(()=>import("./index-9ks2AQTi.js"),__vite__mapDeps([20,1,2,3,4])).then(n=>n.wast())}}),y.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return x(()=>import("./index-C_F0LgDO.js"),__vite__mapDeps([21,1,2,3,4])).then(n=>n.xml())}}),y.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return x(()=>import("./index-x2OEXKrc.js"),__vite__mapDeps([22,1,2,3,4])).then(n=>n.yaml())}}),y.of({name:"APL",extensions:["dyalog","apl"],load(){return x(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>S(n.apl))}}),y.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return x(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>S(n.asciiArmor))}}),y.of({name:"ASN.1",extensions:["asn","asn1"],load(){return x(()=>import("./asn1-EdZsLKOL.js"),[]).then(n=>S(n.asn1({})))}}),y.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return x(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>S(n.asterisk))}}),y.of({name:"Brainfuck",extensions:["b","bf"],load(){return x(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>S(n.brainfuck))}}),y.of({name:"Cobol",extensions:["cob","cpy"],load(){return x(()=>import("./cobol-CWcv1MsR.js"),[]).then(n=>S(n.cobol))}}),y.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.csharp))}}),y.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"ClojureScript",extensions:["cljs"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return x(()=>import("./css-BnMrqG3P.js"),[]).then(n=>S(n.gss))}}),y.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return x(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>S(n.cmake))}}),y.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return x(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>S(n.coffeeScript))}}),y.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return x(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>S(n.commonLisp))}}),y.of({name:"Cypher",extensions:["cyp","cypher"],load(){return x(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>S(n.cypher))}}),y.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return x(()=>import("./python-BuPzkPfP.js"),[]).then(n=>S(n.cython))}}),y.of({name:"Crystal",extensions:["cr"],load(){return x(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>S(n.crystal))}}),y.of({name:"D",extensions:["d"],load(){return x(()=>import("./d-pRatUO7H.js"),[]).then(n=>S(n.d))}}),y.of({name:"Dart",extensions:["dart"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.dart))}}),y.of({name:"diff",extensions:["diff","patch"],load(){return x(()=>import("./diff-DbItnlRl.js"),[]).then(n=>S(n.diff))}}),y.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return x(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([23,24])).then(n=>S(n.dockerFile))}}),y.of({name:"DTD",extensions:["dtd"],load(){return x(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>S(n.dtd))}}),y.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return x(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>S(n.dylan))}}),y.of({name:"EBNF",load(){return x(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>S(n.ebnf))}}),y.of({name:"ECL",extensions:["ecl"],load(){return x(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>S(n.ecl))}}),y.of({name:"edn",extensions:["edn"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"Eiffel",extensions:["e"],load(){return x(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>S(n.eiffel))}}),y.of({name:"Elm",extensions:["elm"],load(){return x(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>S(n.elm))}}),y.of({name:"Erlang",extensions:["erl"],load(){return x(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>S(n.erlang))}}),y.of({name:"Esper",load(){return x(()=>import("./sql-D0XecflT.js"),[]).then(n=>S(n.esper))}}),y.of({name:"Factor",extensions:["factor"],load(){return x(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([25,24])).then(n=>S(n.factor))}}),y.of({name:"FCL",load(){return x(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>S(n.fcl))}}),y.of({name:"Forth",extensions:["forth","fth","4th"],load(){return x(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>S(n.forth))}}),y.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return x(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>S(n.fortran))}}),y.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.fSharp))}}),y.of({name:"Gas",extensions:["s"],load(){return x(()=>import("./gas-Bneqetm1.js"),[]).then(n=>S(n.gas))}}),y.of({name:"Gherkin",extensions:["feature"],load(){return x(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>S(n.gherkin))}}),y.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return x(()=>import("./groovy-D9Dt4D0W.js"),[]).then(n=>S(n.groovy))}}),y.of({name:"Haskell",extensions:["hs"],load(){return x(()=>import("./haskell-Cw1EW3IL.js"),[]).then(n=>S(n.haskell))}}),y.of({name:"Haxe",extensions:["hx"],load(){return x(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>S(n.haxe))}}),y.of({name:"HXML",extensions:["hxml"],load(){return x(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>S(n.hxml))}}),y.of({name:"HTTP",load(){return x(()=>import("./http-DBlCnlav.js"),[]).then(n=>S(n.http))}}),y.of({name:"IDL",extensions:["pro"],load(){return x(()=>import("./idl-BEugSyMb.js"),[]).then(n=>S(n.idl))}}),y.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return x(()=>import("./javascript-iXu5QeM3.js"),[]).then(n=>S(n.jsonld))}}),y.of({name:"Julia",extensions:["jl"],load(){return x(()=>import("./julia-DuME0IfC.js"),[]).then(n=>S(n.julia))}}),y.of({name:"Kotlin",extensions:["kt","kts"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.kotlin))}}),y.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return x(()=>import("./livescript-BwQOo05w.js"),[]).then(n=>S(n.liveScript))}}),y.of({name:"Lua",extensions:["lua"],load(){return x(()=>import("./lua-VAEuO923.js"),[]).then(n=>S(n.lua))}}),y.of({name:"mIRC",extensions:["mrc"],load(){return x(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>S(n.mirc))}}),y.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return x(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>S(n.mathematica))}}),y.of({name:"Modelica",extensions:["mo"],load(){return x(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>S(n.modelica))}}),y.of({name:"MUMPS",extensions:["mps"],load(){return x(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>S(n.mumps))}}),y.of({name:"Mbox",extensions:["mbox"],load(){return x(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>S(n.mbox))}}),y.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return x(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>S(n.nginx))}}),y.of({name:"NSIS",extensions:["nsh","nsi"],load(){return x(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([26,24])).then(n=>S(n.nsis))}}),y.of({name:"NTriples",extensions:["nt","nq"],load(){return x(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>S(n.ntriples))}}),y.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.objectiveC))}}),y.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.objectiveCpp))}}),y.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.oCaml))}}),y.of({name:"Octave",extensions:["m"],load(){return x(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>S(n.octave))}}),y.of({name:"Oz",extensions:["oz"],load(){return x(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>S(n.oz))}}),y.of({name:"Pascal",extensions:["p","pas"],load(){return x(()=>import("./pascal--L3eBynH.js"),[]).then(n=>S(n.pascal))}}),y.of({name:"Perl",extensions:["pl","pm"],load(){return x(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>S(n.perl))}}),y.of({name:"Pig",extensions:["pig"],load(){return x(()=>import("./pig-CevX1Tat.js"),[]).then(n=>S(n.pig))}}),y.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return x(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>S(n.powerShell))}}),y.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return x(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>S(n.properties))}}),y.of({name:"ProtoBuf",extensions:["proto"],load(){return x(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>S(n.protobuf))}}),y.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return x(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([27,28])).then(n=>S(n.pug))}}),y.of({name:"Puppet",extensions:["pp"],load(){return x(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>S(n.puppet))}}),y.of({name:"Q",extensions:["q"],load(){return x(()=>import("./q-pXgVlZs6.js"),[]).then(n=>S(n.q))}}),y.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return x(()=>import("./r-B6wPVr8A.js"),[]).then(n=>S(n.r))}}),y.of({name:"RPM Changes",load(){return x(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>S(n.rpmChanges))}}),y.of({name:"RPM Spec",extensions:["spec"],load(){return x(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>S(n.rpmSpec))}}),y.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return x(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>S(n.ruby))}}),y.of({name:"SAS",extensions:["sas"],load(){return x(()=>import("./sas-B4kiWyti.js"),[]).then(n=>S(n.sas))}}),y.of({name:"Scala",extensions:["scala"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.scala))}}),y.of({name:"Scheme",extensions:["scm","ss"],load(){return x(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>S(n.scheme))}}),y.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return x(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>S(n.shell))}}),y.of({name:"Sieve",extensions:["siv","sieve"],load(){return x(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>S(n.sieve))}}),y.of({name:"Smalltalk",extensions:["st"],load(){return x(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>S(n.smalltalk))}}),y.of({name:"Solr",load(){return x(()=>import("./solr-DehyRSwq.js"),[]).then(n=>S(n.solr))}}),y.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.sml))}}),y.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return x(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>S(n.sparql))}}),y.of({name:"Spreadsheet",alias:["excel","formula"],load(){return x(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>S(n.spreadsheet))}}),y.of({name:"Squirrel",extensions:["nut"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.squirrel))}}),y.of({name:"Stylus",extensions:["styl"],load(){return x(()=>import("./stylus-B533Al4x.js"),[]).then(n=>S(n.stylus))}}),y.of({name:"Swift",extensions:["swift"],load(){return x(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>S(n.swift))}}),y.of({name:"sTeX",load(){return x(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>S(n.stex))}}),y.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return x(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>S(n.stex))}}),y.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return x(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>S(n.verilog))}}),y.of({name:"Tcl",extensions:["tcl"],load(){return x(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>S(n.tcl))}}),y.of({name:"Textile",extensions:["textile"],load(){return x(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>S(n.textile))}}),y.of({name:"TiddlyWiki",load(){return x(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>S(n.tiddlyWiki))}}),y.of({name:"Tiki wiki",load(){return x(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>S(n.tiki))}}),y.of({name:"TOML",extensions:["toml"],load(){return x(()=>import("./toml-Bm5Em-hy.js"),[]).then(n=>S(n.toml))}}),y.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return x(()=>import("./troff-wAsdV37c.js"),[]).then(n=>S(n.troff))}}),y.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return x(()=>import("./ttcn-CfJYG6tj.js"),[]).then(n=>S(n.ttcn))}}),y.of({name:"TTCN_CFG",extensions:["cfg"],load(){return x(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(n=>S(n.ttcnCfg))}}),y.of({name:"Turtle",extensions:["ttl"],load(){return x(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>S(n.turtle))}}),y.of({name:"Web IDL",extensions:["webidl"],load(){return x(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>S(n.webIDL))}}),y.of({name:"VB.NET",extensions:["vb"],load(){return x(()=>import("./vb-CmGdzxic.js"),[]).then(n=>S(n.vb))}}),y.of({name:"VBScript",extensions:["vbs"],load(){return x(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>S(n.vbScript))}}),y.of({name:"Velocity",extensions:["vtl"],load(){return x(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>S(n.velocity))}}),y.of({name:"Verilog",extensions:["v"],load(){return x(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>S(n.verilog))}}),y.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return x(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>S(n.vhdl))}}),y.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return x(()=>import("./xquery-DzFWVndE.js"),[]).then(n=>S(n.xQuery))}}),y.of({name:"Yacas",extensions:["ys"],load(){return x(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>S(n.yacas))}}),y.of({name:"Z80",extensions:["z80"],load(){return x(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>S(n.z80))}}),y.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.mscgen))}}),y.of({name:"Xù",extensions:["xu"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.xu))}}),y.of({name:"MsGenny",extensions:["msgenny"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.msgenny))}}),y.of({name:"Vue",extensions:["vue"],load(){return x(()=>import("./index-B8rWDVmR.js"),__vite__mapDeps([29,8,1,6,2,3,4,9])).then(n=>n.vue())}}),y.of({name:"Angular Template",load(){return x(()=>import("./index-eU6FSd70.js"),__vite__mapDeps([30,8,1,6,2,3,4,9])).then(n=>n.angular())}})],Rb={conf:"Properties files",jsonc:"JSON",zsh:"Shell"};function Ib(n){const e=n.replaceAll("\\","/").split("/").at(-1)??n,t=y.matchFilename($n,e)??y.matchFilename($n,e.toLowerCase());if(t!==null)return t;if(/^dockerfile(?:\..+)?$/iu.test(e))return y.matchLanguageName($n,"Dockerfile",!1)??void 0;const i=/\.([^.]+)$/u.exec(e.toLowerCase())?.[1],s=i===void 0?void 0:Rb[i];return s===void 0?void 0:y.matchLanguageName($n,s,!1)??void 0}const jn=1024*1024,Kn=8*1024,Bb=Qf({__name:"CodeFileEditor",props:{modelValue:{},path:{},readOnly:{type:Boolean},targetLine:{},targetColumn:{},codeNavigationEnabled:{type:Boolean}},emits:["viewed","update:modelValue","symbols","navigate-symbol","navigate-file"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=nu(),o=new It,l=new It,a=new It,h=new It;let c,f=!1;function u(v){if(document.visibilityState!=="visible"||!document.hasFocus()||v.dom.getClientRects().length===0)return;const E=v.state.doc.lineAt(v.viewport.from).number;s("viewed",{startLine:E,endLine:Math.min(E+79,v.state.doc.lineAt(v.viewport.to).number)})}let d,p,m,g=0;const b=new TextEncoder,C=I.mark({class:"cm-code-navigation-target"}),k=I.line({class:"cm-code-navigation-destination"}),R=_.theme({"&":{color:"var(--mar-editor-foreground)",backgroundColor:"var(--mar-editor-background)"},".cm-content":{caretColor:"var(--mar-editor-cursor)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--mar-editor-cursor)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionLayer .cm-selectionBackground":{background:"var(--mar-editor-selection) !important"},".cm-content ::selection":{backgroundColor:"transparent"},".cm-activeLine":{backgroundColor:"var(--mar-editor-active-line)",boxShadow:"inset 2px 0 0 var(--mar-editor-active-line-indicator)"},".cm-gutters":{color:"var(--mar-editor-gutter-foreground)",backgroundColor:"var(--mar-editor-gutter-background)",borderRightColor:"var(--mar-editor-border)"},".cm-activeLineGutter":{backgroundColor:"var(--mar-editor-active-line)"},".cm-selectionMatch":{backgroundColor:"var(--mar-editor-selection-match)",outline:"1px solid var(--mar-editor-selection-match-border)",outlineOffset:"-1px",borderRadius:"2px"},".cm-selectionMatch.cm-selectionMatch-main":{color:"var(--mar-editor-selection-match-main-foreground)",backgroundColor:"var(--mar-editor-selection-match-main)",outlineColor:"var(--mar-editor-selection-match-main-border)"},".cm-searchMatch":{backgroundColor:"var(--mar-editor-search-match)",outline:"1px solid var(--mar-editor-search-match-border)",outlineOffset:"-1px",borderRadius:"2px"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--mar-editor-search-match-active)",outlineColor:"var(--mar-editor-search-match-active-border)"}}),M=yn.define([{tag:[A.keyword,A.modifier],color:"var(--mar-editor-keyword)"},{tag:A.controlKeyword,color:"var(--mar-editor-control-keyword)"},{tag:[A.name,A.variableName],color:"var(--mar-editor-variable)"},{tag:[A.propertyName,A.attributeName],color:"var(--mar-editor-property)"},{tag:[A.function(A.variableName),A.function(A.propertyName)],color:"var(--mar-editor-function)"},{tag:[A.typeName,A.className,A.namespace],color:"var(--mar-editor-type)"},{tag:[A.string,A.special(A.string)],color:"var(--mar-editor-string)"},{tag:[A.number,A.bool,A.null],color:"var(--mar-editor-number)"},{tag:[A.comment,A.docComment],color:"var(--mar-editor-comment)"},{tag:A.regexp,color:"var(--mar-editor-regexp)"},{tag:[A.operator,A.punctuation],color:"var(--mar-editor-operator)"},{tag:A.invalid,color:"var(--mar-editor-invalid)"},{tag:A.heading,color:"var(--mar-editor-heading)",fontWeight:"600"},{tag:A.link,color:"var(--mar-editor-link)",textDecoration:"underline"}]);function T(v,E,N){const Y=++g,se=N>jn?void 0:Ib(E);v.dispatch({effects:l.reconfigure(se?.support??[])}),!(se===void 0||se.support!==void 0)&&se.load().then(jt=>{c!==v||Y!==g||v.dispatch({effects:l.reconfigure(jt)})},()=>{})}function D(v){if(v.state.doc.length>jn)return null;const E=v.matchBefore(/[\p{L}\p{N}_$-]*/u);if(E===null||E.from===E.to&&!v.explicit)return null;const N=new Set(v.state.doc.toString().match(/[\p{L}_$][\p{L}\p{N}_$-]{2,}/gu)??[]);return{from:E.from,options:[...N].slice(0,300).map(Y=>({label:Y,type:"text"}))}}function F(v){if(v.doc.length>jn)return[];const E=[],N=de(v).cursor(),Y=/(?:Declaration|Definition|Class|Interface|Function|Method|Heading|Section|TypeAlias|Enum)/u;do{if(!Y.test(N.name)||N.to<=N.from)continue;const me=v.sliceDoc(N.from,Math.min(N.to,N.from+240)),Li=/(?:class|interface|function|def|fn|func|type|enum|const|let|var)?\s*([\p{L}_$][\p{L}\p{N}_$-]*)/u.exec(me)?.[1];let Tt=0;for(let Dt=N.node.parent;Dt!==null;Dt=Dt.parent)Tt+=1;Li!==void 0&&!E.some(Dt=>Dt.from===N.from)&&E.push({name:Li,kind:N.name,from:N.from,depth:Math.max(0,Tt-1)})}while(N.next());const se=v.doc.toString(),jt=/^(\s*)(?:#{1,6}\s+(.+)|(?:export\s+)?(?:async\s+)?(?:class|interface|function|def|fn|func|type|enum)\s+([\p{L}_$][\p{L}\p{N}_$-]*)|(?:function\s+)?([\p{L}_$][\p{L}\p{N}_$-]*)\s*\(\)\s*\{)/gmu;for(const me of se.matchAll(jt)){const Mt=(me[2]??me[3]??me[4])?.trim();Mt===void 0||me.index===void 0||E.some(Li=>Li.from===me.index)||E.push({name:Mt,kind:me[2]===void 0?"Declaration":"Heading",from:me.index+me[1].length,depth:me[2]===void 0?Math.min(4,Math.floor(me[1].length/2)):0})}return E.sort((me,Mt)=>me.from-Mt.from),E.slice(0,1e3)}function H(){c!==void 0&&s("symbols",F(c.state))}function G(){d!==void 0&&clearTimeout(d),d=setTimeout(()=>{d=void 0,H()},120)}function W(v,E){if(c===void 0||v<1||v>c.state.doc.lines)return;const N=c.state.doc.line(v),Y=E===void 0?N.from:Math.min(N.to,N.from+Math.max(0,E-1));m!==void 0&&clearTimeout(m),c.dispatch({selection:{anchor:Y},effects:[_.scrollIntoView(Y,{y:"center"}),h.reconfigure(_.decorations.of(I.set([k.range(Y)])))]}),m=setTimeout(()=>{c!==void 0&&c.dispatch({effects:h.reconfigure([])}),m=void 0},1800),c.focus()}function B(v){c!==void 0&&(c.dispatch({selection:{anchor:v},effects:_.scrollIntoView(v,{y:"center"})}),c.focus())}function U(){if(c===void 0)return;const v=c.state.selection.main.head,E=c.state.doc.lineAt(v);return{line:E.number,column:v-E.from+1}}function K(){if(c===void 0)return"";const v=c.state.selection.main;return c.state.doc.sliceString(v.from,v.to)}function X(v){if(c===void 0||i.readOnly)return;const E=c.state.selection.main;c.dispatch({changes:{from:E.from,to:E.to,insert:v},selection:{anchor:E.from+v.length}}),c.focus()}function pe(v){if(c===void 0)return;const E=c.state.doc.lineAt(Math.max(0,Math.min(v,c.state.doc.length)));return{line:E.number,column:Math.max(0,v-E.from)+1}}function Ce(){c!==void 0&&(Ss(c),Zo())}function We(v,E){const N=Math.max(0,E-Kn),Y=Math.min(v.state.doc.length,E+Kn),se=he(v.state.sliceDoc(N,Y),E-N);return{text:se.text,position:se.position,from:N+se.from}}function he(v,E){if(b.encode(v).byteLength<=Kn)return{text:v,position:E,from:0};let N=E,Y=E;N>0&&_e(v.charCodeAt(N))&&(N-=1),Y<v.length&&_e(v.charCodeAt(Y))&&(Y+=1);let se=0,jt=!0;for(;N>0||Y<v.length;){const me=N>0?Ee(v,N):void 0,Mt=Y<v.length?Xe(v,Y):void 0,Tt=(jt?[me,Mt]:[Mt,me]).find(Dt=>Dt!==void 0&&se+b.encode(Dt.text).byteLength<=Kn);if(Tt===void 0)break;Tt.direction==="before"?N=Tt.offset:Y=Tt.offset,se+=b.encode(Tt.text).byteLength,jt=!jt}return{text:v.slice(N,Y),position:E-N,from:N}}function Ee(v,E){const N=E-(E>1&&_e(v.charCodeAt(E-1))?2:1);return{direction:"before",offset:N,text:v.slice(N,E)}}function Xe(v,E){const N=E+(Oe(v.charCodeAt(E))?2:1);return{direction:"after",offset:N,text:v.slice(E,N)}}function Oe(v){return v>=55296&&v<=56319}function _e(v){return v>=56320&&v<=57343}function it(v,E){if(!v.ctrlKey&&!v.metaKey)return;const N=E.posAtCoords({x:v.clientX,y:v.clientY});if(N===null)return;const Y=We(E,N),se=ru(i.path,Y.text,Y.position);if(se!==void 0)return se.kind==="symbol"?{kind:"symbol",value:se.value,from:Y.from+se.from,to:Y.from+se.to}:{kind:"reference",reference:se.reference,sourceContext:{text:Y.text,position:Y.position},from:Y.from+se.from,to:Y.from+se.to}}function At(v){return v===void 0?[]:_.decorations.of(I.set([C.range(v.from,v.to)]))}function He(v,E){p?.from===E?.from&&p?.to===E?.to||(p=E,v.dispatch({effects:a.reconfigure(At(E))}))}function _i(v){!v.ctrlKey&&!v.metaKey&&c!==void 0&&He(c,void 0)}function Gf(v,E){if(!i.codeNavigationEnabled)return!1;const N=it(v,E);return N===void 0?!1:(v.preventDefault(),v.stopPropagation(),E.dispatch({selection:{anchor:E.posAtCoords({x:v.clientX,y:v.clientY})??N.from}}),N.kind==="reference"?s("navigate-file",N):s("navigate-symbol",N.value),!0)}function Yf(v,E){if(!i.codeNavigationEnabled)return He(E,void 0),!1;const N=it(v,E);return He(E,N),!1}function Zo(){queueMicrotask(()=>{const v=c?.dom.querySelector(".cm-search");v?.setAttribute("role","search"),v?.setAttribute("aria-label",ze("inlineFind.label"))})}function el(v){return[_.editable.of(!v),$.readOnly.of(v)]}function Xf(){return c===void 0?!1:(c.dispatch({selection:{anchor:0,head:c.state.doc.length},scrollIntoView:!0}),c.focus(),!0)}function Jf(){return c?.hasFocus??!1}return e({goTo:B,scrollToLine:W,cursorPosition:U,positionAt:pe,selectedText:K,insertText:X,openFind:Ce,isFindOpen:()=>c!==void 0&&dy(c.state),closeFind:()=>{c!==void 0&&zo(c)},selectAll:Xf,isFocused:Jf,focus:()=>c?.focus()}),Zf(()=>{r.value!==void 0&&(c=new _({parent:r.value,state:$.create({doc:i.modelValue,extensions:[Pb,R,Nc(M),l.of([]),o.of(el(i.readOnly)),a.of([]),h.of([]),$.phrases.of({Find:ze("inlineFind.placeholder"),Replace:ze("inlineFind.replacePlaceholder"),next:ze("inlineFind.next"),previous:ze("inlineFind.previous"),all:ze("inlineFind.selectAll"),"match case":ze("inlineFind.matchCase"),regexp:ze("inlineFind.regexp"),"by word":ze("inlineFind.wholeWord"),replace:ze("inlineFind.replace"),"replace all":ze("inlineFind.replaceAll"),close:ze("inlineFind.close")}),Hf(),$.languageData.of(()=>[{autocomplete:D}]),mn.of([{key:"Mod-h",run:Ss}]),_.domEventHandlers({mousedown:(v,E)=>Gf(v,E),mousemove:(v,E)=>Yf(v,E),mouseleave:(v,E)=>(He(E,void 0),!1),keydown:(v,E)=>(!v.ctrlKey&&!v.metaKey&&He(E,void 0),!1),keyup:(v,E)=>(!v.ctrlKey&&!v.metaKey&&He(E,void 0),!1),blur:(v,E)=>(He(E,void 0),!1)}),_.updateListener.of(v=>{(v.viewportChanged||v.selectionSet||v.focusChanged)&&u(v.view),v.docChanged&&!f&&s("update:modelValue",v.state.doc.toString()),v.docChanged?G():v.transactions.some(E=>E.reconfigured)&&H(),Zo()})]})}),T(c,i.path,i.modelValue.length),c.requestMeasure({read:u}),window.addEventListener("keyup",_i,{capture:!0}),i.targetLine!==void 0&&W(i.targetLine,i.targetColumn))}),Pi(()=>i.modelValue,v=>{c===void 0||v===c.state.doc.toString()||(f=!0,c.dispatch({changes:{from:0,to:c.state.doc.length,insert:v}}),f=!1)}),Pi(()=>i.readOnly,v=>c?.dispatch({effects:o.reconfigure(el(v))})),Pi(()=>i.path,v=>{c!==void 0&&T(c,v,c.state.doc.length)}),Pi(()=>i.modelValue.length>jn,()=>{c!==void 0&&T(c,i.path,c.state.doc.length)}),Pi(()=>[i.targetLine,i.targetColumn],([v,E])=>{v!==void 0&&W(v,E)}),eu(()=>{g+=1,d!==void 0&&clearTimeout(d),m!==void 0&&clearTimeout(m),window.removeEventListener("keyup",_i,{capture:!0}),c?.destroy(),c=void 0}),(v,E)=>(tu(),iu("div",{ref_key:"host",ref:r,class:"code-file-editor"},null,512))}}),Nb=su(Bb,[["__scopeId","data-v-6ae84d6d"]]),Xb=Object.freeze(Object.defineProperty({__proto__:null,default:Nb},Symbol.toStringTag,{value:"Module"}));export{Ls as A,Zm as B,Lf as C,ym as D,_ as E,$ as F,Jt as G,y as H,Z as I,Ci as J,Xb as K,Qr as L,To as N,wc as P,te as T,qm as a,Gb as b,Kb as c,Ay as d,de as e,eg as f,De as g,z as h,Mc as i,w as j,$b as k,Ub as l,jb as m,Hb as n,Yb as o,zb as p,Cg as q,Wm as r,Im as s,A as t,Cc as u,qe as v,Ti as w,qt as x,mn as y,Ke as z};
15
+ `:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new uy(this):new hy(this)}getCursor(e,t=0,i){let s=e.doc?e:$.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?ai(this,s,t,i):li(this,s,t,i)}}class Ef{constructor(e){this.spec=e}}function ly(n,e,t){return(i,s,r,o)=>{if(t&&!t(i,s,r,o))return!1;let l=i>=o&&s<=o+r.length?r.slice(i-o,s-o):e.doc.sliceString(i,s);return n(l,e,i,s)}}function li(n,e,t,i){let s;return n.wholeWord&&(s=ay(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=ly(n.test,e,s)),new Mi(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),s)}function ay(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(xs(s,t-r))!=ne.Word||e(vs(s,t-r))!=ne.Word)&&(e(vs(s,i-r))!=ne.Word||e(xs(s,i-r))!=ne.Word))}class hy extends Ef{constructor(e){super(e)}nextMatch(e,t,i){let s=li(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=li(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=li(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=li(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=li(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function cy(n,e,t){return(i,s,r)=>(!t||t(i,s,r))&&n(r[0],e,i,s)}function ai(n,e,t,i){let s;return n.wholeWord&&(s=fy(e.charCategorizer(e.selection.main.head))),n.test&&(s=cy(n.test,e,s)),new Mf(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,i)}function xs(n,e){return n.slice(ue(n,e,!1),e)}function vs(n,e){return n.slice(e,ue(n,e))}function fy(n){return(e,t,i)=>!i[0].length||(n(xs(i.input,i.index))!=ne.Word||n(vs(i.input,i.index))!=ne.Word)&&(n(vs(i.input,i.index+i[0].length))!=ne.Word||n(xs(i.input,i.index+i[0].length))!=ne.Word)}class uy extends Ef{nextMatch(e,t,i){let s=ai(this.spec,e,i,e.doc.length).next();return s.done&&(s=ai(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=ai(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+i.slice(s)}return t})}matchAll(e,t){let i=ai(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=ai(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const on=V.define(),Wo=V.define(),vt=ve.define({create(n){return new cr(oo(n).create(),null)},update(n,e){for(let t of e.effects)t.is(on)?n=new cr(t.value.create(),n.panel):t.is(Wo)&&(n=new cr(n.query,t.value?Ho:null));return n},provide:n=>en.from(n,e=>e.panel)});function dy(n){var e;return((e=n.field(vt,!1))===null||e===void 0?void 0:e.panel)!=null}class cr{constructor(e,t){this.query=e,this.panel=t}}const py=I.mark({class:"cm-searchMatch"}),my=I.mark({class:"cm-searchMatch cm-searchMatch-selected"}),gy=le.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(vt))}update(n){let e=n.state.field(vt);(e!=n.startState.field(vt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return I.none;let{view:t}=this,i=new wt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?my:py)})}return i.finish()}},{decorations:n=>n.decorations});function xn(n){return e=>{let t=e.state.field(vt,!1);return t&&t.query.spec.valid?n(e,t):Ss(e)}}const ws=xn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=w.single(i.from,i.to),r=n.state.facet(Ei);return n.dispatch({selection:s,effects:[qo(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),_f(n),!0}),ks=xn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=w.single(s.from,s.to),o=n.state.facet(Ei);return n.dispatch({selection:r,effects:[qo(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),_f(n),!0}),yy=xn((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:w.create(t.map(i=>w.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),by=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Mi(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(w.range(l.value.from,l.value.to))}return e(n.update({selection:w.create(r,o),userEvent:"select.search.matches"})),!0},_a=xn((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==s&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(_.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=n.state.changes(l);return o&&(a=w.single(o.from,o.to).map(f),c.push(qo(n,o)),c.push(t.facet(Ei).scrollToMatch(a.main,n))),n.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),xy=xn((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let s of e.matchAll(n.state,1e9)){let{from:r,to:o,precise:l}=s;l&&t.push({from:r,to:o,insert:e.getReplacement(s)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:_.announce.of(i),userEvent:"input.replace.all"}),!0});function Ho(n){return n.state.facet(Ei).createPanel(n)}function oo(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(Ei);return new Df({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Of(n){let e=Mo(n,Ho);return e&&e.dom.querySelector("[main-field]")}function _f(n){let e=Of(n);e&&e==n.root.activeElement&&e.select()}const Ss=n=>{let e=n.state.field(vt,!1);if(e&&e.panel){let t=Of(n);if(t&&t!=n.root.activeElement){let i=oo(n.state,e.query.spec);i.valid&&n.dispatch({effects:on.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Wo.of(!0),e?on.of(oo(n.state,e.query.spec)):V.appendConfig.of(Sy)]});return!0},zo=n=>{let e=n.state.field(vt,!1);if(!e||!e.panel)return!1;let t=Mo(n,Ho);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Wo.of(!1)}),!0},vy=[{key:"Mod-f",run:Ss,scope:"editor search-panel"},{key:"F3",run:ws,shift:ks,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ws,shift:ks,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:zo,scope:"editor search-panel"},{key:"Mod-Shift-l",run:by},{key:"Mod-Alt-g",run:Y0},{key:"Mod-d",run:oy,preventDefault:!0}];class wy{constructor(e){this.view=e;let t=this.query=e.state.field(vt).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:t.search,placeholder:Ne(e,"Find"),"aria-label":Ne(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:t.replace,placeholder:Ne(e,"Replace"),"aria-label":Ne(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return J("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=J("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>ws(e),[Ne(e,"next")]),i("prev",()=>ks(e),[Ne(e,"previous")]),i("select",()=>yy(e),[Ne(e,"all")]),J("label",null,[this.caseField,Ne(e,"match case")]),J("label",null,[this.reField,Ne(e,"regexp")]),J("label",null,[this.wordField,Ne(e,"by word")]),...e.state.readOnly?[]:[J("br"),this.replaceField,i("replace",()=>_a(e),[Ne(e,"replace")]),i("replaceAll",()=>xy(e),[Ne(e,"replace all")])],J("button",{name:"close",onclick:()=>zo(e),"aria-label":Ne(e,"close"),type:"button"},["×"])])}commit(){let e=new Df({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:on.of(e)}))}keydown(e){up(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ks:ws)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),_a(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(on)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ei).top}}function Ne(n,e){return n.state.phrase(e)}const Wn=30,Hn=/[\s\.,:;?!]/;function qo(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Wn),o=Math.min(s,t+Wn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<Wn;a++)if(!Hn.test(l[a+1])&&Hn.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-Wn;a--)if(!Hn.test(l[a-1])&&Hn.test(l[a])){l=l.slice(0,a);break}}return _.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const ky=_.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Sy=[vt,qt.low(gy),ky];class Lf{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=de(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Pf(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function La(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Cy(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;r<s.length;r++)t[s[r]]=!0}let i=La(e)+La(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Ay(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Cy(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Gb(n,e){return t=>{for(let i=de(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Pa{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ei(n){return n.selection.main.from}function Pf(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const $o=Ct.define();function My(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:w.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Ra=new WeakMap;function Ty(n){if(!Array.isArray(n))return n;let e=Ra.get(n);return e||Ra.set(n,e=Ay(n)),e}const Cs=V.define(),ln=V.define();class Dy{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Le(e,t),s=at(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push(Le(o==r?r.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:r,byWord:o}=this;if(t.length==1){let C=Le(e,0),k=at(C),R=k==e.length?0:-100;if(C!=t[0])if(C==i[0])R+=-200;else return null;return this.ret(R,[0,k])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,h=0;if(l<0){for(let C=0,k=Math.min(e.length,200);C<k&&h<a;){let R=Le(e,C);(R==t[h]||R==i[h])&&(s[h++]=C),C+=at(R)}if(h<a)return null}let c=0,f=0,u=!1,d=0,p=-1,m=-1,g=/[a-z]/.test(e),b=!0;for(let C=0,k=Math.min(e.length,200),R=0;C<k&&f<a;){let M=Le(e,C);l<0&&(c<a&&M==t[c]&&(r[c++]=C),d<a&&(M==t[d]||M==i[d]?(d==0&&(p=C),m=C+1,d++):d=0));let T,D=M<255?M>=48&&M<=57||M>=97&&M<=122?2:M>=65&&M<=90?1:0:(T=lo(M))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!C||D==1&&g||R==0&&D!=0)&&(t[f]==M||i[f]==M&&(u=!0)?o[f++]=C:o.length&&(b=!1)),R=D,C+=at(M)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?at(Le(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class Ey{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const fe=P.define({combine(n){return mt(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Oy,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Ia(e(i),t(i)),optionClass:(e,t)=>i=>Ia(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Ia(n,e){return n?e?n+" "+e:n:e}function Oy(n,e,t,i,s,r){let o=n.textDirection==ee.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))c=Math.max(s.top,Math.min(t.top,s.bottom-m))-e.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?e.right:s.right-e.left)-30);let C=s.bottom-e.bottom;C>=m||C>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,b=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}const jo=V.define();function _y(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;h<r.length;){let c=r[h++],f=r[h++];c>a&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function fr(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class Ly{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(fe);this.optionContent=_y(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=fr(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<h.length){this.applyCompletion(e,h[+f[1]]),a.preventDefault();return}if(a.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&a.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&a.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:jo.of(c)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(fe).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ln.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=fr(r.length,o,e.state.facet(fe).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=fr(t.options.length,t.selected,this.view.state.facet(fe).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>Ie(this.view.state,l,"completion info")):(this.addInfoPane(o,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&Ry(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(fe).positionInfo(this.view,t,s,i,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=e[o],{section:h}=l;if(h){let u=typeof h=="string"?h:h.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Py(n,e){return t=>new Ly(t,n,e)}function Ry(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/s:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function Ba(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Iy(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f=="string"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f=="string"?{name:u}:f)}},o=e.facet(fe);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new Pa(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new Ey(u):new Dy(u);for(let m of c.result.options)if(d=p.match(m.label)){let g=m.displayLabel?f?f(m,d.matched):[]:d.matched,b=d.score+(m.boost||0);if(r(new Pa(m,c.source,g,b)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:C}=m.section;s||(s=Object.create(null)),s[C]=Math.max(b,s[C]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?s[p.name]-s[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of i.sort(u))f-=1e5,c[d.name]=f;for(let d of t){let{section:p}=d.completion;p&&(d.score+=c[typeof p=="string"?p:p.name])}}let l=[],a=null,h=o.compareCompletions;for(let c of t.sort((f,u)=>u.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):Ba(c.completion)>Ba(a)&&(l[l.length-1]=c),a=c.completion}return l}class fi{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new fi(this.options,Na(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=Iy(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(fe).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;c<l.length;c++)if(l[c].completion==h){a=c;break}}return new fi(l,Na(i,a),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:Hy,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new fi(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new fi(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class As{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new As(Fy,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(fe),r=(i.override||t.languageDataAt("autocomplete",ei(t)).map(Ty)).map(a=>(this.active.find(c=>c.source==a)||new Ge(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(Ko));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!By(r,this.active)||l?o=fi.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Ge(a.source,0):a));for(let a of e.effects)a.is(jo)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new As(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Ny:Vy}}function By(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let s=t==n.length,r=i==e.length;if(s||r)return s==r;if(n[t++].result!=e[i++].result)return!1}}const Ny={"aria-autocomplete":"list"},Vy={};function Na(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Fy=[];function Rf(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation($o);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ge{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=Rf(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Ge(s.source,0)),i&4&&s.state==0&&(s=new Ge(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(Cs))s=new Ge(s.source,1,r.value);else if(r.is(ln))s=new Ge(s.source,0);else if(r.is(Ko))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ei(e.state))}}class bi extends Ge{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ei(e.state);if(l>o||!s||t&2&&(ei(e.startState)==this.from||l<this.limit))return new Ge(this.source,t&4?1:0);let a=e.changes.mapPos(this.limit);return Wy(s.validFor,e.state,r,o)?new bi(this.source,this.explicit,a,s,r,o):s.update&&(s=s.update(s,r,o,new Lf(e.state,l,!1)))?new bi(this.source,this.explicit,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:ei(e.state)):new Ge(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new bi(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new Ge(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Wy(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Pf(n,!0).test(s)}const Ko=V.define({map(n,e){return n.map(t=>t.map(e))}}),Pe=ve.define({create(){return As.start()},update(n,e){return n.update(e)},provide:n=>[Ao.from(n,e=>e.tooltip),_.contentAttributes.from(n,e=>e.attrs)]});function Uo(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Pe).active.find(s=>s.source==e.source);return i instanceof bi?(typeof t=="string"?n.dispatch({...My(n.state,t,i.from,i.to),annotations:$o.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const Hy=Py(Pe,Uo);function zn(n,e="option"){return t=>{let i=t.state.field(Pe,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(fe).interactionDelay)return!1;let s=1,r;e=="page"&&(r=uc(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:jo.of(l)}),!0}}const zy=n=>{let e=n.state.field(Pe,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(fe).interactionDelay?!1:Uo(n,e.open.options[e.open.selected])},ur=n=>n.state.field(Pe,!1)?(n.dispatch({effects:Cs.of(!0)}),!0):!1,qy=n=>{let e=n.state.field(Pe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ln.of(null)}),!0)};class $y{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const jy=50,Ky=1e3,Uy=le.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Pe).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Pe),t=n.state.facet(fe);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Pe)==e)return;let i=n.transactions.some(r=>{let o=Rf(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>jy&&Date.now()-o.time>Ky){for(let l of o.context.abortListeners)try{l()}catch(a){Ie(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Cs)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Pe);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fe).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=ei(e),i=new Lf(e,t,n.explicit,this.view),s=new $y(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:ln.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fe).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(fe),i=this.view.state.field(Pe);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=ei(r.updates.length?r.updates[0].startState:this.view.state),a=Math.min(l,r.done.from+(r.active.explicit?0:1)),h=new bi(r.active.source,r.active.explicit,a,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let c of r.updates)h=h.update(c,t);if(h.hasResult()){e.push(h);continue}}let o=i.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ge(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Ko.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Pe,!1);if(e&&e.tooltip&&this.view.state.facet(fe).closeOnBlur){let t=e.open&&uc(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ln.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Cs.of(!1)}),20),this.composing=0}}}),Gy=typeof navigator=="object"&&/Win/.test(navigator.platform),Yy=qt.highest(_.domEventHandlers({keydown(n,e){let t=e.state.field(Pe,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(Gy&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Uo(e,i),!1}})),If=_.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Xy{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class Go{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,be.TrackDel),i=e.mapPos(this.to,1,be.TrackDel);return t==null||i==null?null:new Go(this.field,t,i)}}class Yo{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;f<c;f++)h+=e.facet(Ls);s.push(t+h.length-c),a=h+a.slice(c)}i.push(a),t+=a.length+1}let l=this.fieldPositions.map(a=>new Go(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;l===0&&(l=1e9);let c=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(l!=null?t[f].seq==l:c&&t[f].name==c)&&(h=f);if(h<0){let f=0;for(;f<t.length&&(l==null||t[f].seq!=null&&t[f].seq<l);)f++;t.splice(f,0,{seq:l,name:c}),h=f;for(let u of s)u.field>=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||"").length:2;f.from-=u,f.to-=u}s.push(new Xy(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new Yo(i,s)}}let Jy=I.widget({widget:new class extends gt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Qy=I.mark({class:"cm-snippetField"});class Oi{constructor(e,t){this.ranges=e,this.active=t,this.deco=I.set(e.map(i=>(i.from==i.to?Jy:Qy).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Oi(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const vn=V.define({map(n,e){return n&&n.map(e)}}),Zy=V.define(),an=ve.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(vn))return t.value;if(t.is(Zy)&&n)return new Oi(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>_.decorations.from(n,e=>e?e.deco:I.none)});function Xo(n,e){return w.create(n.filter(t=>t.field==e).map(t=>w.range(t.from,t.to)))}function eb(n){let e=Yo.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:j.of(o)},scrollIntoView:!0,annotations:i?[$o.of(i),ae.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=Xo(l,0)),l.some(c=>c.field>0)){let c=new Oi(l,0),f=h.effects=[vn.of(c)];t.state.field(an,!1)===void 0&&f.push(V.appendConfig.of([an,rb,ob,If]))}t.dispatch(t.state.update(h))}}function Bf(n){return({state:e,dispatch:t})=>{let i=e.field(an,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Xo(i.ranges,s),effects:vn.of(r?null:new Oi(i.ranges,s)),scrollIntoView:!0})),!0}}const tb=({state:n,dispatch:e})=>n.field(an,!1)?(e(n.update({effects:vn.of(null)})),!0):!1,ib=Bf(1),nb=Bf(-1),sb=[{key:"Tab",run:ib,shift:nb},{key:"Escape",run:tb}],Va=P.define({combine(n){return n.length?n[0]:sb}}),rb=qt.highest(mn.compute([Va],n=>n.facet(Va)));function Yb(n,e){return{...e,apply:eb(n)}}const ob=_.domEventHandlers({mousedown(n,e){let t=e.state.field(an,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Xo(t.ranges,s.field),effects:vn.of(t.ranges.some(r=>r.field>s.field)?new Oi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),hn={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Qt=V.define({map(n,e){let t=e.mapPos(n,-1,be.TrackAfter);return t??void 0}}),Jo=new class extends Bt{};Jo.startSide=1;Jo.endSide=-1;const Nf=ve.define({create(){return q.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(Qt)&&(n=n.update({add:[Jo.range(t.value,t.value+1)]}));return n}});function lb(){return[hb,Nf]}const dr="()[]{}<>«»»«[]{}";function Vf(n){for(let e=0;e<dr.length;e+=2)if(dr.charCodeAt(e)==n)return dr.charAt(e+1);return lo(n<128?n:n+1)}function Ff(n,e){return n.languageDataAt("closeBrackets",e)[0]||hn}const ab=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),hb=_.inputHandler.of((n,e,t,i)=>{if((ab?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&at(Le(i,0))==1||e!=s.from||t!=s.to)return!1;let r=ub(n.state,i);return r?(n.dispatch(r),!0):!1}),cb=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Ff(n,n.selection.main.head).brackets||hn.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=db(n.doc,o.head);for(let a of i)if(a==l&&Fs(n.doc,o.head)==Vf(Le(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:w.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},fb=[{key:"Backspace",run:cb}];function ub(n,e){let t=Ff(n,n.selection.main.head),i=t.brackets||hn.brackets;for(let s of i){let r=Vf(Le(s,0));if(e==s)return r==s?gb(n,s,i.indexOf(s+s+s)>-1,t):pb(n,s,r,t.before||hn.before);if(e==r&&Wf(n,n.selection.main.from))return mb(n,s,r)}return null}function Wf(n,e){let t=!1;return n.field(Nf).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Fs(n,e){let t=n.sliceString(e,e+2);return t.slice(0,at(Le(t,0)))}function db(n,e){let t=n.sliceString(e-2,e);return at(Le(t,0))==t.length?t:t.slice(1)}function pb(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Qt.of(o.to+e.length),range:w.range(o.anchor+e.length,o.head+e.length)};let l=Fs(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Qt.of(o.head+e.length),range:w.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function mb(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Fs(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:w.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function gb(n,e,t,i){let s=i.stringPrefixes||hn.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Qt.of(l.to+e.length),range:w.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Fs(n.doc,a),c;if(h==e){if(Fa(n,a))return{changes:{insert:e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)};if(Wf(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:w.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=Wa(n,a-2*e.length,s))>-1&&Fa(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=ne.Word&&Wa(n,a,s)>-1&&!yb(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Qt.of(a+e.length),range:w.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Fa(n,e){let t=de(n).resolveInner(e+1);return t.parent&&t.from==e}function yb(n,e,t,i){let s=de(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Wa(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=ne.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=ne.Word)return r}return-1}function Hf(n={}){return[Yy,Pe,fe.of(n),Uy,bb,If]}const zf=[{key:"Ctrl-Space",run:ur},{mac:"Alt-`",run:ur},{mac:"Alt-i",run:ur},{key:"Escape",run:qy},{key:"ArrowDown",run:zn(!0)},{key:"ArrowUp",run:zn(!1)},{key:"PageDown",run:zn(!0,"page")},{key:"PageUp",run:zn(!1,"page")},{key:"Enter",run:zy}],bb=qt.highest(mn.computeN([fe],n=>n.facet(fe).defaultKeymap?[zf]:[]));class Ha{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Yt{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(cn).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new wt,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let m,g;if(l.length)m=a,g=l.reduce((k,R)=>Math.min(k,R.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;g=p.to,l.push(p),d++}for(;d<r.length;){let k=r[d];if(k.from==m&&(k.to>k.from||k.to==m))l.push(k),d++,g=Math.min(k.to,g);else{g=Math.min(k.from,g);break}}g=Math.min(g,f);let b=!1;if(l.some(k=>k.from==m&&(k.to==g||g==f))&&(b=m==g,!b&&g-m<10)){let k=m-(c+h.value.length);k>0&&(h.next(k),c=m);for(let R=m;;){if(R>=g){b=!0;break}if(!h.lineBreak&&c+h.value.length>R)break;R=c+h.value.length,c+=h.value.length,h.next()}}let C=_b(l);if(b)o.add(m,m,I.widget({widget:new Tb(C),diagnostics:l.slice()}));else{let k=l.reduce((R,M)=>M.markClass?R+" "+M.markClass:R,"");o.add(m,g,I.mark({class:"cm-lintRange cm-lintRange-"+C+k,diagnostics:l.slice(),inclusiveEnd:l.some(R=>R.to>g)}))}if(a=g,a==f)break;for(let k=0;k<l.length;k++)l[k].to<=a&&l.splice(k--,1)}let u=o.finish();return new Yt(u,t,zt(u))}}function zt(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new Ha(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Ha(i.from,r,i.diagnostic)}}),i}function xb(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(cn).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(qf))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function vb(n,e){return n.field(Fe,!1)?e:e.concat(V.appendConfig.of(Lb))}const qf=V.define(),Qo=V.define(),$f=V.define(),Fe=ve.define({create(){return new Yt(I.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=zt(t,n.selected.diagnostic,r)||zt(t,null,r)}!t.size&&s&&e.state.facet(cn).autoPanel&&(s=null),n=new Yt(t,s,i)}for(let t of e.effects)if(t.is(qf)){let i=e.state.facet(cn).autoPanel?t.value.length?fn.open:null:n.panel;n=Yt.init(t.value,i,e.state)}else t.is(Qo)?n=new Yt(n.diagnostics,t.value?fn.open:null,n.selected):t.is($f)&&(n=new Yt(n.diagnostics,n.panel,t.value));return n},provide:n=>[en.from(n,e=>e.panel),_.decorations.from(n,e=>e.diagnostics)]}),wb=I.mark({class:"cm-lintRange cm-lintRange-active"});function kb(n,e,t){let{diagnostics:i}=n.state.field(Fe),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(e<h||t<0)))return s=c.diagnostics,r=a,o=h,!1});let l=n.state.facet(cn).tooltipFilter;return s&&l&&(s=l(s,n.state)),s?{pos:r,end:o,above:!0,create(){return{dom:Sb(n,s)}}}:null}function Sb(n,e){return J("ul",{class:"cm-tooltip-lint"},e.map(t=>Kf(n,t,!1)))}const Cb=n=>{let e=n.state.field(Fe,!1);(!e||!e.panel)&&n.dispatch({effects:vb(n.state,[Qo.of(!0)])});let t=Mo(n,fn.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},za=n=>{let e=n.state.field(Fe,!1);return!e||!e.panel?!1:(n.dispatch({effects:Qo.of(!1)}),!0)},Ab=n=>{let e=n.state.field(Fe,!1);if(!e)return!1;let t=n.state.selection.main,i=zt(e.diagnostics,null,t.to+1);return!i&&(i=zt(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),em(n,i.from,1,{tooltip:Uf,until:s=>s.docChanged||s.newSelection.main.head<i.from||s.newSelection.main.head>i.to}),!0)},Mb=[{key:"Mod-Shift-m",run:Cb,preventDefault:!0},{key:"F8",run:Ab}],cn=P.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...mt(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qa,tooltipFilter:qa,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function qa(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function jf(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let s=t[i];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Kf(n,e,t){var i;let s=t?jf(e.actions):[];return J("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},J("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=zt(n.state.field(Fe).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),J("u",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?" "+r.markClass:"";return J("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&J("div",{class:"cm-diagnosticSource"},e.source))}class Tb extends gt{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return J("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class $a{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Kf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class fn{constructor(e){this.view=e,this.items=[];let t=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)za(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=jf(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let a=zt(this.view.state.field(Fe).diagnostics,r);a&&r.actions[l].apply(e,a.from,a.to)}}else return;s.preventDefault()}},i=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=J("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=J("div",{class:"cm-panel-lint"},this.list,J("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>za(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Fe).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Fe),i=0,s=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:h})=>{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==c){f=d;break}f<0?(u=new $a(this.view,c),this.items.splice(i,0,u),s=!0):(u=this.items[f],f>i&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new $a(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/h:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Fe),i=zt(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:$f.of(i)})}static open(e){return new fn(e)}}function Db(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function qn(n){return Db(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Eb=_.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qn("#f11")},".cm-lintRange-warning":{backgroundImage:qn("orange")},".cm-lintRange-info":{backgroundImage:qn("#999")},".cm-lintRange-hint":{backgroundImage:qn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Ob(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function _b(n){let e="hint",t=1;for(let i of n){let s=Ob(i.severity);s>t&&(t=s,e=i.severity)}return e}const Uf=Zp(kb,{hideOn:xb}),Lb=[Fe,_.decorations.compute([Fe],n=>{let{selected:e,panel:t}=n.field(Fe);return!e||!t||e.from==e.to?I.none:I.set([wb.range(e.from,e.to)])}),Uf,Eb],Pb=[dm(),gm(),Op(),qg(),ug(),bp(),Cp(),$.allowMultipleSelections.of(!0),Qm(),Nc(gg,{fallback:!0}),Sg(),lb(),Hf(),zp(),jp(),Bp(),Q0(),mn.of([...fb,...U0,...vy,...Qg,...ag,...zf,...Mb])];function S(n){return new qm(Po.define(n))}function Et(n){return x(()=>import("./index-s_IiIj3Q.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>e.sql({dialect:e[n]}))}const $n=[y.of({name:"C",extensions:["c","h","ino"],load(){return x(()=>import("./index-Dmjcd9dH.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>n.cpp())}}),y.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return x(()=>import("./index-Dmjcd9dH.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>n.cpp())}}),y.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Et("Cassandra")}}),y.of({name:"CSS",extensions:["css"],load(){return x(()=>import("./index-C38uEGP7.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>n.css())}}),y.of({name:"Go",extensions:["go"],load(){return x(()=>import("./index-BP-OH85t.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>n.go())}}),y.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return x(()=>import("./index-C20z2yeK.js"),__vite__mapDeps([8,1,6,2,3,4,9])).then(n=>n.html())}}),y.of({name:"Java",extensions:["java"],load(){return x(()=>import("./index-BbOzeZis.js"),__vite__mapDeps([10,1,2,3,4])).then(n=>n.java())}}),y.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return x(()=>import("./index-D0gqeuOi.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript())}}),y.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return x(()=>import("./index-QkybH-4Y.js"),__vite__mapDeps([11,8,1,6,2,3,4,9])).then(n=>n.jinja())}}),y.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return x(()=>import("./index-CeewrlMR.js"),__vite__mapDeps([12,1,2,3,4])).then(n=>n.json())}}),y.of({name:"JSX",extensions:["jsx"],load(){return x(()=>import("./index-D0gqeuOi.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({jsx:!0}))}}),y.of({name:"LESS",extensions:["less"],load(){return x(()=>import("./index-BQ4D3lnr.js"),__vite__mapDeps([13,6,1,2,3,4])).then(n=>n.less())}}),y.of({name:"Liquid",extensions:["liquid"],load(){return x(()=>import("./index-CNYQPSEc.js"),__vite__mapDeps([14,8,1,6,2,3,4,9])).then(n=>n.liquid())}}),y.of({name:"MariaDB SQL",load(){return Et("MariaSQL")}}),y.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return x(()=>import("./index-BS-OsBk1.js"),__vite__mapDeps([15,8,1,6,2,3,4,9])).then(n=>n.markdown())}}),y.of({name:"MS SQL",load(){return Et("MSSQL")}}),y.of({name:"MySQL",load(){return Et("MySQL")}}),y.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return x(()=>import("./index-BTXpkf3M.js"),__vite__mapDeps([16,1,8,6,2,3,4,9])).then(n=>n.php())}}),y.of({name:"PLSQL",extensions:["pls"],load(){return Et("PLSQL")}}),y.of({name:"PostgreSQL",load(){return Et("PostgreSQL")}}),y.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return x(()=>import("./index-DYEKyod1.js"),__vite__mapDeps([17,1,2,3,4])).then(n=>n.python())}}),y.of({name:"Rust",extensions:["rs"],load(){return x(()=>import("./index-C20Ctqox.js"),__vite__mapDeps([18,1,2,3,4])).then(n=>n.rust())}}),y.of({name:"Sass",extensions:["sass"],load(){return x(()=>import("./index-DCX6wtGf.js"),__vite__mapDeps([19,1,6,2,3,4])).then(n=>n.sass({indented:!0}))}}),y.of({name:"SCSS",extensions:["scss"],load(){return x(()=>import("./index-DCX6wtGf.js"),__vite__mapDeps([19,1,6,2,3,4])).then(n=>n.sass())}}),y.of({name:"SQL",extensions:["sql"],load(){return Et("StandardSQL")}}),y.of({name:"SQLite",load(){return Et("SQLite")}}),y.of({name:"TSX",extensions:["tsx"],load(){return x(()=>import("./index-D0gqeuOi.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),y.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return x(()=>import("./index-D0gqeuOi.js"),__vite__mapDeps([9,1,2,3,4])).then(n=>n.javascript({typescript:!0}))}}),y.of({name:"WebAssembly",extensions:["wat","wast"],load(){return x(()=>import("./index-CRCrq0fK.js"),__vite__mapDeps([20,1,2,3,4])).then(n=>n.wast())}}),y.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return x(()=>import("./index-X_ZLsJF-.js"),__vite__mapDeps([21,1,2,3,4])).then(n=>n.xml())}}),y.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return x(()=>import("./index-Dw3xGHpw.js"),__vite__mapDeps([22,1,2,3,4])).then(n=>n.yaml())}}),y.of({name:"APL",extensions:["dyalog","apl"],load(){return x(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>S(n.apl))}}),y.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return x(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>S(n.asciiArmor))}}),y.of({name:"ASN.1",extensions:["asn","asn1"],load(){return x(()=>import("./asn1-EdZsLKOL.js"),[]).then(n=>S(n.asn1({})))}}),y.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return x(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>S(n.asterisk))}}),y.of({name:"Brainfuck",extensions:["b","bf"],load(){return x(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>S(n.brainfuck))}}),y.of({name:"Cobol",extensions:["cob","cpy"],load(){return x(()=>import("./cobol-CWcv1MsR.js"),[]).then(n=>S(n.cobol))}}),y.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.csharp))}}),y.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"ClojureScript",extensions:["cljs"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return x(()=>import("./css-BnMrqG3P.js"),[]).then(n=>S(n.gss))}}),y.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return x(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>S(n.cmake))}}),y.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return x(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>S(n.coffeeScript))}}),y.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return x(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>S(n.commonLisp))}}),y.of({name:"Cypher",extensions:["cyp","cypher"],load(){return x(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>S(n.cypher))}}),y.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return x(()=>import("./python-BuPzkPfP.js"),[]).then(n=>S(n.cython))}}),y.of({name:"Crystal",extensions:["cr"],load(){return x(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>S(n.crystal))}}),y.of({name:"D",extensions:["d"],load(){return x(()=>import("./d-pRatUO7H.js"),[]).then(n=>S(n.d))}}),y.of({name:"Dart",extensions:["dart"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.dart))}}),y.of({name:"diff",extensions:["diff","patch"],load(){return x(()=>import("./diff-DbItnlRl.js"),[]).then(n=>S(n.diff))}}),y.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return x(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([23,24])).then(n=>S(n.dockerFile))}}),y.of({name:"DTD",extensions:["dtd"],load(){return x(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>S(n.dtd))}}),y.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return x(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>S(n.dylan))}}),y.of({name:"EBNF",load(){return x(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>S(n.ebnf))}}),y.of({name:"ECL",extensions:["ecl"],load(){return x(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>S(n.ecl))}}),y.of({name:"edn",extensions:["edn"],load(){return x(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>S(n.clojure))}}),y.of({name:"Eiffel",extensions:["e"],load(){return x(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>S(n.eiffel))}}),y.of({name:"Elm",extensions:["elm"],load(){return x(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>S(n.elm))}}),y.of({name:"Erlang",extensions:["erl"],load(){return x(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>S(n.erlang))}}),y.of({name:"Esper",load(){return x(()=>import("./sql-D0XecflT.js"),[]).then(n=>S(n.esper))}}),y.of({name:"Factor",extensions:["factor"],load(){return x(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([25,24])).then(n=>S(n.factor))}}),y.of({name:"FCL",load(){return x(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>S(n.fcl))}}),y.of({name:"Forth",extensions:["forth","fth","4th"],load(){return x(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>S(n.forth))}}),y.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return x(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>S(n.fortran))}}),y.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.fSharp))}}),y.of({name:"Gas",extensions:["s"],load(){return x(()=>import("./gas-Bneqetm1.js"),[]).then(n=>S(n.gas))}}),y.of({name:"Gherkin",extensions:["feature"],load(){return x(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>S(n.gherkin))}}),y.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return x(()=>import("./groovy-D9Dt4D0W.js"),[]).then(n=>S(n.groovy))}}),y.of({name:"Haskell",extensions:["hs"],load(){return x(()=>import("./haskell-Cw1EW3IL.js"),[]).then(n=>S(n.haskell))}}),y.of({name:"Haxe",extensions:["hx"],load(){return x(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>S(n.haxe))}}),y.of({name:"HXML",extensions:["hxml"],load(){return x(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>S(n.hxml))}}),y.of({name:"HTTP",load(){return x(()=>import("./http-DBlCnlav.js"),[]).then(n=>S(n.http))}}),y.of({name:"IDL",extensions:["pro"],load(){return x(()=>import("./idl-BEugSyMb.js"),[]).then(n=>S(n.idl))}}),y.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return x(()=>import("./javascript-iXu5QeM3.js"),[]).then(n=>S(n.jsonld))}}),y.of({name:"Julia",extensions:["jl"],load(){return x(()=>import("./julia-DuME0IfC.js"),[]).then(n=>S(n.julia))}}),y.of({name:"Kotlin",extensions:["kt","kts"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.kotlin))}}),y.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return x(()=>import("./livescript-BwQOo05w.js"),[]).then(n=>S(n.liveScript))}}),y.of({name:"Lua",extensions:["lua"],load(){return x(()=>import("./lua-VAEuO923.js"),[]).then(n=>S(n.lua))}}),y.of({name:"mIRC",extensions:["mrc"],load(){return x(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>S(n.mirc))}}),y.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return x(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>S(n.mathematica))}}),y.of({name:"Modelica",extensions:["mo"],load(){return x(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>S(n.modelica))}}),y.of({name:"MUMPS",extensions:["mps"],load(){return x(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>S(n.mumps))}}),y.of({name:"Mbox",extensions:["mbox"],load(){return x(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>S(n.mbox))}}),y.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return x(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>S(n.nginx))}}),y.of({name:"NSIS",extensions:["nsh","nsi"],load(){return x(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([26,24])).then(n=>S(n.nsis))}}),y.of({name:"NTriples",extensions:["nt","nq"],load(){return x(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>S(n.ntriples))}}),y.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.objectiveC))}}),y.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.objectiveCpp))}}),y.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.oCaml))}}),y.of({name:"Octave",extensions:["m"],load(){return x(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>S(n.octave))}}),y.of({name:"Oz",extensions:["oz"],load(){return x(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>S(n.oz))}}),y.of({name:"Pascal",extensions:["p","pas"],load(){return x(()=>import("./pascal--L3eBynH.js"),[]).then(n=>S(n.pascal))}}),y.of({name:"Perl",extensions:["pl","pm"],load(){return x(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>S(n.perl))}}),y.of({name:"Pig",extensions:["pig"],load(){return x(()=>import("./pig-CevX1Tat.js"),[]).then(n=>S(n.pig))}}),y.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return x(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>S(n.powerShell))}}),y.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return x(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>S(n.properties))}}),y.of({name:"ProtoBuf",extensions:["proto"],load(){return x(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>S(n.protobuf))}}),y.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return x(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([27,28])).then(n=>S(n.pug))}}),y.of({name:"Puppet",extensions:["pp"],load(){return x(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>S(n.puppet))}}),y.of({name:"Q",extensions:["q"],load(){return x(()=>import("./q-pXgVlZs6.js"),[]).then(n=>S(n.q))}}),y.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return x(()=>import("./r-B6wPVr8A.js"),[]).then(n=>S(n.r))}}),y.of({name:"RPM Changes",load(){return x(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>S(n.rpmChanges))}}),y.of({name:"RPM Spec",extensions:["spec"],load(){return x(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>S(n.rpmSpec))}}),y.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return x(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>S(n.ruby))}}),y.of({name:"SAS",extensions:["sas"],load(){return x(()=>import("./sas-B4kiWyti.js"),[]).then(n=>S(n.sas))}}),y.of({name:"Scala",extensions:["scala"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.scala))}}),y.of({name:"Scheme",extensions:["scm","ss"],load(){return x(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>S(n.scheme))}}),y.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return x(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>S(n.shell))}}),y.of({name:"Sieve",extensions:["siv","sieve"],load(){return x(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>S(n.sieve))}}),y.of({name:"Smalltalk",extensions:["st"],load(){return x(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>S(n.smalltalk))}}),y.of({name:"Solr",load(){return x(()=>import("./solr-DehyRSwq.js"),[]).then(n=>S(n.solr))}}),y.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return x(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>S(n.sml))}}),y.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return x(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>S(n.sparql))}}),y.of({name:"Spreadsheet",alias:["excel","formula"],load(){return x(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>S(n.spreadsheet))}}),y.of({name:"Squirrel",extensions:["nut"],load(){return x(()=>import("./clike-B9uivgTg.js"),[]).then(n=>S(n.squirrel))}}),y.of({name:"Stylus",extensions:["styl"],load(){return x(()=>import("./stylus-B533Al4x.js"),[]).then(n=>S(n.stylus))}}),y.of({name:"Swift",extensions:["swift"],load(){return x(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>S(n.swift))}}),y.of({name:"sTeX",load(){return x(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>S(n.stex))}}),y.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return x(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>S(n.stex))}}),y.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return x(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>S(n.verilog))}}),y.of({name:"Tcl",extensions:["tcl"],load(){return x(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>S(n.tcl))}}),y.of({name:"Textile",extensions:["textile"],load(){return x(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>S(n.textile))}}),y.of({name:"TiddlyWiki",load(){return x(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>S(n.tiddlyWiki))}}),y.of({name:"Tiki wiki",load(){return x(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>S(n.tiki))}}),y.of({name:"TOML",extensions:["toml"],load(){return x(()=>import("./toml-Bm5Em-hy.js"),[]).then(n=>S(n.toml))}}),y.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return x(()=>import("./troff-wAsdV37c.js"),[]).then(n=>S(n.troff))}}),y.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return x(()=>import("./ttcn-CfJYG6tj.js"),[]).then(n=>S(n.ttcn))}}),y.of({name:"TTCN_CFG",extensions:["cfg"],load(){return x(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(n=>S(n.ttcnCfg))}}),y.of({name:"Turtle",extensions:["ttl"],load(){return x(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>S(n.turtle))}}),y.of({name:"Web IDL",extensions:["webidl"],load(){return x(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>S(n.webIDL))}}),y.of({name:"VB.NET",extensions:["vb"],load(){return x(()=>import("./vb-CmGdzxic.js"),[]).then(n=>S(n.vb))}}),y.of({name:"VBScript",extensions:["vbs"],load(){return x(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>S(n.vbScript))}}),y.of({name:"Velocity",extensions:["vtl"],load(){return x(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>S(n.velocity))}}),y.of({name:"Verilog",extensions:["v"],load(){return x(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>S(n.verilog))}}),y.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return x(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>S(n.vhdl))}}),y.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return x(()=>import("./xquery-DzFWVndE.js"),[]).then(n=>S(n.xQuery))}}),y.of({name:"Yacas",extensions:["ys"],load(){return x(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>S(n.yacas))}}),y.of({name:"Z80",extensions:["z80"],load(){return x(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>S(n.z80))}}),y.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.mscgen))}}),y.of({name:"Xù",extensions:["xu"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.xu))}}),y.of({name:"MsGenny",extensions:["msgenny"],load(){return x(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>S(n.msgenny))}}),y.of({name:"Vue",extensions:["vue"],load(){return x(()=>import("./index-GDJZ4nKF.js"),__vite__mapDeps([29,8,1,6,2,3,4,9])).then(n=>n.vue())}}),y.of({name:"Angular Template",load(){return x(()=>import("./index-DqPiRdTW.js"),__vite__mapDeps([30,8,1,6,2,3,4,9])).then(n=>n.angular())}})],Rb={conf:"Properties files",jsonc:"JSON",zsh:"Shell"};function Ib(n){const e=n.replaceAll("\\","/").split("/").at(-1)??n,t=y.matchFilename($n,e)??y.matchFilename($n,e.toLowerCase());if(t!==null)return t;if(/^dockerfile(?:\..+)?$/iu.test(e))return y.matchLanguageName($n,"Dockerfile",!1)??void 0;const i=/\.([^.]+)$/u.exec(e.toLowerCase())?.[1],s=i===void 0?void 0:Rb[i];return s===void 0?void 0:y.matchLanguageName($n,s,!1)??void 0}const jn=1024*1024,Kn=8*1024,Bb=Qf({__name:"CodeFileEditor",props:{modelValue:{},path:{},readOnly:{type:Boolean},targetLine:{},targetColumn:{},codeNavigationEnabled:{type:Boolean}},emits:["viewed","update:modelValue","symbols","navigate-symbol","navigate-file"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=nu(),o=new It,l=new It,a=new It,h=new It;let c,f=!1;function u(v){if(document.visibilityState!=="visible"||!document.hasFocus()||v.dom.getClientRects().length===0)return;const E=v.state.doc.lineAt(v.viewport.from).number;s("viewed",{startLine:E,endLine:Math.min(E+79,v.state.doc.lineAt(v.viewport.to).number)})}let d,p,m,g=0;const b=new TextEncoder,C=I.mark({class:"cm-code-navigation-target"}),k=I.line({class:"cm-code-navigation-destination"}),R=_.theme({"&":{color:"var(--mar-editor-foreground)",backgroundColor:"var(--mar-editor-background)"},".cm-content":{caretColor:"var(--mar-editor-cursor)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--mar-editor-cursor)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionLayer .cm-selectionBackground":{background:"var(--mar-editor-selection) !important"},".cm-content ::selection":{backgroundColor:"transparent"},".cm-activeLine":{backgroundColor:"var(--mar-editor-active-line)",boxShadow:"inset 2px 0 0 var(--mar-editor-active-line-indicator)"},".cm-gutters":{color:"var(--mar-editor-gutter-foreground)",backgroundColor:"var(--mar-editor-gutter-background)",borderRightColor:"var(--mar-editor-border)"},".cm-activeLineGutter":{backgroundColor:"var(--mar-editor-active-line)"},".cm-selectionMatch":{backgroundColor:"var(--mar-editor-selection-match)",outline:"1px solid var(--mar-editor-selection-match-border)",outlineOffset:"-1px",borderRadius:"2px"},".cm-selectionMatch.cm-selectionMatch-main":{color:"var(--mar-editor-selection-match-main-foreground)",backgroundColor:"var(--mar-editor-selection-match-main)",outlineColor:"var(--mar-editor-selection-match-main-border)"},".cm-searchMatch":{backgroundColor:"var(--mar-editor-search-match)",outline:"1px solid var(--mar-editor-search-match-border)",outlineOffset:"-1px",borderRadius:"2px"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--mar-editor-search-match-active)",outlineColor:"var(--mar-editor-search-match-active-border)"}}),M=yn.define([{tag:[A.keyword,A.modifier],color:"var(--mar-editor-keyword)"},{tag:A.controlKeyword,color:"var(--mar-editor-control-keyword)"},{tag:[A.name,A.variableName],color:"var(--mar-editor-variable)"},{tag:[A.propertyName,A.attributeName],color:"var(--mar-editor-property)"},{tag:[A.function(A.variableName),A.function(A.propertyName)],color:"var(--mar-editor-function)"},{tag:[A.typeName,A.className,A.namespace],color:"var(--mar-editor-type)"},{tag:[A.string,A.special(A.string)],color:"var(--mar-editor-string)"},{tag:[A.number,A.bool,A.null],color:"var(--mar-editor-number)"},{tag:[A.comment,A.docComment],color:"var(--mar-editor-comment)"},{tag:A.regexp,color:"var(--mar-editor-regexp)"},{tag:[A.operator,A.punctuation],color:"var(--mar-editor-operator)"},{tag:A.invalid,color:"var(--mar-editor-invalid)"},{tag:A.heading,color:"var(--mar-editor-heading)",fontWeight:"600"},{tag:A.link,color:"var(--mar-editor-link)",textDecoration:"underline"}]);function T(v,E,N){const Y=++g,se=N>jn?void 0:Ib(E);v.dispatch({effects:l.reconfigure(se?.support??[])}),!(se===void 0||se.support!==void 0)&&se.load().then(jt=>{c!==v||Y!==g||v.dispatch({effects:l.reconfigure(jt)})},()=>{})}function D(v){if(v.state.doc.length>jn)return null;const E=v.matchBefore(/[\p{L}\p{N}_$-]*/u);if(E===null||E.from===E.to&&!v.explicit)return null;const N=new Set(v.state.doc.toString().match(/[\p{L}_$][\p{L}\p{N}_$-]{2,}/gu)??[]);return{from:E.from,options:[...N].slice(0,300).map(Y=>({label:Y,type:"text"}))}}function F(v){if(v.doc.length>jn)return[];const E=[],N=de(v).cursor(),Y=/(?:Declaration|Definition|Class|Interface|Function|Method|Heading|Section|TypeAlias|Enum)/u;do{if(!Y.test(N.name)||N.to<=N.from)continue;const me=v.sliceDoc(N.from,Math.min(N.to,N.from+240)),Li=/(?:class|interface|function|def|fn|func|type|enum|const|let|var)?\s*([\p{L}_$][\p{L}\p{N}_$-]*)/u.exec(me)?.[1];let Tt=0;for(let Dt=N.node.parent;Dt!==null;Dt=Dt.parent)Tt+=1;Li!==void 0&&!E.some(Dt=>Dt.from===N.from)&&E.push({name:Li,kind:N.name,from:N.from,depth:Math.max(0,Tt-1)})}while(N.next());const se=v.doc.toString(),jt=/^(\s*)(?:#{1,6}\s+(.+)|(?:export\s+)?(?:async\s+)?(?:class|interface|function|def|fn|func|type|enum)\s+([\p{L}_$][\p{L}\p{N}_$-]*)|(?:function\s+)?([\p{L}_$][\p{L}\p{N}_$-]*)\s*\(\)\s*\{)/gmu;for(const me of se.matchAll(jt)){const Mt=(me[2]??me[3]??me[4])?.trim();Mt===void 0||me.index===void 0||E.some(Li=>Li.from===me.index)||E.push({name:Mt,kind:me[2]===void 0?"Declaration":"Heading",from:me.index+me[1].length,depth:me[2]===void 0?Math.min(4,Math.floor(me[1].length/2)):0})}return E.sort((me,Mt)=>me.from-Mt.from),E.slice(0,1e3)}function H(){c!==void 0&&s("symbols",F(c.state))}function G(){d!==void 0&&clearTimeout(d),d=setTimeout(()=>{d=void 0,H()},120)}function W(v,E){if(c===void 0||v<1||v>c.state.doc.lines)return;const N=c.state.doc.line(v),Y=E===void 0?N.from:Math.min(N.to,N.from+Math.max(0,E-1));m!==void 0&&clearTimeout(m),c.dispatch({selection:{anchor:Y},effects:[_.scrollIntoView(Y,{y:"center"}),h.reconfigure(_.decorations.of(I.set([k.range(Y)])))]}),m=setTimeout(()=>{c!==void 0&&c.dispatch({effects:h.reconfigure([])}),m=void 0},1800),c.focus()}function B(v){c!==void 0&&(c.dispatch({selection:{anchor:v},effects:_.scrollIntoView(v,{y:"center"})}),c.focus())}function U(){if(c===void 0)return;const v=c.state.selection.main.head,E=c.state.doc.lineAt(v);return{line:E.number,column:v-E.from+1}}function K(){if(c===void 0)return"";const v=c.state.selection.main;return c.state.doc.sliceString(v.from,v.to)}function X(v){if(c===void 0||i.readOnly)return;const E=c.state.selection.main;c.dispatch({changes:{from:E.from,to:E.to,insert:v},selection:{anchor:E.from+v.length}}),c.focus()}function pe(v){if(c===void 0)return;const E=c.state.doc.lineAt(Math.max(0,Math.min(v,c.state.doc.length)));return{line:E.number,column:Math.max(0,v-E.from)+1}}function Ce(){c!==void 0&&(Ss(c),Zo())}function We(v,E){const N=Math.max(0,E-Kn),Y=Math.min(v.state.doc.length,E+Kn),se=he(v.state.sliceDoc(N,Y),E-N);return{text:se.text,position:se.position,from:N+se.from}}function he(v,E){if(b.encode(v).byteLength<=Kn)return{text:v,position:E,from:0};let N=E,Y=E;N>0&&_e(v.charCodeAt(N))&&(N-=1),Y<v.length&&_e(v.charCodeAt(Y))&&(Y+=1);let se=0,jt=!0;for(;N>0||Y<v.length;){const me=N>0?Ee(v,N):void 0,Mt=Y<v.length?Xe(v,Y):void 0,Tt=(jt?[me,Mt]:[Mt,me]).find(Dt=>Dt!==void 0&&se+b.encode(Dt.text).byteLength<=Kn);if(Tt===void 0)break;Tt.direction==="before"?N=Tt.offset:Y=Tt.offset,se+=b.encode(Tt.text).byteLength,jt=!jt}return{text:v.slice(N,Y),position:E-N,from:N}}function Ee(v,E){const N=E-(E>1&&_e(v.charCodeAt(E-1))?2:1);return{direction:"before",offset:N,text:v.slice(N,E)}}function Xe(v,E){const N=E+(Oe(v.charCodeAt(E))?2:1);return{direction:"after",offset:N,text:v.slice(E,N)}}function Oe(v){return v>=55296&&v<=56319}function _e(v){return v>=56320&&v<=57343}function it(v,E){if(!v.ctrlKey&&!v.metaKey)return;const N=E.posAtCoords({x:v.clientX,y:v.clientY});if(N===null)return;const Y=We(E,N),se=ru(i.path,Y.text,Y.position);if(se!==void 0)return se.kind==="symbol"?{kind:"symbol",value:se.value,from:Y.from+se.from,to:Y.from+se.to}:{kind:"reference",reference:se.reference,sourceContext:{text:Y.text,position:Y.position},from:Y.from+se.from,to:Y.from+se.to}}function At(v){return v===void 0?[]:_.decorations.of(I.set([C.range(v.from,v.to)]))}function He(v,E){p?.from===E?.from&&p?.to===E?.to||(p=E,v.dispatch({effects:a.reconfigure(At(E))}))}function _i(v){!v.ctrlKey&&!v.metaKey&&c!==void 0&&He(c,void 0)}function Gf(v,E){if(!i.codeNavigationEnabled)return!1;const N=it(v,E);return N===void 0?!1:(v.preventDefault(),v.stopPropagation(),E.dispatch({selection:{anchor:E.posAtCoords({x:v.clientX,y:v.clientY})??N.from}}),N.kind==="reference"?s("navigate-file",N):s("navigate-symbol",N.value),!0)}function Yf(v,E){if(!i.codeNavigationEnabled)return He(E,void 0),!1;const N=it(v,E);return He(E,N),!1}function Zo(){queueMicrotask(()=>{const v=c?.dom.querySelector(".cm-search");v?.setAttribute("role","search"),v?.setAttribute("aria-label",ze("inlineFind.label"))})}function el(v){return[_.editable.of(!v),$.readOnly.of(v)]}function Xf(){return c===void 0?!1:(c.dispatch({selection:{anchor:0,head:c.state.doc.length},scrollIntoView:!0}),c.focus(),!0)}function Jf(){return c?.hasFocus??!1}return e({goTo:B,scrollToLine:W,cursorPosition:U,positionAt:pe,selectedText:K,insertText:X,openFind:Ce,isFindOpen:()=>c!==void 0&&dy(c.state),closeFind:()=>{c!==void 0&&zo(c)},selectAll:Xf,isFocused:Jf,focus:()=>c?.focus()}),Zf(()=>{r.value!==void 0&&(c=new _({parent:r.value,state:$.create({doc:i.modelValue,extensions:[Pb,R,Nc(M),l.of([]),o.of(el(i.readOnly)),a.of([]),h.of([]),$.phrases.of({Find:ze("inlineFind.placeholder"),Replace:ze("inlineFind.replacePlaceholder"),next:ze("inlineFind.next"),previous:ze("inlineFind.previous"),all:ze("inlineFind.selectAll"),"match case":ze("inlineFind.matchCase"),regexp:ze("inlineFind.regexp"),"by word":ze("inlineFind.wholeWord"),replace:ze("inlineFind.replace"),"replace all":ze("inlineFind.replaceAll"),close:ze("inlineFind.close")}),Hf(),$.languageData.of(()=>[{autocomplete:D}]),mn.of([{key:"Mod-h",run:Ss}]),_.domEventHandlers({mousedown:(v,E)=>Gf(v,E),mousemove:(v,E)=>Yf(v,E),mouseleave:(v,E)=>(He(E,void 0),!1),keydown:(v,E)=>(!v.ctrlKey&&!v.metaKey&&He(E,void 0),!1),keyup:(v,E)=>(!v.ctrlKey&&!v.metaKey&&He(E,void 0),!1),blur:(v,E)=>(He(E,void 0),!1)}),_.updateListener.of(v=>{(v.viewportChanged||v.selectionSet||v.focusChanged)&&u(v.view),v.docChanged&&!f&&s("update:modelValue",v.state.doc.toString()),v.docChanged?G():v.transactions.some(E=>E.reconfigured)&&H(),Zo()})]})}),T(c,i.path,i.modelValue.length),c.requestMeasure({read:u}),window.addEventListener("keyup",_i,{capture:!0}),i.targetLine!==void 0&&W(i.targetLine,i.targetColumn))}),Pi(()=>i.modelValue,v=>{c===void 0||v===c.state.doc.toString()||(f=!0,c.dispatch({changes:{from:0,to:c.state.doc.length,insert:v}}),f=!1)}),Pi(()=>i.readOnly,v=>c?.dispatch({effects:o.reconfigure(el(v))})),Pi(()=>i.path,v=>{c!==void 0&&T(c,v,c.state.doc.length)}),Pi(()=>i.modelValue.length>jn,()=>{c!==void 0&&T(c,i.path,c.state.doc.length)}),Pi(()=>[i.targetLine,i.targetColumn],([v,E])=>{v!==void 0&&W(v,E)}),eu(()=>{g+=1,d!==void 0&&clearTimeout(d),m!==void 0&&clearTimeout(m),window.removeEventListener("keyup",_i,{capture:!0}),c?.destroy(),c=void 0}),(v,E)=>(tu(),iu("div",{ref_key:"host",ref:r,class:"code-file-editor"},null,512))}}),Nb=su(Bb,[["__scopeId","data-v-6ae84d6d"]]),Xb=Object.freeze(Object.defineProperty({__proto__:null,default:Nb},Symbol.toStringTag,{value:"Module"}));export{Ls as A,Zm as B,Lf as C,ym as D,_ as E,$ as F,Jt as G,y as H,Z as I,Ci as J,Xb as K,Qr as L,To as N,wc as P,te as T,qm as a,Gb as b,Kb as c,Ay as d,de as e,eg as f,De as g,z as h,Mc as i,w as j,$b as k,Ub as l,jb as m,Hb as n,Yb as o,zb as p,Cg as q,Wm as r,Im as s,A as t,Cc as u,qe as v,Ti as w,qt as x,mn as y,Ke as z};