@marimo-team/islands 0.19.10-dev2 → 0.19.10-dev21

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 (418) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BAeQ8DWw.js → ConnectedDataExplorerComponent-CkXO-pKy.js} +6 -6
  2. package/dist/{react-plotly-BuRa9xtI.js → Plot-CmsrWWji.js} +72 -286
  3. package/dist/{any-language-editor-D0UQItkS.js → any-language-editor-t_VsTNa-.js} +16 -16
  4. package/dist/apl-C1bki_dE.js +4 -0
  5. package/dist/{arc-CEWBr4jc.js → arc-9nABupDE.js} +2 -2
  6. package/dist/{architectureDiagram-VXUJARFQ-DPPYVq8H.js → architectureDiagram-VXUJARFQ-DmJQhcJb.js} +6 -6
  7. package/dist/asciiarmor-BdlkCCRr.js +4 -0
  8. package/dist/asn1-CvE30hox.js +4 -0
  9. package/dist/{blockDiagram-VD42YOAC-BA5N05Y9.js → blockDiagram-VD42YOAC-CRofISJs.js} +10 -10
  10. package/dist/brainfuck-BalwWy1a.js +4 -0
  11. package/dist/{c4Diagram-YG6GDRKO-DJLzuGJJ.js → c4Diagram-YG6GDRKO-Deqoag4I.js} +4 -4
  12. package/dist/{channel-Dob5kWXR.js → channel-CMsnebrL.js} +1 -1
  13. package/dist/{chunk-4BX2VUAB-DZQibjKA.js → chunk-4BX2VUAB-WmXmzRBr.js} +1 -1
  14. package/dist/{chunk-55IACEB6-C3BASkh4.js → chunk-55IACEB6-irYMvHJu.js} +1 -1
  15. package/dist/{chunk-5FQGJX7Z-BEb20Lzt.js → chunk-5FQGJX7Z-pOElJy8t.js} +2 -2
  16. package/dist/{chunk-ABZYJK2D-BXTC53mt.js → chunk-ABZYJK2D-BGWvKte3.js} +2 -2
  17. package/dist/{chunk-ATLVNIR6-BJDjUR_c.js → chunk-ATLVNIR6-BYZB6C5T.js} +2 -2
  18. package/dist/{chunk-B4BG7PRW-DzmUUpfH.js → chunk-B4BG7PRW-CwYUp6Uj.js} +7 -7
  19. package/dist/{chunk-CVBHYZKI-Dhc_e3rA.js → chunk-CVBHYZKI-Bb2XMuXJ.js} +1 -1
  20. package/dist/{chunk-DI55MBZ5-gTd3J8Tu.js → chunk-DI55MBZ5-Gyro6dvN.js} +6 -6
  21. package/dist/{chunk-EXTU4WIE-DyoOs5QX.js → chunk-EXTU4WIE-BlA7aWEw.js} +2 -2
  22. package/dist/{chunk-FMBD7UC4-geNUIndh.js → chunk-FMBD7UC4-C0DZU_4q.js} +1 -1
  23. package/dist/{chunk-HN2XXSSU-CqPwpolw.js → chunk-HN2XXSSU-BsB4dtgF.js} +1 -1
  24. package/dist/{chunk-JA3XYJ7Z-BGnAIbOP.js → chunk-JA3XYJ7Z-Cm-pccR-.js} +3 -3
  25. package/dist/{chunk-JZLCHNYA-CIRgweVQ.js → chunk-JZLCHNYA-CoLqqXMe.js} +6 -6
  26. package/dist/{chunk-MI3HLSF2-DOJkNER1.js → chunk-MI3HLSF2-DeDZS-tQ.js} +1 -1
  27. package/dist/{chunk-N4CR4FBY-DKSvXAIS.js → chunk-N4CR4FBY-ByLbY9L-.js} +7 -7
  28. package/dist/{chunk-QN33PNHL-B6zC8BTi.js → chunk-QN33PNHL-eodIiY9F.js} +2 -2
  29. package/dist/{chunk-QXUST7PY-C7750n_u.js → chunk-QXUST7PY-CuJlDW6A.js} +10 -10
  30. package/dist/{chunk-QZHKN3VN-BF_oGUlG.js → chunk-QZHKN3VN-Diy_Cdek.js} +1 -1
  31. package/dist/{chunk-S3R3BYOJ-CBkH6JZZ.js → chunk-S3R3BYOJ-CwDGYMVf.js} +3 -3
  32. package/dist/{chunk-TZMSLE5B-DObGL7xi.js → chunk-TZMSLE5B-DFDr5FCr.js} +2 -2
  33. package/dist/classDiagram-2ON5EDUG-BDBX9etk.js +30 -0
  34. package/dist/classDiagram-v2-WZHVMYZB-Bzj_L_BF.js +30 -0
  35. package/dist/{clike-B1zispTy.js → clike-B90WKs4D.js} +1 -1
  36. package/dist/clojure-CUC2I1hM.js +4 -0
  37. package/dist/cmake-8PcMxXnB.js +4 -0
  38. package/dist/cobol-DkkkDz5v.js +4 -0
  39. package/dist/{code-block-37QAKDTI-u5kgjqmr.js → code-block-37QAKDTI-zh5AeoJo.js} +1 -1
  40. package/dist/coffeescript-CCupxOZf.js +4 -0
  41. package/dist/commonlisp-DhUfGX6b.js +4 -0
  42. package/dist/{cose-bilkent-S5V4N54A-CO4ORQHF.js → cose-bilkent-S5V4N54A-BK1nIR2J.js} +1 -1
  43. package/dist/crystal-DSaw6rFQ.js +4 -0
  44. package/dist/css-D4QDewkG.js +4 -0
  45. package/dist/cypher-CrYVqw_F.js +4 -0
  46. package/dist/d-Cr3H3pPx.js +4 -0
  47. package/dist/{dagre-6UL2VRFP-C2C2XxsB.js → dagre-6UL2VRFP-r2rSdJYL.js} +9 -9
  48. package/dist/{data-grid-overlay-editor-BXqtz1ia.js → data-grid-overlay-editor-BVFT970w.js} +2 -2
  49. package/dist/{diagram-PSM6KHXK-DHBY-94p.js → diagram-PSM6KHXK-BpxVUe9U.js} +10 -10
  50. package/dist/{diagram-QEK2KX5R-CgMshOwn.js → diagram-QEK2KX5R-q3dHUcp6.js} +5 -5
  51. package/dist/{diagram-S2PKOQOG-F1KPva3Y.js → diagram-S2PKOQOG-MDBKrxSC.js} +5 -5
  52. package/dist/diff-ODiZJGls.js +4 -0
  53. package/dist/dist-4YNZxwMI.js +8 -0
  54. package/dist/dist-7nR3r2kG.js +5 -0
  55. package/dist/{dist-CBA36Nuy.js → dist-B2-r9y-0.js} +109 -109
  56. package/dist/dist-B2gkyT3r.js +5 -0
  57. package/dist/{dist--JwRU9u5.js → dist-B4tYJP_i.js} +2 -2
  58. package/dist/{dist-DA1J6LvO.js → dist-B5ATpkxy.js} +2 -2
  59. package/dist/dist-B8G3I6vJ.js +8 -0
  60. package/dist/{dist-DKnxaCRl.js → dist-B94MxrQS.js} +2 -2
  61. package/dist/dist-BJ96Ykfp.js +8 -0
  62. package/dist/dist-BKLIWGw4.js +5 -0
  63. package/dist/{dist-l0KayR2-.js → dist-BLwfpZD-.js} +2 -2
  64. package/dist/{dist-C_Kw_Kc0.js → dist-BYmtF1W6.js} +2 -2
  65. package/dist/{dist-Cpj5BHNP.js → dist-BbBnU4tG.js} +1 -1
  66. package/dist/dist-Bf3ou00A.js +6 -0
  67. package/dist/{dist-CITQGRtG.js → dist-BfactX3G.js} +4 -4
  68. package/dist/{dist-CsN7lsea.js → dist-BoAHOW2l.js} +2 -2
  69. package/dist/{dist-BcXuIt-h.js → dist-Bsv_ARko.js} +4 -4
  70. package/dist/dist-BvkKXuPm.js +5 -0
  71. package/dist/{dist-DsqQCNKw.js → dist-C2-m5aEk.js} +119 -119
  72. package/dist/dist-C6NJ3n6r.js +5 -0
  73. package/dist/{dist-DIVeCGlI.js → dist-CC9VUnXd.js} +1 -1
  74. package/dist/{dist-BKGWAN8J.js → dist-CE43BRmt.js} +1 -1
  75. package/dist/{dist-COp5dkis.js → dist-CJrHMxlI.js} +31 -31
  76. package/dist/{dist-BbQ-5HAA.js → dist-CPTE45iS.js} +1 -1
  77. package/dist/{dist-9trj4p6n.js → dist-CcOGT46m.js} +27 -27
  78. package/dist/dist-CecLPYY5.js +5 -0
  79. package/dist/{dist-BSMZYwqW.js → dist-Cgf353Ki.js} +1 -1
  80. package/dist/dist-Ch0SwRzK.js +5 -0
  81. package/dist/{dist-C6p7UKkB.js → dist-CkEUrAus.js} +2 -2
  82. package/dist/{dist-MFzhAmKV.js → dist-CmZYrgd_.js} +1 -1
  83. package/dist/{dist-b7Sc3Tj8.js → dist-Crk9ejOy.js} +4 -4
  84. package/dist/dist-D6eWHiFh.js +6 -0
  85. package/dist/dist-DCQ710Bv.js +5 -0
  86. package/dist/{dist-r6N_0WG-.js → dist-DOil6y-3.js} +4 -4
  87. package/dist/{dist-CPd_adhw.js → dist-Dc1SFk5I.js} +2 -2
  88. package/dist/dist-Dit9tk8a.js +1242 -0
  89. package/dist/{dist-B7NoEgR4.js → dist-DqJdzAYM.js} +2 -2
  90. package/dist/dist-P_pkS5f-.js +8 -0
  91. package/dist/{dist--Em7gfgX.js → dist-T4g7Sr6e.js} +3 -3
  92. package/dist/{dist-BhBtK2sL.js → dist-glA_fIK_.js} +2 -2
  93. package/dist/{dist-9J8_3DZN.js → dist-iiugPhCC.js} +1 -1
  94. package/dist/{dist-D7jHtwN8.js → dist-r8ecBV-v.js} +135 -65
  95. package/dist/{dist-BlRm4v0e.js → dist-yVJ4xE5n.js} +5 -5
  96. package/dist/{dockerfile-BBT_Ira6.js → dockerfile-D1Q_4uCN.js} +1 -1
  97. package/dist/dtd-C-t2Rk7F.js +4 -0
  98. package/dist/dylan-B4ctBLGp.js +4 -0
  99. package/dist/ecl-DqWfymni.js +4 -0
  100. package/dist/eiffel-DjBKKAr7.js +4 -0
  101. package/dist/elm--fxeC0FV.js +4 -0
  102. package/dist/{erDiagram-Q2GNP2WA-18gGng8V.js → erDiagram-Q2GNP2WA-CX1XdqVD.js} +13 -13
  103. package/dist/erlang-CaKXCX6H.js +4 -0
  104. package/dist/{esm-CgRNPmz8.js → esm-BAS2d2Ad.js} +1503 -1536
  105. package/dist/{factor-DdqWbSyy.js → factor--4HHM8Rw.js} +1 -1
  106. package/dist/factor-DlLO5EFS.js +4 -0
  107. package/dist/{flowDiagram-NV44I4VS-iHFiHYe0.js → flowDiagram-NV44I4VS-BCj-ONTw.js} +15 -15
  108. package/dist/forth-rOO6LVj_.js +4 -0
  109. package/dist/fortran-CUg15VGR.js +4 -0
  110. package/dist/{ganttDiagram-JELNMOA3-D7GixxiF.js → ganttDiagram-JELNMOA3-D1l5ewiQ.js} +8 -8
  111. package/dist/gas-BMRJspiW.js +4 -0
  112. package/dist/gherkin-DRxzijZU.js +4 -0
  113. package/dist/{gitGraphDiagram-NY62KEGX-CJFHytRK.js → gitGraphDiagram-NY62KEGX-KdZh0iiW.js} +5 -5
  114. package/dist/{glide-data-editor-BYwb17Bf.js → glide-data-editor-2RvcPqmc.js} +75 -76
  115. package/dist/groovy-BmrQ8pUP.js +4 -0
  116. package/dist/haskell-BuaYfKOz.js +4 -0
  117. package/dist/haxe-DcH9eA0a.js +5 -0
  118. package/dist/idl-DGlcm4Ls.js +4 -0
  119. package/dist/{infoDiagram-WHAUD3N6-B5Lkh3A9.js → infoDiagram-WHAUD3N6-PSH7lQ0D.js} +3 -3
  120. package/dist/javascript-CeTk7rzr.js +4 -0
  121. package/dist/{journeyDiagram-XKPGCS4Q-CV_9R9iP.js → journeyDiagram-XKPGCS4Q-BrTAxQ1J.js} +5 -5
  122. package/dist/julia-BoP_q1gm.js +4 -0
  123. package/dist/{kanban-definition-3W4ZIXB7-Dp21D5Ym.js → kanban-definition-3W4ZIXB7-BoYCDp_9.js} +10 -10
  124. package/dist/{katex-CX2BKujk.js → katex-DaGuLbVh.js} +1 -1
  125. package/dist/{line-LK_5q2B9.js → line-Bc27KE1D.js} +3 -3
  126. package/dist/{linear-vWf1Qj0e.js → linear-Bnc6E9kA.js} +4 -4
  127. package/dist/livescript-B7IMN-ba.js +4 -0
  128. package/dist/{loader-B0KEFFi-.js → loader-C0-eIoas.js} +1 -1
  129. package/dist/lua-q1InavKb.js +4 -0
  130. package/dist/main.js +207 -204
  131. package/dist/mathematica-DvR8-_EI.js +4 -0
  132. package/dist/mbox-7h5MNBS_.js +4 -0
  133. package/dist/{mermaid-4DMBBIKO-BhDCqnO1.js → mermaid-4DMBBIKO-BmJdHPwx.js} +1 -1
  134. package/dist/{mermaid-B__BZSXU.js → mermaid-C2cSe5YL.js} +40 -40
  135. package/dist/{mhchem-w1tkUnWr.js → mhchem-B_tiMbKF.js} +1 -1
  136. package/dist/{mindmap-definition-VGOIOE7T-B_5mfdYp.js → mindmap-definition-VGOIOE7T-CmRjsKEt.js} +12 -12
  137. package/dist/mirc-D-XM8A5c.js +4 -0
  138. package/dist/mllike-BQGkkbmf.js +6 -0
  139. package/dist/modelica-D_yRj_WU.js +4 -0
  140. package/dist/mscgen-B-rltAjp.js +6 -0
  141. package/dist/mumps-2kh8TU2b.js +4 -0
  142. package/dist/{nsis-CunMjZ_n.js → nsis-B6EN9LWI.js} +1 -1
  143. package/dist/nsis-CtusEqwb.js +4 -0
  144. package/dist/ntriples-BdAXw6zV.js +4 -0
  145. package/dist/{number-overlay-editor-D-4WQAGX.js → number-overlay-editor-DKVJgXpp.js} +1 -1
  146. package/dist/octave-CsNFmVp5.js +4 -0
  147. package/dist/{ordinal-IlASfRja.js → ordinal-DLLbwLkP.js} +1 -1
  148. package/dist/oz-odIXCrKd.js +4 -0
  149. package/dist/pascal-B9Mfk3Fo.js +4 -0
  150. package/dist/perl-C48inLcz.js +4 -0
  151. package/dist/{pieDiagram-ADFJNKIX-B-DGEopK.js → pieDiagram-ADFJNKIX-CtxQlnsU.js} +10 -10
  152. package/dist/pig-uwRtAssU.js +4 -0
  153. package/dist/powershell-CXqlca-i.js +4 -0
  154. package/dist/{precisionRound-CGLoV26P.js → precisionRound-Duzbr5ur.js} +1 -1
  155. package/dist/properties-D6Zu1rpK.js +4 -0
  156. package/dist/protobuf-BlNNWZaR.js +4 -0
  157. package/dist/pug-DytcK7bv.js +4 -0
  158. package/dist/{pug-Dr-sA_9V.js → pug-xrm7jQ2R.js} +1 -1
  159. package/dist/puppet-lJ8Ok3iY.js +4 -0
  160. package/dist/python-cMaF7kUp.js +4 -0
  161. package/dist/q-Dgt2HYQh.js +4 -0
  162. package/dist/{quadrantDiagram-AYHSOK5B-M_yRSIZn.js → quadrantDiagram-AYHSOK5B-DllnB2Hl.js} +4 -4
  163. package/dist/r-Bm4S4awf.js +4 -0
  164. package/dist/react-vega-1ub36dPZ.js +9 -0
  165. package/dist/{react-vega-DLFvGrpJ.js → react-vega-CCNu2JE0.js} +18 -18
  166. package/dist/{requirementDiagram-UZGBJVZJ-9Wt82hOZ.js → requirementDiagram-UZGBJVZJ-D36MI1k0.js} +12 -12
  167. package/dist/rpm-_8LbzMVc.js +5 -0
  168. package/dist/ruby-Cr8IJ5VZ.js +4 -0
  169. package/dist/{sankeyDiagram-TZEHDZUN-x_aTXZeN.js → sankeyDiagram-TZEHDZUN-D1mygNPC.js} +4 -4
  170. package/dist/sas-CFcSfo2_.js +4 -0
  171. package/dist/scheme-N4XRoKgc.js +4 -0
  172. package/dist/{sequenceDiagram-WL72ISMW-CXXmJqiQ.js → sequenceDiagram-WL72ISMW-CWdn91Rf.js} +6 -6
  173. package/dist/shell-B4L7f_ds.js +4 -0
  174. package/dist/sieve-UI6J3Gm0.js +4 -0
  175. package/dist/smalltalk-BuaPZAZU.js +4 -0
  176. package/dist/sparql-1rKrq463.js +4 -0
  177. package/dist/{src-szye8OCw.js → src-jICM_d2B.js} +1 -1
  178. package/dist/{stateDiagram-FKZM4ZOC-CiSKS_Mx.js → stateDiagram-FKZM4ZOC-CPxroWXd.js} +15 -15
  179. package/dist/{stateDiagram-v2-4FDKWEC3-A43Itnjp.js → stateDiagram-v2-4FDKWEC3-BpM9Q54b.js} +13 -13
  180. package/dist/{step-1PmBKr2y.js → step-BqVgkWtk.js} +1 -1
  181. package/dist/stylus-DvSovJEP.js +4 -0
  182. package/dist/swift-D-_E7Yyb.js +4 -0
  183. package/dist/tcl-Di5sAVHN.js +4 -0
  184. package/dist/textile-Benwt66z.js +4 -0
  185. package/dist/{time-DC4qQGmA.js → time-CrYsYnQU.js} +4 -4
  186. package/dist/{timeline-definition-IT6M3QCI-DR26eWb4.js → timeline-definition-IT6M3QCI-CVnRHx_t.js} +3 -3
  187. package/dist/toml-CeOvPOkY.js +4 -0
  188. package/dist/troff-DJN9hfgu.js +4 -0
  189. package/dist/ttcn-DQW2Psjf.js +4 -0
  190. package/dist/ttcn-cfg-zFG_MNpg.js +4 -0
  191. package/dist/turtle-DHRyNlSc.js +4 -0
  192. package/dist/{types-Bb-6p8hv.js → types-Ckva8JJq.js} +203 -156
  193. package/dist/{useDeepCompareMemoize-BhZZsis0.js → useDeepCompareMemoize-ChviuF5n.js} +1 -1
  194. package/dist/vb-CXWH9DD-.js +4 -0
  195. package/dist/vbscript-qr8qVck5.js +4 -0
  196. package/dist/{vega-component-DCxUyPnb.js → vega-component-CnG0vAjf.js} +7 -7
  197. package/dist/{vega-loader.browser-BJ1uJidF.js → vega-loader.browser-DqHiiBeQ.js} +3 -3
  198. package/dist/velocity-C_9pUJRx.js +4 -0
  199. package/dist/verilog-DxBstgBa.js +4 -0
  200. package/dist/vhdl-odUxAbE6.js +4 -0
  201. package/dist/webidl-Dfn5Rku4.js +4 -0
  202. package/dist/xquery-CrJs6SXr.js +4 -0
  203. package/dist/{xychartDiagram-PRI3JC2R-BcVxCRox.js → xychartDiagram-PRI3JC2R-BltwMWKC.js} +11 -11
  204. package/dist/yacas-B-uDDLZe.js +4 -0
  205. package/dist/z80-51gxgAXE.js +4 -0
  206. package/package.json +10 -11
  207. package/src/components/data-table/__tests__/columns.test.tsx +47 -0
  208. package/src/components/data-table/column-header.tsx +3 -0
  209. package/src/components/data-table/columns.tsx +17 -2
  210. package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
  211. package/src/core/codemirror/misc/__tests__/paste.test.ts +18 -0
  212. package/src/core/codemirror/misc/paste.ts +14 -10
  213. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -0
  214. package/src/plugins/impl/chat/chat-ui.tsx +10 -1
  215. package/src/plugins/impl/plotly/Plot.tsx +171 -0
  216. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +5 -10
  217. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +1 -0
  218. package/src/plugins/impl/plotly/__tests__/usePlotlyLayout.test.ts +2 -1
  219. package/src/plugins/impl/plotly/parse-from-template.ts +1 -0
  220. package/src/plugins/impl/plotly/usePlotlyLayout.ts +2 -1
  221. package/src/theme/ThemeProvider.tsx +2 -0
  222. package/dist/apl-BuwKwesW.js +0 -4
  223. package/dist/asciiarmor-zAEd_wtn.js +0 -4
  224. package/dist/asn1-DWEA66J4.js +0 -4
  225. package/dist/brainfuck-mIPR6Ong.js +0 -4
  226. package/dist/classDiagram-2ON5EDUG-B9pkKjjc.js +0 -30
  227. package/dist/classDiagram-v2-WZHVMYZB-CRhhA0tV.js +0 -30
  228. package/dist/clojure-DkhhNHNQ.js +0 -4
  229. package/dist/cmake-1obPvqtc.js +0 -4
  230. package/dist/cobol-oWNTiXPE.js +0 -4
  231. package/dist/coffeescript-LtYUvf6r.js +0 -4
  232. package/dist/commonlisp-C_06qBYF.js +0 -4
  233. package/dist/crystal-CDJkbx14.js +0 -4
  234. package/dist/css-Bi_Nk0uN.js +0 -4
  235. package/dist/cypher-TrG0NvZ0.js +0 -4
  236. package/dist/d-CFKOrZsi.js +0 -4
  237. package/dist/diff-CfnSF48q.js +0 -4
  238. package/dist/dist-2OSzSqy2.js +0 -5
  239. package/dist/dist-B1H2TQGB.js +0 -8
  240. package/dist/dist-BNvasp6N.js +0 -5
  241. package/dist/dist-CFi_P6cs.js +0 -5
  242. package/dist/dist-CG4LWTPv.js +0 -8
  243. package/dist/dist-CHWVQZ6Z.js +0 -6
  244. package/dist/dist-C_8-swED.js +0 -5
  245. package/dist/dist-DIhtur5b.js +0 -5
  246. package/dist/dist-DoQ7RS4e.js +0 -5
  247. package/dist/dist-DsMd-F9h.js +0 -5
  248. package/dist/dist-DurmUshd.js +0 -8
  249. package/dist/dist-PZgrh2z6.js +0 -6
  250. package/dist/dist-g1p2PEVs.js +0 -1242
  251. package/dist/dist-wudNDAiO.js +0 -5
  252. package/dist/dist-zVskjQcA.js +0 -8
  253. package/dist/dtd-Ctw8_JkU.js +0 -4
  254. package/dist/dylan-f7rMBKDP.js +0 -4
  255. package/dist/ecl-C2h3oBMY.js +0 -4
  256. package/dist/eiffel-Ce81wv20.js +0 -4
  257. package/dist/elm-BVV8QQcc.js +0 -4
  258. package/dist/erlang-DjB35ZUh.js +0 -4
  259. package/dist/factor-CIcp3U2B.js +0 -4
  260. package/dist/forth-CVgjsHhD.js +0 -4
  261. package/dist/fortran-CcTXj0d_.js +0 -4
  262. package/dist/gas-JWpamkLf.js +0 -4
  263. package/dist/gherkin-BveSCSJV.js +0 -4
  264. package/dist/groovy-Np3AZt00.js +0 -4
  265. package/dist/haskell-CVfmFALm.js +0 -4
  266. package/dist/haxe-C10xkMLg.js +0 -5
  267. package/dist/idl-CKBSGnKC.js +0 -4
  268. package/dist/javascript-Cur-15Bn.js +0 -4
  269. package/dist/julia-BZZH2Gnx.js +0 -4
  270. package/dist/livescript-D_rTTm_U.js +0 -4
  271. package/dist/lua-Mf_Of7eV.js +0 -4
  272. package/dist/mathematica-DCYjugDb.js +0 -4
  273. package/dist/mbox-KBWrT8JD.js +0 -4
  274. package/dist/mirc-JwEQJ8Fb.js +0 -4
  275. package/dist/mllike-C7TxLvh6.js +0 -6
  276. package/dist/modelica-uvNgvUyw.js +0 -4
  277. package/dist/mscgen-CGnokp5x.js +0 -6
  278. package/dist/mumps-Dl9QdOZz.js +0 -4
  279. package/dist/nsis-BbDhbgPN.js +0 -4
  280. package/dist/ntriples-ChL1mlp7.js +0 -4
  281. package/dist/octave-B9ZGG6zv.js +0 -4
  282. package/dist/oz-XHEu31wr.js +0 -4
  283. package/dist/pascal-BxtYw-iH.js +0 -4
  284. package/dist/perl-Br5BgHPb.js +0 -4
  285. package/dist/pig-BByO2hBz.js +0 -4
  286. package/dist/powershell-Cd4Zaef3.js +0 -4
  287. package/dist/prop-types-C9QZf2SY.js +0 -51
  288. package/dist/properties-B-BOCIOl.js +0 -4
  289. package/dist/protobuf-CaLimlho.js +0 -4
  290. package/dist/pug-bonARSG6.js +0 -4
  291. package/dist/puppet-BSlT-3sc.js +0 -4
  292. package/dist/python-BIJhGYYP.js +0 -4
  293. package/dist/q-D9TX8A0B.js +0 -4
  294. package/dist/r-BXelX7Rl.js +0 -4
  295. package/dist/react-vega-3WcLHYC7.js +0 -9
  296. package/dist/rpm-BxAh9B1A.js +0 -5
  297. package/dist/ruby-BCZLQyhc.js +0 -4
  298. package/dist/sas-Bo7lsyNX.js +0 -4
  299. package/dist/scheme-Brhptkt-.js +0 -4
  300. package/dist/shell-fWWb8_qx.js +0 -4
  301. package/dist/sieve-Ba8_hMLn.js +0 -4
  302. package/dist/smalltalk-7sHxwMDT.js +0 -4
  303. package/dist/sparql-BBFrPJ7z.js +0 -4
  304. package/dist/stylus-CIB0KT46.js +0 -4
  305. package/dist/swift-CZinekXz.js +0 -4
  306. package/dist/tcl-DCHZJVq_.js +0 -4
  307. package/dist/textile-ThTMxgkN.js +0 -4
  308. package/dist/toml-DK17wlJ7.js +0 -4
  309. package/dist/troff-CuUAOgMy.js +0 -4
  310. package/dist/ttcn-DS2tj6rW.js +0 -4
  311. package/dist/ttcn-cfg-CdZGarnc.js +0 -4
  312. package/dist/turtle-Bkz-FLZ7.js +0 -4
  313. package/dist/vb-ITdOmxvR.js +0 -4
  314. package/dist/vbscript-B7oeGyfL.js +0 -4
  315. package/dist/velocity-D__EkuSd.js +0 -4
  316. package/dist/verilog-CPH50gr9.js +0 -4
  317. package/dist/vhdl-CQAwKCk_.js +0 -4
  318. package/dist/webidl-BnEptfVX.js +0 -4
  319. package/dist/xquery-D7eTv-CR.js +0 -4
  320. package/dist/yacas-0x1rX89s.js +0 -4
  321. package/dist/z80-B25SJVDf.js +0 -4
  322. /package/dist/{ImageComparisonComponent-DkEXPki_.js → ImageComparisonComponent-CRbA-1eg.js} +0 -0
  323. /package/dist/{apl-D9gTcP3Q.js → apl-Oc3bL26_.js} +0 -0
  324. /package/dist/{array-D7wW5QoO.js → array-CEIRxyh3.js} +0 -0
  325. /package/dist/{asciiarmor-mLyg-Z5h.js → asciiarmor-DTbPh2VI.js} +0 -0
  326. /package/dist/{asn1-AE7eHomk.js → asn1-CGhwu1Ri.js} +0 -0
  327. /package/dist/{brainfuck-Bdd6NcL6.js → brainfuck-CA0L8lRq.js} +0 -0
  328. /package/dist/{click-outside-container-DNfggvIW.js → click-outside-container-C_k38vlR.js} +0 -0
  329. /package/dist/{clike-D_s3fKg5.js → clike-CEtUBPHD.js} +0 -0
  330. /package/dist/{clojure-zTYBCd80.js → clojure-BszjvdGo.js} +0 -0
  331. /package/dist/{cmake-BnJV90fC.js → cmake-B2Gvps8b.js} +0 -0
  332. /package/dist/{cobol-CH0OZO8A.js → cobol-DuMch8nn.js} +0 -0
  333. /package/dist/{coffeescript-CLhc1U6Q.js → coffeescript-L9aKXVsJ.js} +0 -0
  334. /package/dist/{colors-6DRQ0kEF.js → colors-DR_aHfmQ.js} +0 -0
  335. /package/dist/{commonlisp-8K2-IkUD.js → commonlisp-CrtdssxB.js} +0 -0
  336. /package/dist/{crystal-8to4H-ep.js → crystal-vvNY0LpY.js} +0 -0
  337. /package/dist/{css-BVo-JOy5.js → css-B1GdzqT1.js} +0 -0
  338. /package/dist/{cypher-BTFaDDd_.js → cypher-BtZvV7bW.js} +0 -0
  339. /package/dist/{d-c9bddW2W.js → d-B0UN3V-Z.js} +0 -0
  340. /package/dist/{defaultLocale-Bxoo2-30.js → defaultLocale-B_A76Zpk.js} +0 -0
  341. /package/dist/{defaultLocale-qS7DaAmi.js → defaultLocale-DjFHq3Xk.js} +0 -0
  342. /package/dist/{diff-PA28xMKg.js → diff-DOpgjj1W.js} +0 -0
  343. /package/dist/{dist-BBYTEAvO.js → dist-DF_77D2B.js} +0 -0
  344. /package/dist/{dtd-DRlC7Bx8.js → dtd-Ctnjxrle.js} +0 -0
  345. /package/dist/{dylan-d5ufc25E.js → dylan-DFXkoaZy.js} +0 -0
  346. /package/dist/{ecl-Ci3afVKc.js → ecl-C1NExZip.js} +0 -0
  347. /package/dist/{eiffel-G6DmeEi3.js → eiffel-uXVGgleg.js} +0 -0
  348. /package/dist/{elm-ByYWHu8b.js → elm-CBOFnnib.js} +0 -0
  349. /package/dist/{erlang-C7_LcVDw.js → erlang-DMnrT8XK.js} +0 -0
  350. /package/dist/{esm-CAd2HmbR.js → esm-0_ieXYNc.js} +0 -0
  351. /package/dist/{forth-BgUerAyz.js → forth-DDpxS4nw.js} +0 -0
  352. /package/dist/{fortran-BCXxm4xF.js → fortran-B6uYqQMz.js} +0 -0
  353. /package/dist/{gas-CKTQRKLl.js → gas-BKnWzuFz.js} +0 -0
  354. /package/dist/{gherkin-ByVP9cY_.js → gherkin-pBt0wT4X.js} +0 -0
  355. /package/dist/{groovy-BPbrw0GZ.js → groovy-DKsn4ppB.js} +0 -0
  356. /package/dist/{haskell-B8fq1DW4.js → haskell-BJVBJQcy.js} +0 -0
  357. /package/dist/{haxe-B7SHQmJo.js → haxe-rLN5UZU5.js} +0 -0
  358. /package/dist/{idl-CeJBDjsl.js → idl-B4mwMAo-.js} +0 -0
  359. /package/dist/{init-BfRhston.js → init-TaqZJsBY.js} +0 -0
  360. /package/dist/{javascript-dCv9_Kn8.js → javascript-Hf2NLNC0.js} +0 -0
  361. /package/dist/{julia-CD5lO88_.js → julia-GGpx21YN.js} +0 -0
  362. /package/dist/{katex-Db0k5oV_.js → katex-Ba7xZPrx.js} +0 -0
  363. /package/dist/{livescript-Cc8RvFBv.js → livescript-CSvXMspZ.js} +0 -0
  364. /package/dist/{lua-4nedfnvd.js → lua-CVMR5LMW.js} +0 -0
  365. /package/dist/{math-BbMyrONz.js → math-CTnb-N1W.js} +0 -0
  366. /package/dist/{mathematica-BIufdZr2.js → mathematica-JENNt-p4.js} +0 -0
  367. /package/dist/{mbox-DQkYSHKe.js → mbox-mzifoc8E.js} +0 -0
  368. /package/dist/{mirc-CI-RWqUR.js → mirc-BXoiItvN.js} +0 -0
  369. /package/dist/{mllike-DQzbf1xo.js → mllike-H-KR9OuH.js} +0 -0
  370. /package/dist/{modelica-BnF_cDWj.js → modelica-B6Hm3mMl.js} +0 -0
  371. /package/dist/{mscgen-MirFrDhW.js → mscgen-D8TF_Hei.js} +0 -0
  372. /package/dist/{mumps-eNRTuWOD.js → mumps-CD-kNPt4.js} +0 -0
  373. /package/dist/{ntriples-BLneip4i.js → ntriples-DgnpxU40.js} +0 -0
  374. /package/dist/{octave-C0eG-pKq.js → octave-CkobqyVm.js} +0 -0
  375. /package/dist/{oz-BPMLow2T.js → oz-ChDLd9tS.js} +0 -0
  376. /package/dist/{pascal-5eb9v5Dl.js → pascal-CvlkwK7E.js} +0 -0
  377. /package/dist/{path-C_x2ySFi.js → path-7gr7eZmp.js} +0 -0
  378. /package/dist/{perl-DOu6rCkF.js → perl-BNEFTNbM.js} +0 -0
  379. /package/dist/{pig-CRW0kne3.js → pig-Cd1DMS7P.js} +0 -0
  380. /package/dist/{powershell-CWgJhiiJ.js → powershell-CPxA0zpc.js} +0 -0
  381. /package/dist/{properties-CHxpmfXW.js → properties-BaFBm-Xa.js} +0 -0
  382. /package/dist/{protobuf-DGUXb_-T.js → protobuf-BQV_-X0H.js} +0 -0
  383. /package/dist/{puppet-C7uSiW6_.js → puppet-LXLST0mx.js} +0 -0
  384. /package/dist/{python-DAbhVcUr.js → python-DLjLzX4k.js} +0 -0
  385. /package/dist/{q-DKjWHias.js → q-DswTX1Y9.js} +0 -0
  386. /package/dist/{r-KD2KhyeL.js → r-CO7NpMwE.js} +0 -0
  387. /package/dist/{range-BYuZFTbA.js → range-DwpxnYuB.js} +0 -0
  388. /package/dist/{rpm-GFtnpQ6M.js → rpm-BlmEDT6r.js} +0 -0
  389. /package/dist/{ruby-CBAewzLY.js → ruby-BTPKgeZZ.js} +0 -0
  390. /package/dist/{sas-CCi_AaZi.js → sas-DTDTiNO8.js} +0 -0
  391. /package/dist/{scheme-CGGGD6kR.js → scheme-UzAAg4GJ.js} +0 -0
  392. /package/dist/{shell-b7vZ8ucI.js → shell-DQ0hQCsB.js} +0 -0
  393. /package/dist/{sieve-ClXOUV85.js → sieve-BVyYIx9u.js} +0 -0
  394. /package/dist/{simple-mode-Uad4lEG7.js → simple-mode-Dryu-fC9.js} +0 -0
  395. /package/dist/{slides-component-Dp-y50K9.js → slides-component-DfwLApNr.js} +0 -0
  396. /package/dist/{smalltalk-_PFt9_gp.js → smalltalk-DAdMAHTu.js} +0 -0
  397. /package/dist/{sparql-BCF6qcHt.js → sparql-Bi7quYgw.js} +0 -0
  398. /package/dist/{stylus-DMFZWz-G.js → stylus-jhpzcQ6Y.js} +0 -0
  399. /package/dist/{swift-De2YpSxT.js → swift-BrO8qThZ.js} +0 -0
  400. /package/dist/{tcl-jV8Xs_1k.js → tcl-s5QI5gv3.js} +0 -0
  401. /package/dist/{textile-D_zo778l.js → textile-ClhvJrxM.js} +0 -0
  402. /package/dist/{timer-pEiW44EO.js → timer-DV8t68ti.js} +0 -0
  403. /package/dist/{toml-_M0gsKn5.js → toml-TFa3EJQE.js} +0 -0
  404. /package/dist/{treemap-BzS5cW_6.js → treemap-CQJ0bIDy.js} +0 -0
  405. /package/dist/{troff-B06gyD33.js → troff-SqLg0heF.js} +0 -0
  406. /package/dist/{ttcn-DoQoQNUM.js → ttcn-Cfrap7HJ.js} +0 -0
  407. /package/dist/{ttcn-cfg-l_6PksD2.js → ttcn-cfg-Dopc-iwE.js} +0 -0
  408. /package/dist/{turtle-zEnD4bpn.js → turtle-Dt52DvVH.js} +0 -0
  409. /package/dist/{useAsyncData-Dyq3DyOF.js → useAsyncData-dr8GazGv.js} +0 -0
  410. /package/dist/{vb-fUsnAuzb.js → vb-D1pAvfDe.js} +0 -0
  411. /package/dist/{vbscript-CVlD7uZQ.js → vbscript-DZ7RBxn5.js} +0 -0
  412. /package/dist/{velocity-CHkEIdMC.js → velocity-Csau7eZy.js} +0 -0
  413. /package/dist/{verilog-B3ctZTB4.js → verilog-gXlZACs5.js} +0 -0
  414. /package/dist/{vhdl-rXdBgR5O.js → vhdl-NaUWbI1B.js} +0 -0
  415. /package/dist/{webidl-Cv9aQfcc.js → webidl-BJmPjW01.js} +0 -0
  416. /package/dist/{xquery-Du0w47aa.js → xquery-CJIPsC0g.js} +0 -0
  417. /package/dist/{yacas-Eq4p_g3L.js → yacas-8f2Vjiiz.js} +0 -0
  418. /package/dist/{z80-Dz4HTTRf.js → z80-s5Xk2hCP.js} +0 -0
@@ -6,264 +6,263 @@ import { t as Check } from "./check-DkNR52Mm.js";
6
6
  import { l as Events, u as cn } from "./button-Cy0ElmIm.js";
7
7
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
8
8
  import { l as Tooltip } from "./error-banner-D2zjeN_a.js";
9
- import { $ as ViewPlugin, A as indentString, At as RangeSet, B as tags, Bt as countColumn, C as foldKeymap, Ct as CharCategory, D as getIndentation, Dt as Facet, E as getIndentUnit, Et as EditorState, F as syntaxHighlighting, Ft as Text, H as NodeProp, Ht as fromCodePoint, I as syntaxTree, It as Transaction, J as parseMixed, Lt as codePointAt, N as matchBrackets, Nt as StateEffect, O as indentNodeProp, Pt as StateField, R as Tag, Rt as codePointSize, S as foldInside, St as ChangeSet, Tt as EditorSelection, Vt as findClusterBreak, X as Direction, Y as Decoration, Z as EditorView, _t as showPanel, a as HighlightStyle, bt as Annotation, ct as highlightActiveLineGutter, dt as keymap, et as WidgetType, f as StreamLanguage, ft as lineNumbers, g as defaultHighlightStyle, gt as runScopeHandlers, h as continuedIndent, ht as rectangularSelection, it as getPanel, j as indentUnit, jt as RangeSetBuilder, k as indentOnInput, kt as Prec, lt as highlightSpecialChars, mt as placeholder, n as ExternalTokenizer, nt as drawSelection, o as IndentContext, p as bracketMatching, pt as logException, r as LRParser, rt as dropCursor, s as LRLanguage, st as highlightActiveLine, t as ContextTracker, tt as crosshairCursor, u as LanguageSupport, ut as hoverTooltip, v as delimitedIndent, w as foldNodeProp, x as foldGutter, xt as ChangeDesc, yt as crelt, z as styleTags, zt as combineConfig } from "./dist-D7jHtwN8.js";
10
- import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-g1p2PEVs.js";
11
- import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-CPd_adhw.js";
12
- import { a as markdown } from "./dist-CBA36Nuy.js";
13
- import { n as html, r as htmlCompletionSource } from "./dist-COp5dkis.js";
14
- import { r as cssLanguage, t as css } from "./dist-BSMZYwqW.js";
15
- import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-DsqQCNKw.js";
16
- import { r as python } from "./dist-l0KayR2-.js";
9
+ import { $ as ViewPlugin, A as indentString, At as Prec, B as tags, Bt as combineConfig, C as foldKeymap, Ct as ChangeSet, D as getIndentation, Dt as EditorState, E as getIndentUnit, Et as EditorSelection, F as syntaxHighlighting, Ft as StateField, H as NodeProp, Ht as findClusterBreak, I as syntaxTree, It as Text, J as parseMixed, Lt as Transaction, Mt as RangeSetBuilder, N as matchBrackets, O as indentNodeProp, Ot as Facet, Pt as StateEffect, R as Tag, Rt as codePointAt, S as foldInside, St as ChangeDesc, Ut as fromCodePoint, Vt as countColumn, X as Direction, Y as Decoration, Z as EditorView, _t as showDialog, a as HighlightStyle, bt as crelt, ct as highlightActiveLineGutter, dt as keymap, et as WidgetType, f as StreamLanguage, ft as lineNumbers, g as defaultHighlightStyle, gt as runScopeHandlers, h as continuedIndent, ht as rectangularSelection, it as getPanel, j as indentUnit, jt as RangeSet, k as indentOnInput, lt as highlightSpecialChars, mt as placeholder, n as ExternalTokenizer, nt as drawSelection, o as IndentContext, p as bracketMatching, pt as logException, r as LRParser, rt as dropCursor, s as LRLanguage, st as highlightActiveLine, t as ContextTracker, tt as crosshairCursor, u as LanguageSupport, ut as hoverTooltip, v as delimitedIndent, vt as showPanel, w as foldNodeProp, wt as CharCategory, x as foldGutter, xt as Annotation, z as styleTags, zt as codePointSize } from "./dist-r8ecBV-v.js";
10
+ import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-Dit9tk8a.js";
11
+ import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-Dc1SFk5I.js";
12
+ import { a as markdown } from "./dist-B2-r9y-0.js";
13
+ import { n as html, r as htmlCompletionSource } from "./dist-CJrHMxlI.js";
14
+ import { r as cssLanguage, t as css } from "./dist-Cgf353Ki.js";
15
+ import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-C2-m5aEk.js";
16
+ import { r as python } from "./dist-BLwfpZD-.js";
17
17
  import { t as stex } from "./stex-DrxP7bb3.js";
18
- import { t as cpp } from "./dist-9J8_3DZN.js";
19
- import { t as go } from "./dist-CsN7lsea.js";
20
- import { t as java } from "./dist-BbQ-5HAA.js";
21
- import { n as jinja } from "./dist-BcXuIt-h.js";
22
- import { t as json } from "./dist-Cpj5BHNP.js";
23
- import { t as less } from "./dist-DA1J6LvO.js";
24
- import { n as liquid } from "./dist-b7Sc3Tj8.js";
25
- import { t as php } from "./dist--JwRU9u5.js";
26
- import { t as rust } from "./dist-DIVeCGlI.js";
27
- import { t as sass } from "./dist-C6p7UKkB.js";
28
- import { t as wast } from "./dist-BKGWAN8J.js";
29
- import { r as xml } from "./dist-9trj4p6n.js";
30
- import { t as yaml } from "./dist-MFzhAmKV.js";
31
- import { t as apl } from "./apl-D9gTcP3Q.js";
32
- import { t as asciiArmor } from "./asciiarmor-mLyg-Z5h.js";
33
- import { t as asn1 } from "./asn1-AE7eHomk.js";
34
- import { t as brainfuck } from "./brainfuck-Bdd6NcL6.js";
35
- import { t as cobol } from "./cobol-CH0OZO8A.js";
36
- import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-D_s3fKg5.js";
37
- import { t as clojure } from "./clojure-zTYBCd80.js";
38
- import { t as gss } from "./css-BVo-JOy5.js";
39
- import { t as cmake } from "./cmake-BnJV90fC.js";
40
- import { t as coffeeScript } from "./coffeescript-CLhc1U6Q.js";
41
- import { t as commonLisp } from "./commonlisp-8K2-IkUD.js";
42
- import { t as cypher } from "./cypher-BTFaDDd_.js";
43
- import { t as cython } from "./python-DAbhVcUr.js";
44
- import { t as crystal } from "./crystal-8to4H-ep.js";
45
- import { t as d } from "./d-c9bddW2W.js";
46
- import { t as diff } from "./diff-PA28xMKg.js";
47
- import { t as dtd } from "./dtd-DRlC7Bx8.js";
48
- import { t as dylan } from "./dylan-d5ufc25E.js";
49
- import { t as ecl } from "./ecl-Ci3afVKc.js";
50
- import { t as eiffel } from "./eiffel-G6DmeEi3.js";
51
- import { t as elm } from "./elm-ByYWHu8b.js";
52
- import { t as erlang } from "./erlang-C7_LcVDw.js";
53
- import { t as factor } from "./factor-DdqWbSyy.js";
54
- import { t as forth } from "./forth-BgUerAyz.js";
55
- import { t as fortran } from "./fortran-BCXxm4xF.js";
56
- import { n as oCaml, r as sml, t as fSharp } from "./mllike-DQzbf1xo.js";
57
- import { t as gas } from "./gas-CKTQRKLl.js";
58
- import { t as gherkin } from "./gherkin-ByVP9cY_.js";
59
- import { t as groovy } from "./groovy-BPbrw0GZ.js";
60
- import { t as haskell } from "./haskell-B8fq1DW4.js";
61
- import { n as hxml, t as haxe } from "./haxe-B7SHQmJo.js";
62
- import { t as idl } from "./idl-CeJBDjsl.js";
63
- import { n as jsonld } from "./javascript-dCv9_Kn8.js";
64
- import { t as julia } from "./julia-CD5lO88_.js";
65
- import { t as liveScript } from "./livescript-Cc8RvFBv.js";
66
- import { t as lua } from "./lua-4nedfnvd.js";
67
- import { t as mirc } from "./mirc-CI-RWqUR.js";
68
- import { t as mathematica } from "./mathematica-BIufdZr2.js";
69
- import { t as modelica } from "./modelica-BnF_cDWj.js";
70
- import { t as mumps } from "./mumps-eNRTuWOD.js";
71
- import { t as mbox } from "./mbox-DQkYSHKe.js";
72
- import { t as nsis } from "./nsis-CunMjZ_n.js";
73
- import { t as ntriples } from "./ntriples-BLneip4i.js";
74
- import { t as octave } from "./octave-C0eG-pKq.js";
75
- import { t as oz } from "./oz-BPMLow2T.js";
76
- import { t as pascal } from "./pascal-5eb9v5Dl.js";
77
- import { t as perl } from "./perl-DOu6rCkF.js";
78
- import { t as pig } from "./pig-CRW0kne3.js";
79
- import { t as powerShell } from "./powershell-CWgJhiiJ.js";
80
- import { t as properties } from "./properties-CHxpmfXW.js";
81
- import { t as protobuf } from "./protobuf-DGUXb_-T.js";
82
- import { t as pug } from "./pug-Dr-sA_9V.js";
83
- import { t as puppet } from "./puppet-C7uSiW6_.js";
84
- import { t as q } from "./q-DKjWHias.js";
85
- import { t as r } from "./r-KD2KhyeL.js";
86
- import { n as rpmSpec } from "./rpm-GFtnpQ6M.js";
87
- import { t as ruby } from "./ruby-CBAewzLY.js";
88
- import { t as sas } from "./sas-CCi_AaZi.js";
89
- import { t as scheme } from "./scheme-CGGGD6kR.js";
90
- import { t as shell } from "./shell-b7vZ8ucI.js";
91
- import { t as sieve } from "./sieve-ClXOUV85.js";
92
- import { t as smalltalk } from "./smalltalk-_PFt9_gp.js";
93
- import { t as sparql } from "./sparql-BCF6qcHt.js";
94
- import { t as stylus } from "./stylus-DMFZWz-G.js";
95
- import { t as swift } from "./swift-De2YpSxT.js";
96
- import { t as verilog } from "./verilog-B3ctZTB4.js";
97
- import { t as tcl } from "./tcl-jV8Xs_1k.js";
98
- import { t as textile } from "./textile-D_zo778l.js";
99
- import { t as toml } from "./toml-_M0gsKn5.js";
100
- import { t as troff } from "./troff-B06gyD33.js";
101
- import { t as ttcn } from "./ttcn-DoQoQNUM.js";
102
- import { t as ttcnCfg } from "./ttcn-cfg-l_6PksD2.js";
103
- import { t as turtle } from "./turtle-zEnD4bpn.js";
104
- import { t as webIDL } from "./webidl-Cv9aQfcc.js";
105
- import { t as vb } from "./vb-fUsnAuzb.js";
106
- import { t as vbScript } from "./vbscript-CVlD7uZQ.js";
107
- import { t as velocity } from "./velocity-CHkEIdMC.js";
108
- import { t as vhdl } from "./vhdl-rXdBgR5O.js";
109
- import { t as xQuery } from "./xquery-Du0w47aa.js";
110
- import { t as yacas } from "./yacas-Eq4p_g3L.js";
111
- import { t as z80 } from "./z80-Dz4HTTRf.js";
112
- import { n as msgenny, r as xu, t as mscgen } from "./mscgen-MirFrDhW.js";
113
- import { t as vue } from "./dist--Em7gfgX.js";
18
+ import { t as cpp } from "./dist-iiugPhCC.js";
19
+ import { t as go } from "./dist-BoAHOW2l.js";
20
+ import { t as java } from "./dist-CPTE45iS.js";
21
+ import { n as jinja } from "./dist-Bsv_ARko.js";
22
+ import { t as json } from "./dist-BbBnU4tG.js";
23
+ import { t as less } from "./dist-B5ATpkxy.js";
24
+ import { n as liquid } from "./dist-Crk9ejOy.js";
25
+ import { t as php } from "./dist-B4tYJP_i.js";
26
+ import { t as rust } from "./dist-CC9VUnXd.js";
27
+ import { t as sass } from "./dist-CkEUrAus.js";
28
+ import { t as wast } from "./dist-CE43BRmt.js";
29
+ import { r as xml } from "./dist-CcOGT46m.js";
30
+ import { t as yaml } from "./dist-CmZYrgd_.js";
31
+ import { t as apl } from "./apl-Oc3bL26_.js";
32
+ import { t as asciiArmor } from "./asciiarmor-DTbPh2VI.js";
33
+ import { t as asn1 } from "./asn1-CGhwu1Ri.js";
34
+ import { t as brainfuck } from "./brainfuck-CA0L8lRq.js";
35
+ import { t as cobol } from "./cobol-DuMch8nn.js";
36
+ import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-CEtUBPHD.js";
37
+ import { t as clojure } from "./clojure-BszjvdGo.js";
38
+ import { t as gss } from "./css-B1GdzqT1.js";
39
+ import { t as cmake } from "./cmake-B2Gvps8b.js";
40
+ import { t as coffeeScript } from "./coffeescript-L9aKXVsJ.js";
41
+ import { t as commonLisp } from "./commonlisp-CrtdssxB.js";
42
+ import { t as cypher } from "./cypher-BtZvV7bW.js";
43
+ import { t as cython } from "./python-DLjLzX4k.js";
44
+ import { t as crystal } from "./crystal-vvNY0LpY.js";
45
+ import { t as d } from "./d-B0UN3V-Z.js";
46
+ import { t as diff } from "./diff-DOpgjj1W.js";
47
+ import { t as dtd } from "./dtd-Ctnjxrle.js";
48
+ import { t as dylan } from "./dylan-DFXkoaZy.js";
49
+ import { t as ecl } from "./ecl-C1NExZip.js";
50
+ import { t as eiffel } from "./eiffel-uXVGgleg.js";
51
+ import { t as elm } from "./elm-CBOFnnib.js";
52
+ import { t as erlang } from "./erlang-DMnrT8XK.js";
53
+ import { t as factor } from "./factor--4HHM8Rw.js";
54
+ import { t as forth } from "./forth-DDpxS4nw.js";
55
+ import { t as fortran } from "./fortran-B6uYqQMz.js";
56
+ import { n as oCaml, r as sml, t as fSharp } from "./mllike-H-KR9OuH.js";
57
+ import { t as gas } from "./gas-BKnWzuFz.js";
58
+ import { t as gherkin } from "./gherkin-pBt0wT4X.js";
59
+ import { t as groovy } from "./groovy-DKsn4ppB.js";
60
+ import { t as haskell } from "./haskell-BJVBJQcy.js";
61
+ import { n as hxml, t as haxe } from "./haxe-rLN5UZU5.js";
62
+ import { t as idl } from "./idl-B4mwMAo-.js";
63
+ import { n as jsonld } from "./javascript-Hf2NLNC0.js";
64
+ import { t as julia } from "./julia-GGpx21YN.js";
65
+ import { t as liveScript } from "./livescript-CSvXMspZ.js";
66
+ import { t as lua } from "./lua-CVMR5LMW.js";
67
+ import { t as mirc } from "./mirc-BXoiItvN.js";
68
+ import { t as mathematica } from "./mathematica-JENNt-p4.js";
69
+ import { t as modelica } from "./modelica-B6Hm3mMl.js";
70
+ import { t as mumps } from "./mumps-CD-kNPt4.js";
71
+ import { t as mbox } from "./mbox-mzifoc8E.js";
72
+ import { t as nsis } from "./nsis-B6EN9LWI.js";
73
+ import { t as ntriples } from "./ntriples-DgnpxU40.js";
74
+ import { t as octave } from "./octave-CkobqyVm.js";
75
+ import { t as oz } from "./oz-ChDLd9tS.js";
76
+ import { t as pascal } from "./pascal-CvlkwK7E.js";
77
+ import { t as perl } from "./perl-BNEFTNbM.js";
78
+ import { t as pig } from "./pig-Cd1DMS7P.js";
79
+ import { t as powerShell } from "./powershell-CPxA0zpc.js";
80
+ import { t as properties } from "./properties-BaFBm-Xa.js";
81
+ import { t as protobuf } from "./protobuf-BQV_-X0H.js";
82
+ import { t as pug } from "./pug-xrm7jQ2R.js";
83
+ import { t as puppet } from "./puppet-LXLST0mx.js";
84
+ import { t as q } from "./q-DswTX1Y9.js";
85
+ import { t as r } from "./r-CO7NpMwE.js";
86
+ import { n as rpmSpec } from "./rpm-BlmEDT6r.js";
87
+ import { t as ruby } from "./ruby-BTPKgeZZ.js";
88
+ import { t as sas } from "./sas-DTDTiNO8.js";
89
+ import { t as scheme } from "./scheme-UzAAg4GJ.js";
90
+ import { t as shell } from "./shell-DQ0hQCsB.js";
91
+ import { t as sieve } from "./sieve-BVyYIx9u.js";
92
+ import { t as smalltalk } from "./smalltalk-DAdMAHTu.js";
93
+ import { t as sparql } from "./sparql-Bi7quYgw.js";
94
+ import { t as stylus } from "./stylus-jhpzcQ6Y.js";
95
+ import { t as swift } from "./swift-BrO8qThZ.js";
96
+ import { t as verilog } from "./verilog-gXlZACs5.js";
97
+ import { t as tcl } from "./tcl-s5QI5gv3.js";
98
+ import { t as textile } from "./textile-ClhvJrxM.js";
99
+ import { t as toml } from "./toml-TFa3EJQE.js";
100
+ import { t as troff } from "./troff-SqLg0heF.js";
101
+ import { t as ttcn } from "./ttcn-Cfrap7HJ.js";
102
+ import { t as ttcnCfg } from "./ttcn-cfg-Dopc-iwE.js";
103
+ import { t as turtle } from "./turtle-Dt52DvVH.js";
104
+ import { t as webIDL } from "./webidl-BJmPjW01.js";
105
+ import { t as vb } from "./vb-D1pAvfDe.js";
106
+ import { t as vbScript } from "./vbscript-DZ7RBxn5.js";
107
+ import { t as velocity } from "./velocity-Csau7eZy.js";
108
+ import { t as vhdl } from "./vhdl-NaUWbI1B.js";
109
+ import { t as xQuery } from "./xquery-CJIPsC0g.js";
110
+ import { t as yacas } from "./yacas-8f2Vjiiz.js";
111
+ import { t as z80 } from "./z80-s5Xk2hCP.js";
112
+ import { n as msgenny, r as xu, t as mscgen } from "./mscgen-D8TF_Hei.js";
113
+ import { t as vue } from "./dist-T4g7Sr6e.js";
114
114
  var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
115
115
  const CopyClipboardIcon = (e6) => {
116
- let y = (0, import_compiler_runtime.c)(14), { value: b, className: D, buttonClassName: k, tooltip: A, toastTitle: j, ariaLabel: M } = e6, [N, P] = (0, import_react.useState)(false), F;
117
- y[0] !== j || y[1] !== b ? (F = Events.stopPropagation(async (e7) => {
118
- await copyToClipboard(typeof b == "function" ? b(e7) : b).then(() => {
119
- P(true), setTimeout(() => P(false), 2e3), j && toast({ title: j });
116
+ let b = (0, import_compiler_runtime.c)(14), { value: x, className: O, buttonClassName: A, tooltip: j, toastTitle: M, ariaLabel: N } = e6, [P, F] = (0, import_react.useState)(false), I;
117
+ b[0] !== M || b[1] !== x ? (I = Events.stopPropagation(async (e7) => {
118
+ await copyToClipboard(typeof x == "function" ? x(e7) : x).then(() => {
119
+ F(true), setTimeout(() => F(false), 2e3), M && toast({ title: M });
120
120
  });
121
- }), y[0] = j, y[1] = b, y[2] = F) : F = y[2];
122
- let I = F, L = M ?? "Copy to clipboard", R;
123
- y[3] !== D || y[4] !== N ? (R = N ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(D, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: D }), y[3] = D, y[4] = N, y[5] = R) : R = y[5];
124
- let z;
125
- y[6] !== k || y[7] !== I || y[8] !== L || y[9] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
121
+ }), b[0] = M, b[1] = x, b[2] = I) : I = b[2];
122
+ let L = I, R = N ?? "Copy to clipboard", z;
123
+ b[3] !== O || b[4] !== P ? (z = P ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(O, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: O }), b[3] = O, b[4] = P, b[5] = z) : z = b[5];
124
+ let B;
125
+ b[6] !== A || b[7] !== L || b[8] !== R || b[9] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
126
126
  type: "button",
127
- onClick: I,
128
- "aria-label": L,
129
- className: k,
130
- children: R
131
- }), y[6] = k, y[7] = I, y[8] = L, y[9] = R, y[10] = z) : z = y[10];
132
- let B = z;
133
- if (A === false) return B;
134
- let V = N ? "Copied!" : A ?? "Copy to clipboard", H;
135
- return y[11] !== B || y[12] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
136
- content: V,
127
+ onClick: L,
128
+ "aria-label": R,
129
+ className: A,
130
+ children: z
131
+ }), b[6] = A, b[7] = L, b[8] = R, b[9] = z, b[10] = B) : B = b[10];
132
+ let V = B;
133
+ if (j === false) return V;
134
+ let H = P ? "Copied!" : j ?? "Copy to clipboard", U;
135
+ return b[11] !== V || b[12] !== H ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
136
+ content: H,
137
137
  delayDuration: 400,
138
- children: B
139
- }), y[11] = B, y[12] = V, y[13] = H) : H = y[13], H;
138
+ children: V
139
+ }), b[11] = V, b[12] = H, b[13] = U) : U = b[13], U;
140
140
  };
141
141
  var toggleComment = (e6) => {
142
- let { state: y } = e6, b = y.doc.lineAt(y.selection.main.from), x = getConfig(e6.state, b.from);
143
- return x.line ? toggleLineComment(e6) : x.block ? toggleBlockCommentByLine(e6) : false;
142
+ let { state: b } = e6, x = b.doc.lineAt(b.selection.main.from), S = getConfig(e6.state, x.from);
143
+ return S.line ? toggleLineComment(e6) : S.block ? toggleBlockCommentByLine(e6) : false;
144
144
  };
145
- function command(e6, y) {
146
- return ({ state: b, dispatch: x }) => {
147
- if (b.readOnly) return false;
148
- let S = e6(y, b);
149
- return S ? (x(b.update(S)), true) : false;
145
+ function command(e6, b) {
146
+ return ({ state: x, dispatch: S }) => {
147
+ if (x.readOnly) return false;
148
+ let C = e6(b, x);
149
+ return C ? (S(x.update(C)), true) : false;
150
150
  };
151
151
  }
152
- var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6, y) => changeBlockComment(e6, y, selectedLineRanges(y)), 0);
153
- function getConfig(e6, y) {
154
- let b = e6.languageDataAt("commentTokens", y, 1);
155
- return b.length ? b[0] : {};
152
+ var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6, b) => changeBlockComment(e6, b, selectedLineRanges(b)), 0);
153
+ function getConfig(e6, b) {
154
+ let x = e6.languageDataAt("commentTokens", b, 1);
155
+ return x.length ? x[0] : {};
156
156
  }
157
157
  var SearchMargin = 50;
158
- function findBlockComment(e6, { open: y, close: b }, x, S) {
159
- let C = e6.sliceDoc(x - SearchMargin, x), w = e6.sliceDoc(S, S + SearchMargin), T = /\s*$/.exec(C)[0].length, E = /^\s*/.exec(w)[0].length, D = C.length - T;
160
- if (C.slice(D - y.length, D) == y && w.slice(E, E + b.length) == b) return {
158
+ function findBlockComment(e6, { open: b, close: x }, S, C) {
159
+ let w = e6.sliceDoc(S - SearchMargin, S), T = e6.sliceDoc(C, C + SearchMargin), E = /\s*$/.exec(w)[0].length, D = /^\s*/.exec(T)[0].length, O = w.length - E;
160
+ if (w.slice(O - b.length, O) == b && T.slice(D, D + x.length) == x) return {
161
161
  open: {
162
- pos: x - T,
163
- margin: T && 1
162
+ pos: S - E,
163
+ margin: E && 1
164
164
  },
165
165
  close: {
166
- pos: S + E,
167
- margin: E && 1
166
+ pos: C + D,
167
+ margin: D && 1
168
168
  }
169
169
  };
170
- let O, k;
171
- S - x <= 2 * SearchMargin ? O = k = e6.sliceDoc(x, S) : (O = e6.sliceDoc(x, x + SearchMargin), k = e6.sliceDoc(S - SearchMargin, S));
172
- let A = /^\s*/.exec(O)[0].length, j = /\s*$/.exec(k)[0].length, M = k.length - j - b.length;
173
- return O.slice(A, A + y.length) == y && k.slice(M, M + b.length) == b ? {
170
+ let k, A;
171
+ C - S <= 2 * SearchMargin ? k = A = e6.sliceDoc(S, C) : (k = e6.sliceDoc(S, S + SearchMargin), A = e6.sliceDoc(C - SearchMargin, C));
172
+ let j = /^\s*/.exec(k)[0].length, M = /\s*$/.exec(A)[0].length, N = A.length - M - x.length;
173
+ return k.slice(j, j + b.length) == b && A.slice(N, N + x.length) == x ? {
174
174
  open: {
175
- pos: x + A + y.length,
176
- margin: /\s/.test(O.charAt(A + y.length)) ? 1 : 0
175
+ pos: S + j + b.length,
176
+ margin: /\s/.test(k.charAt(j + b.length)) ? 1 : 0
177
177
  },
178
178
  close: {
179
- pos: S - j - b.length,
180
- margin: /\s/.test(k.charAt(M - 1)) ? 1 : 0
179
+ pos: C - M - x.length,
180
+ margin: /\s/.test(A.charAt(N - 1)) ? 1 : 0
181
181
  }
182
182
  } : null;
183
183
  }
184
184
  function selectedLineRanges(e6) {
185
- let y = [];
186
- for (let b of e6.selection.ranges) {
187
- let x = e6.doc.lineAt(b.from), S = b.to <= x.to ? x : e6.doc.lineAt(b.to);
188
- S.from > x.from && S.from == b.to && (S = b.to == x.to + 1 ? x : e6.doc.lineAt(b.to - 1));
189
- let C = y.length - 1;
190
- C >= 0 && y[C].to > x.from ? y[C].to = S.to : y.push({
191
- from: x.from + /^\s*/.exec(x.text)[0].length,
192
- to: S.to
185
+ let b = [];
186
+ for (let x of e6.selection.ranges) {
187
+ let S = e6.doc.lineAt(x.from), C = x.to <= S.to ? S : e6.doc.lineAt(x.to);
188
+ C.from > S.from && C.from == x.to && (C = x.to == S.to + 1 ? S : e6.doc.lineAt(x.to - 1));
189
+ let w = b.length - 1;
190
+ w >= 0 && b[w].to > S.from ? b[w].to = C.to : b.push({
191
+ from: S.from + /^\s*/.exec(S.text)[0].length,
192
+ to: C.to
193
193
  });
194
194
  }
195
- return y;
195
+ return b;
196
196
  }
197
- function changeBlockComment(e6, y, b = y.selection.ranges) {
198
- let x = b.map((e7) => getConfig(y, e7.from).block);
199
- if (!x.every((e7) => e7)) return null;
200
- let S = b.map((e7, b2) => findBlockComment(y, x[b2], e7.from, e7.to));
201
- if (e6 != 2 && !S.every((e7) => e7)) return { changes: y.changes(b.map((e7, y2) => S[y2] ? [] : [{
197
+ function changeBlockComment(e6, b, x = b.selection.ranges) {
198
+ let S = x.map((e7) => getConfig(b, e7.from).block);
199
+ if (!S.every((e7) => e7)) return null;
200
+ let C = x.map((e7, x2) => findBlockComment(b, S[x2], e7.from, e7.to));
201
+ if (e6 != 2 && !C.every((e7) => e7)) return { changes: b.changes(x.map((e7, b2) => C[b2] ? [] : [{
202
202
  from: e7.from,
203
- insert: x[y2].open + " "
203
+ insert: S[b2].open + " "
204
204
  }, {
205
205
  from: e7.to,
206
- insert: " " + x[y2].close
206
+ insert: " " + S[b2].close
207
207
  }])) };
208
- if (e6 != 1 && S.some((e7) => e7)) {
208
+ if (e6 != 1 && C.some((e7) => e7)) {
209
209
  let e7 = [];
210
- for (let y2 = 0, b2; y2 < S.length; y2++) if (b2 = S[y2]) {
211
- let S2 = x[y2], { open: C, close: w } = b2;
210
+ for (let b2 = 0, x2; b2 < C.length; b2++) if (x2 = C[b2]) {
211
+ let C2 = S[b2], { open: w, close: T } = x2;
212
212
  e7.push({
213
- from: C.pos - S2.open.length,
214
- to: C.pos + C.margin
213
+ from: w.pos - C2.open.length,
214
+ to: w.pos + w.margin
215
215
  }, {
216
- from: w.pos - w.margin,
217
- to: w.pos + S2.close.length
216
+ from: T.pos - T.margin,
217
+ to: T.pos + C2.close.length
218
218
  });
219
219
  }
220
220
  return { changes: e7 };
221
221
  }
222
222
  return null;
223
223
  }
224
- function changeLineComment(e6, y, b = y.selection.ranges) {
225
- let x = [], S = -1;
226
- for (let { from: e7, to: C } of b) {
227
- let b2 = x.length, w = 1e9, T = getConfig(y, e7).line;
228
- if (T) {
229
- for (let b3 = e7; b3 <= C; ) {
230
- let E = y.doc.lineAt(b3);
231
- if (E.from > S && (e7 == C || C > E.from)) {
232
- S = E.from;
233
- let e8 = /^\s*/.exec(E.text)[0].length, y2 = e8 == E.length, b4 = E.text.slice(e8, e8 + T.length) == T ? e8 : -1;
234
- e8 < E.text.length && e8 < w && (w = e8), x.push({
235
- line: E,
236
- comment: b4,
237
- token: T,
238
- indent: e8,
239
- empty: y2,
240
- single: false
241
- });
242
- }
243
- b3 = E.to + 1;
224
+ function changeLineComment(e6, b, x = b.selection.ranges) {
225
+ let S = [], C = -1;
226
+ ranges: for (let { from: e7, to: w } of x) {
227
+ let x2 = S.length, T = 1e9, E;
228
+ for (let x3 = e7; x3 <= w; ) {
229
+ let D = b.doc.lineAt(x3);
230
+ if (E == null && (E = getConfig(b, D.from).line, !E)) continue ranges;
231
+ if (D.from > C && (e7 == w || w > D.from)) {
232
+ C = D.from;
233
+ let e8 = /^\s*/.exec(D.text)[0].length, b2 = e8 == D.length, x4 = D.text.slice(e8, e8 + E.length) == E ? e8 : -1;
234
+ e8 < D.text.length && e8 < T && (T = e8), S.push({
235
+ line: D,
236
+ comment: x4,
237
+ token: E,
238
+ indent: e8,
239
+ empty: b2,
240
+ single: false
241
+ });
244
242
  }
245
- if (w < 1e9) for (let e8 = b2; e8 < x.length; e8++) x[e8].indent < x[e8].line.text.length && (x[e8].indent = w);
246
- x.length == b2 + 1 && (x[b2].single = true);
243
+ x3 = D.to + 1;
247
244
  }
245
+ if (T < 1e9) for (let e8 = x2; e8 < S.length; e8++) S[e8].indent < S[e8].line.text.length && (S[e8].indent = T);
246
+ S.length == x2 + 1 && (S[x2].single = true);
248
247
  }
249
- if (e6 != 2 && x.some((e7) => e7.comment < 0 && (!e7.empty || e7.single))) {
248
+ if (e6 != 2 && S.some((e7) => e7.comment < 0 && (!e7.empty || e7.single))) {
250
249
  let e7 = [];
251
- for (let { line: y2, token: b3, indent: S2, empty: C, single: w } of x) (w || !C) && e7.push({
252
- from: y2.from + S2,
253
- insert: b3 + " "
250
+ for (let { line: b2, token: x3, indent: C2, empty: w, single: T } of S) (T || !w) && e7.push({
251
+ from: b2.from + C2,
252
+ insert: x3 + " "
254
253
  });
255
- let b2 = y.changes(e7);
254
+ let x2 = b.changes(e7);
256
255
  return {
257
- changes: b2,
258
- selection: y.selection.map(b2, 1)
256
+ changes: x2,
257
+ selection: b.selection.map(x2, 1)
259
258
  };
260
- } else if (e6 != 1 && x.some((e7) => e7.comment >= 0)) {
259
+ } else if (e6 != 1 && S.some((e7) => e7.comment >= 0)) {
261
260
  let e7 = [];
262
- for (let { line: y2, comment: b2, token: S2 } of x) if (b2 >= 0) {
263
- let x2 = y2.from + b2, C = x2 + S2.length;
264
- y2.text[C - y2.from] == " " && C++, e7.push({
265
- from: x2,
266
- to: C
261
+ for (let { line: b2, comment: x2, token: C2 } of S) if (x2 >= 0) {
262
+ let S2 = b2.from + x2, w = S2 + C2.length;
263
+ b2.text[w - b2.from] == " " && w++, e7.push({
264
+ from: S2,
265
+ to: w
267
266
  });
268
267
  }
269
268
  return { changes: e7 };
@@ -274,26 +273,26 @@ var fromHistory = /* @__PURE__ */ Annotation.define(), isolateHistory = /* @__PU
274
273
  return combineConfig(e6, {
275
274
  minDepth: 100,
276
275
  newGroupDelay: 500,
277
- joinToEvent: (e7, y) => y
276
+ joinToEvent: (e7, b) => b
278
277
  }, {
279
278
  minDepth: Math.max,
280
279
  newGroupDelay: Math.min,
281
- joinToEvent: (e7, y) => (b, x) => e7(b, x) || y(b, x)
280
+ joinToEvent: (e7, b) => (x, S) => e7(x, S) || b(x, S)
282
281
  });
283
282
  } }), historyField_ = /* @__PURE__ */ StateField.define({
284
283
  create() {
285
284
  return HistoryState.empty;
286
285
  },
287
- update(e6, y) {
288
- let b = y.state.facet(historyConfig), x = y.annotation(fromHistory);
289
- if (x) {
290
- let S2 = HistEvent.fromTransaction(y, x.selection), C2 = x.side, w2 = C2 == 0 ? e6.undone : e6.done;
291
- return w2 = S2 ? updateBranch(w2, w2.length, b.minDepth, S2) : addSelection(w2, y.startState.selection), new HistoryState(C2 == 0 ? x.rest : w2, C2 == 0 ? w2 : x.rest);
286
+ update(e6, b) {
287
+ let x = b.state.facet(historyConfig), S = b.annotation(fromHistory);
288
+ if (S) {
289
+ let C2 = HistEvent.fromTransaction(b, S.selection), w2 = S.side, T2 = w2 == 0 ? e6.undone : e6.done;
290
+ return T2 = C2 ? updateBranch(T2, T2.length, x.minDepth, C2) : addSelection(T2, b.startState.selection), new HistoryState(w2 == 0 ? S.rest : T2, w2 == 0 ? T2 : S.rest);
292
291
  }
293
- let S = y.annotation(isolateHistory);
294
- if ((S == "full" || S == "before") && (e6 = e6.isolate()), y.annotation(Transaction.addToHistory) === false) return y.changes.empty ? e6 : e6.addMapping(y.changes.desc);
295
- let C = HistEvent.fromTransaction(y), w = y.annotation(Transaction.time), T = y.annotation(Transaction.userEvent);
296
- return C ? e6 = e6.addChanges(C, w, T, b, y) : y.selection && (e6 = e6.addSelection(y.startState.selection, w, T, b.newGroupDelay)), (S == "full" || S == "after") && (e6 = e6.isolate()), e6;
292
+ let C = b.annotation(isolateHistory);
293
+ if ((C == "full" || C == "before") && (e6 = e6.isolate()), b.annotation(Transaction.addToHistory) === false) return b.changes.empty ? e6 : e6.addMapping(b.changes.desc);
294
+ let w = HistEvent.fromTransaction(b), T = b.annotation(Transaction.time), E = b.annotation(Transaction.userEvent);
295
+ return w ? e6 = e6.addChanges(w, T, E, x, b) : b.selection && (e6 = e6.addSelection(b.startState.selection, T, E, x.newGroupDelay)), (C == "full" || C == "after") && (e6 = e6.isolate()), e6;
297
296
  },
298
297
  toJSON(e6) {
299
298
  return {
@@ -309,28 +308,28 @@ function history(e6 = {}) {
309
308
  return [
310
309
  historyField_,
311
310
  historyConfig.of(e6),
312
- EditorView.domEventHandlers({ beforeinput(e7, y) {
313
- let b = e7.inputType == "historyUndo" ? undo : e7.inputType == "historyRedo" ? redo : null;
314
- return b ? (e7.preventDefault(), b(y)) : false;
311
+ EditorView.domEventHandlers({ beforeinput(e7, b) {
312
+ let x = e7.inputType == "historyUndo" ? undo : e7.inputType == "historyRedo" ? redo : null;
313
+ return x ? (e7.preventDefault(), x(b)) : false;
315
314
  } })
316
315
  ];
317
316
  }
318
317
  var historyField = historyField_;
319
- function cmd(e6, y) {
320
- return function({ state: b, dispatch: x }) {
321
- if (!y && b.readOnly) return false;
322
- let S = b.field(historyField_, false);
323
- if (!S) return false;
324
- let C = S.pop(e6, b, y);
325
- return C ? (x(C), true) : false;
318
+ function cmd(e6, b) {
319
+ return function({ state: x, dispatch: S }) {
320
+ if (!b && x.readOnly) return false;
321
+ let C = x.field(historyField_, false);
322
+ if (!C) return false;
323
+ let w = C.pop(e6, x, b);
324
+ return w ? (S(w), true) : false;
326
325
  };
327
326
  }
328
327
  var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false), undoSelection = /* @__PURE__ */ cmd(0, true), redoSelection = /* @__PURE__ */ cmd(1, true), HistEvent = class e {
329
- constructor(e6, y, b, x, S) {
330
- this.changes = e6, this.effects = y, this.mapped = b, this.startSelection = x, this.selectionsAfter = S;
328
+ constructor(e6, b, x, S, C) {
329
+ this.changes = e6, this.effects = b, this.mapped = x, this.startSelection = S, this.selectionsAfter = C;
331
330
  }
332
- setSelAfter(y) {
333
- return new e(this.changes, this.effects, this.mapped, this.startSelection, y);
331
+ setSelAfter(b) {
332
+ return new e(this.changes, this.effects, this.mapped, this.startSelection, b);
334
333
  }
335
334
  toJSON() {
336
335
  var _a, _b, _c;
@@ -341,111 +340,111 @@ var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false),
341
340
  selectionsAfter: this.selectionsAfter.map((e6) => e6.toJSON())
342
341
  };
343
342
  }
344
- static fromJSON(y) {
345
- return new e(y.changes && ChangeSet.fromJSON(y.changes), [], y.mapped && ChangeDesc.fromJSON(y.mapped), y.startSelection && EditorSelection.fromJSON(y.startSelection), y.selectionsAfter.map(EditorSelection.fromJSON));
343
+ static fromJSON(b) {
344
+ return new e(b.changes && ChangeSet.fromJSON(b.changes), [], b.mapped && ChangeDesc.fromJSON(b.mapped), b.startSelection && EditorSelection.fromJSON(b.startSelection), b.selectionsAfter.map(EditorSelection.fromJSON));
346
345
  }
347
- static fromTransaction(y, b) {
348
- let x = none;
349
- for (let e6 of y.startState.facet(invertedEffects)) {
350
- let b2 = e6(y);
351
- b2.length && (x = x.concat(b2));
346
+ static fromTransaction(b, x) {
347
+ let S = none;
348
+ for (let e6 of b.startState.facet(invertedEffects)) {
349
+ let x2 = e6(b);
350
+ x2.length && (S = S.concat(x2));
352
351
  }
353
- return !x.length && y.changes.empty ? null : new e(y.changes.invert(y.startState.doc), x, void 0, b || y.startState.selection, none);
352
+ return !S.length && b.changes.empty ? null : new e(b.changes.invert(b.startState.doc), S, void 0, x || b.startState.selection, none);
354
353
  }
355
- static selection(y) {
356
- return new e(void 0, none, void 0, void 0, y);
354
+ static selection(b) {
355
+ return new e(void 0, none, void 0, void 0, b);
357
356
  }
358
357
  };
359
- function updateBranch(e6, y, b, x) {
360
- let S = y + 1 > b + 20 ? y - b - 1 : 0, C = e6.slice(S, y);
361
- return C.push(x), C;
358
+ function updateBranch(e6, b, x, S) {
359
+ let C = b + 1 > x + 20 ? b - x - 1 : 0, w = e6.slice(C, b);
360
+ return w.push(S), w;
362
361
  }
363
- function isAdjacent(e6, y) {
364
- let b = [], x = false;
365
- return e6.iterChangedRanges((e7, y2) => b.push(e7, y2)), y.iterChangedRanges((e7, y2, S, C) => {
366
- for (let e8 = 0; e8 < b.length; ) {
367
- let y3 = b[e8++], w = b[e8++];
368
- C >= y3 && S <= w && (x = true);
362
+ function isAdjacent(e6, b) {
363
+ let x = [], S = false;
364
+ return e6.iterChangedRanges((e7, b2) => x.push(e7, b2)), b.iterChangedRanges((e7, b2, C, w) => {
365
+ for (let e8 = 0; e8 < x.length; ) {
366
+ let b3 = x[e8++], T = x[e8++];
367
+ w >= b3 && C <= T && (S = true);
369
368
  }
370
- }), x;
369
+ }), S;
371
370
  }
372
- function eqSelectionShape(e6, y) {
373
- return e6.ranges.length == y.ranges.length && e6.ranges.filter((e7, b) => e7.empty != y.ranges[b].empty).length === 0;
371
+ function eqSelectionShape(e6, b) {
372
+ return e6.ranges.length == b.ranges.length && e6.ranges.filter((e7, x) => e7.empty != b.ranges[x].empty).length === 0;
374
373
  }
375
- function conc(e6, y) {
376
- return e6.length ? y.length ? e6.concat(y) : e6 : y;
374
+ function conc(e6, b) {
375
+ return e6.length ? b.length ? e6.concat(b) : e6 : b;
377
376
  }
378
377
  var none = [], MaxSelectionsPerEvent = 200;
379
- function addSelection(e6, y) {
378
+ function addSelection(e6, b) {
380
379
  if (e6.length) {
381
- let b = e6[e6.length - 1], x = b.selectionsAfter.slice(Math.max(0, b.selectionsAfter.length - MaxSelectionsPerEvent));
382
- return x.length && x[x.length - 1].eq(y) ? e6 : (x.push(y), updateBranch(e6, e6.length - 1, 1e9, b.setSelAfter(x)));
383
- } else return [HistEvent.selection([y])];
380
+ let x = e6[e6.length - 1], S = x.selectionsAfter.slice(Math.max(0, x.selectionsAfter.length - MaxSelectionsPerEvent));
381
+ return S.length && S[S.length - 1].eq(b) ? e6 : (S.push(b), updateBranch(e6, e6.length - 1, 1e9, x.setSelAfter(S)));
382
+ } else return [HistEvent.selection([b])];
384
383
  }
385
384
  function popSelection(e6) {
386
- let y = e6[e6.length - 1], b = e6.slice();
387
- return b[e6.length - 1] = y.setSelAfter(y.selectionsAfter.slice(0, y.selectionsAfter.length - 1)), b;
385
+ let b = e6[e6.length - 1], x = e6.slice();
386
+ return x[e6.length - 1] = b.setSelAfter(b.selectionsAfter.slice(0, b.selectionsAfter.length - 1)), x;
388
387
  }
389
- function addMappingToBranch(e6, y) {
388
+ function addMappingToBranch(e6, b) {
390
389
  if (!e6.length) return e6;
391
- let b = e6.length, x = none;
392
- for (; b; ) {
393
- let S = mapEvent(e6[b - 1], y, x);
394
- if (S.changes && !S.changes.empty || S.effects.length) {
395
- let y2 = e6.slice(0, b);
396
- return y2[b - 1] = S, y2;
397
- } else y = S.mapped, b--, x = S.selectionsAfter;
398
- }
399
- return x.length ? [HistEvent.selection(x)] : none;
390
+ let x = e6.length, S = none;
391
+ for (; x; ) {
392
+ let C = mapEvent(e6[x - 1], b, S);
393
+ if (C.changes && !C.changes.empty || C.effects.length) {
394
+ let b2 = e6.slice(0, x);
395
+ return b2[x - 1] = C, b2;
396
+ } else b = C.mapped, x--, S = C.selectionsAfter;
397
+ }
398
+ return S.length ? [HistEvent.selection(S)] : none;
400
399
  }
401
- function mapEvent(e6, y, b) {
402
- let x = conc(e6.selectionsAfter.length ? e6.selectionsAfter.map((e7) => e7.map(y)) : none, b);
403
- if (!e6.changes) return HistEvent.selection(x);
404
- let S = e6.changes.map(y), C = y.mapDesc(e6.changes, true), w = e6.mapped ? e6.mapped.composeDesc(C) : C;
405
- return new HistEvent(S, StateEffect.mapEffects(e6.effects, y), w, e6.startSelection.map(C), x);
400
+ function mapEvent(e6, b, x) {
401
+ let S = conc(e6.selectionsAfter.length ? e6.selectionsAfter.map((e7) => e7.map(b)) : none, x);
402
+ if (!e6.changes) return HistEvent.selection(S);
403
+ let C = e6.changes.map(b), w = b.mapDesc(e6.changes, true), T = e6.mapped ? e6.mapped.composeDesc(w) : w;
404
+ return new HistEvent(C, StateEffect.mapEffects(e6.effects, b), T, e6.startSelection.map(w), S);
406
405
  }
407
406
  var joinableUserEvent = /^(input\.type|delete)($|\.)/, HistoryState = class e2 {
408
- constructor(e6, y, b = 0, x = void 0) {
409
- this.done = e6, this.undone = y, this.prevTime = b, this.prevUserEvent = x;
407
+ constructor(e6, b, x = 0, S = void 0) {
408
+ this.done = e6, this.undone = b, this.prevTime = x, this.prevUserEvent = S;
410
409
  }
411
410
  isolate() {
412
411
  return this.prevTime ? new e2(this.done, this.undone) : this;
413
412
  }
414
- addChanges(y, b, x, S, C) {
415
- let w = this.done, T = w[w.length - 1];
416
- return w = T && T.changes && !T.changes.empty && y.changes && (!x || joinableUserEvent.test(x)) && (!T.selectionsAfter.length && b - this.prevTime < S.newGroupDelay && S.joinToEvent(C, isAdjacent(T.changes, y.changes)) || x == "input.type.compose") ? updateBranch(w, w.length - 1, S.minDepth, new HistEvent(y.changes.compose(T.changes), conc(StateEffect.mapEffects(y.effects, T.changes), T.effects), T.mapped, T.startSelection, none)) : updateBranch(w, w.length, S.minDepth, y), new e2(w, none, b, x);
413
+ addChanges(b, x, S, C, w) {
414
+ let T = this.done, E = T[T.length - 1];
415
+ return T = E && E.changes && !E.changes.empty && b.changes && (!S || joinableUserEvent.test(S)) && (!E.selectionsAfter.length && x - this.prevTime < C.newGroupDelay && C.joinToEvent(w, isAdjacent(E.changes, b.changes)) || S == "input.type.compose") ? updateBranch(T, T.length - 1, C.minDepth, new HistEvent(b.changes.compose(E.changes), conc(StateEffect.mapEffects(b.effects, E.changes), E.effects), E.mapped, E.startSelection, none)) : updateBranch(T, T.length, C.minDepth, b), new e2(T, none, x, S);
417
416
  }
418
- addSelection(y, b, x, S) {
419
- let C = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
420
- return C.length > 0 && b - this.prevTime < S && x == this.prevUserEvent && x && /^select($|\.)/.test(x) && eqSelectionShape(C[C.length - 1], y) ? this : new e2(addSelection(this.done, y), this.undone, b, x);
417
+ addSelection(b, x, S, C) {
418
+ let w = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
419
+ return w.length > 0 && x - this.prevTime < C && S == this.prevUserEvent && S && /^select($|\.)/.test(S) && eqSelectionShape(w[w.length - 1], b) ? this : new e2(addSelection(this.done, b), this.undone, x, S);
421
420
  }
422
- addMapping(y) {
423
- return new e2(addMappingToBranch(this.done, y), addMappingToBranch(this.undone, y), this.prevTime, this.prevUserEvent);
421
+ addMapping(b) {
422
+ return new e2(addMappingToBranch(this.done, b), addMappingToBranch(this.undone, b), this.prevTime, this.prevUserEvent);
424
423
  }
425
- pop(e6, y, b) {
426
- let x = e6 == 0 ? this.done : this.undone;
427
- if (x.length == 0) return null;
428
- let S = x[x.length - 1], C = S.selectionsAfter[0] || y.selection;
429
- if (b && S.selectionsAfter.length) return y.update({
430
- selection: S.selectionsAfter[S.selectionsAfter.length - 1],
424
+ pop(e6, b, x) {
425
+ let S = e6 == 0 ? this.done : this.undone;
426
+ if (S.length == 0) return null;
427
+ let C = S[S.length - 1], w = C.selectionsAfter[0] || (C.startSelection ? C.startSelection.map(C.changes.invertedDesc, 1) : b.selection);
428
+ if (x && C.selectionsAfter.length) return b.update({
429
+ selection: C.selectionsAfter[C.selectionsAfter.length - 1],
431
430
  annotations: fromHistory.of({
432
431
  side: e6,
433
- rest: popSelection(x),
434
- selection: C
432
+ rest: popSelection(S),
433
+ selection: w
435
434
  }),
436
435
  userEvent: e6 == 0 ? "select.undo" : "select.redo",
437
436
  scrollIntoView: true
438
437
  });
439
- if (S.changes) {
440
- let b2 = x.length == 1 ? none : x.slice(0, x.length - 1);
441
- return S.mapped && (b2 = addMappingToBranch(b2, S.mapped)), y.update({
442
- changes: S.changes,
443
- selection: S.startSelection,
444
- effects: S.effects,
438
+ if (C.changes) {
439
+ let x2 = S.length == 1 ? none : S.slice(0, S.length - 1);
440
+ return C.mapped && (x2 = addMappingToBranch(x2, C.mapped)), b.update({
441
+ changes: C.changes,
442
+ selection: C.startSelection,
443
+ effects: C.effects,
445
444
  annotations: fromHistory.of({
446
445
  side: e6,
447
- rest: b2,
448
- selection: C
446
+ rest: x2,
447
+ selection: w
449
448
  }),
450
449
  filter: false,
451
450
  userEvent: e6 == 0 ? "undo" : "redo",
@@ -484,244 +483,244 @@ var historyKeymap = [
484
483
  preventDefault: true
485
484
  }
486
485
  ];
487
- function updateSel(e6, y) {
488
- return EditorSelection.create(e6.ranges.map(y), e6.mainIndex);
486
+ function updateSel(e6, b) {
487
+ return EditorSelection.create(e6.ranges.map(b), e6.mainIndex);
489
488
  }
490
- function setSel(e6, y) {
489
+ function setSel(e6, b) {
491
490
  return e6.update({
492
- selection: y,
491
+ selection: b,
493
492
  scrollIntoView: true,
494
493
  userEvent: "select"
495
494
  });
496
495
  }
497
- function moveSel({ state: e6, dispatch: y }, b) {
498
- let x = updateSel(e6.selection, b);
499
- return x.eq(e6.selection, true) ? false : (y(setSel(e6, x)), true);
496
+ function moveSel({ state: e6, dispatch: b }, x) {
497
+ let S = updateSel(e6.selection, x);
498
+ return S.eq(e6.selection, true) ? false : (b(setSel(e6, S)), true);
500
499
  }
501
- function rangeEnd(e6, y) {
502
- return EditorSelection.cursor(y ? e6.to : e6.from);
500
+ function rangeEnd(e6, b) {
501
+ return EditorSelection.cursor(b ? e6.to : e6.from);
503
502
  }
504
- function cursorByChar(e6, y) {
505
- return moveSel(e6, (b) => b.empty ? e6.moveByChar(b, y) : rangeEnd(b, y));
503
+ function cursorByChar(e6, b) {
504
+ return moveSel(e6, (x) => x.empty ? e6.moveByChar(x, b) : rangeEnd(x, b));
506
505
  }
507
506
  function ltrAtCursor(e6) {
508
507
  return e6.textDirectionAt(e6.state.selection.main.head) == Direction.LTR;
509
508
  }
510
509
  var cursorCharLeft = (e6) => cursorByChar(e6, !ltrAtCursor(e6)), cursorCharRight = (e6) => cursorByChar(e6, ltrAtCursor(e6));
511
- function cursorByGroup(e6, y) {
512
- return moveSel(e6, (b) => b.empty ? e6.moveByGroup(b, y) : rangeEnd(b, y));
510
+ function cursorByGroup(e6, b) {
511
+ return moveSel(e6, (x) => x.empty ? e6.moveByGroup(x, b) : rangeEnd(x, b));
513
512
  }
514
513
  var cursorGroupLeft = (e6) => cursorByGroup(e6, !ltrAtCursor(e6)), cursorGroupRight = (e6) => cursorByGroup(e6, ltrAtCursor(e6));
515
514
  typeof Intl < "u" && Intl.Segmenter;
516
- function interestingNode(e6, y, b) {
517
- if (y.type.prop(b)) return true;
518
- let x = y.to - y.from;
519
- return x && (x > 2 || /[^\s,.;:]/.test(e6.sliceDoc(y.from, y.to))) || y.firstChild;
515
+ function interestingNode(e6, b, x) {
516
+ if (b.type.prop(x)) return true;
517
+ let S = b.to - b.from;
518
+ return S && (S > 2 || /[^\s,.;:]/.test(e6.sliceDoc(b.from, b.to))) || b.firstChild;
520
519
  }
521
- function moveBySyntax(e6, y, b) {
522
- let x = syntaxTree(e6).resolveInner(y.head), S = b ? NodeProp.closedBy : NodeProp.openedBy;
523
- for (let C2 = y.head; ; ) {
524
- let y2 = b ? x.childAfter(C2) : x.childBefore(C2);
525
- if (!y2) break;
526
- interestingNode(e6, y2, S) ? x = y2 : C2 = b ? y2.to : y2.from;
527
- }
528
- let C = x.type.prop(S), w, T;
529
- return T = C && (w = b ? matchBrackets(e6, x.from, 1) : matchBrackets(e6, x.to, -1)) && w.matched ? b ? w.end.to : w.end.from : b ? x.to : x.from, EditorSelection.cursor(T, b ? -1 : 1);
520
+ function moveBySyntax(e6, b, x) {
521
+ let S = syntaxTree(e6).resolveInner(b.head), C = x ? NodeProp.closedBy : NodeProp.openedBy;
522
+ for (let w2 = b.head; ; ) {
523
+ let b2 = x ? S.childAfter(w2) : S.childBefore(w2);
524
+ if (!b2) break;
525
+ interestingNode(e6, b2, C) ? S = b2 : w2 = x ? b2.to : b2.from;
526
+ }
527
+ let w = S.type.prop(C), T, E;
528
+ return E = w && (T = x ? matchBrackets(e6, S.from, 1) : matchBrackets(e6, S.to, -1)) && T.matched ? x ? T.end.to : T.end.from : x ? S.to : S.from, EditorSelection.cursor(E, x ? -1 : 1);
530
529
  }
531
- var cursorSyntaxLeft = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, !ltrAtCursor(e6))), cursorSyntaxRight = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, ltrAtCursor(e6)));
532
- function cursorByLine(e6, y) {
533
- return moveSel(e6, (b) => {
534
- if (!b.empty) return rangeEnd(b, y);
535
- let x = e6.moveVertically(b, y);
536
- return x.head == b.head ? e6.moveToLineBoundary(b, y) : x;
530
+ var cursorSyntaxLeft = (e6) => moveSel(e6, (b) => moveBySyntax(e6.state, b, !ltrAtCursor(e6))), cursorSyntaxRight = (e6) => moveSel(e6, (b) => moveBySyntax(e6.state, b, ltrAtCursor(e6)));
531
+ function cursorByLine(e6, b) {
532
+ return moveSel(e6, (x) => {
533
+ if (!x.empty) return rangeEnd(x, b);
534
+ let S = e6.moveVertically(x, b);
535
+ return S.head == x.head ? e6.moveToLineBoundary(x, b) : S;
537
536
  });
538
537
  }
539
538
  var cursorLineUp = (e6) => cursorByLine(e6, false), cursorLineDown = (e6) => cursorByLine(e6, true);
540
539
  function pageInfo(e6) {
541
- let y = e6.scrollDOM.clientHeight < e6.scrollDOM.scrollHeight - 2, b = 0, x = 0, S;
542
- if (y) {
543
- for (let y2 of e6.state.facet(EditorView.scrollMargins)) {
544
- let S2 = y2(e6);
545
- (S2 == null ? void 0 : S2.top) && (b = Math.max(S2 == null ? void 0 : S2.top, b)), (S2 == null ? void 0 : S2.bottom) && (x = Math.max(S2 == null ? void 0 : S2.bottom, x));
540
+ let b = e6.scrollDOM.clientHeight < e6.scrollDOM.scrollHeight - 2, x = 0, S = 0, C;
541
+ if (b) {
542
+ for (let b2 of e6.state.facet(EditorView.scrollMargins)) {
543
+ let C2 = b2(e6);
544
+ (C2 == null ? void 0 : C2.top) && (x = Math.max(C2 == null ? void 0 : C2.top, x)), (C2 == null ? void 0 : C2.bottom) && (S = Math.max(C2 == null ? void 0 : C2.bottom, S));
546
545
  }
547
- S = e6.scrollDOM.clientHeight - b - x;
548
- } else S = (e6.dom.ownerDocument.defaultView || window).innerHeight;
546
+ C = e6.scrollDOM.clientHeight - x - S;
547
+ } else C = (e6.dom.ownerDocument.defaultView || window).innerHeight;
549
548
  return {
550
- marginTop: b,
551
- marginBottom: x,
552
- selfScroll: y,
553
- height: Math.max(e6.defaultLineHeight, S - 5)
549
+ marginTop: x,
550
+ marginBottom: S,
551
+ selfScroll: b,
552
+ height: Math.max(e6.defaultLineHeight, C - 5)
554
553
  };
555
554
  }
556
- function cursorByPage(e6, y) {
557
- let b = pageInfo(e6), { state: x } = e6, S = updateSel(x.selection, (x2) => x2.empty ? e6.moveVertically(x2, y, b.height) : rangeEnd(x2, y));
558
- if (S.eq(x.selection)) return false;
559
- let C;
560
- if (b.selfScroll) {
561
- let y2 = e6.coordsAtPos(x.selection.main.head), w = e6.scrollDOM.getBoundingClientRect(), T = w.top + b.marginTop, E = w.bottom - b.marginBottom;
562
- y2 && y2.top > T && y2.bottom < E && (C = EditorView.scrollIntoView(S.main.head, {
555
+ function cursorByPage(e6, b) {
556
+ let x = pageInfo(e6), { state: S } = e6, C = updateSel(S.selection, (S2) => S2.empty ? e6.moveVertically(S2, b, x.height) : rangeEnd(S2, b));
557
+ if (C.eq(S.selection)) return false;
558
+ let w;
559
+ if (x.selfScroll) {
560
+ let b2 = e6.coordsAtPos(S.selection.main.head), T = e6.scrollDOM.getBoundingClientRect(), E = T.top + x.marginTop, D = T.bottom - x.marginBottom;
561
+ b2 && b2.top > E && b2.bottom < D && (w = EditorView.scrollIntoView(C.main.head, {
563
562
  y: "start",
564
- yMargin: y2.top - T
563
+ yMargin: b2.top - E
565
564
  }));
566
565
  }
567
- return e6.dispatch(setSel(x, S), { effects: C }), true;
566
+ return e6.dispatch(setSel(S, C), { effects: w }), true;
568
567
  }
569
568
  var cursorPageUp = (e6) => cursorByPage(e6, false), cursorPageDown = (e6) => cursorByPage(e6, true);
570
- function moveByLineBoundary(e6, y, b) {
571
- let x = e6.lineBlockAt(y.head), S = e6.moveToLineBoundary(y, b);
572
- if (S.head == y.head && S.head != (b ? x.to : x.from) && (S = e6.moveToLineBoundary(y, b, false)), !b && S.head == x.from && x.length) {
573
- let b2 = /^\s*/.exec(e6.state.sliceDoc(x.from, Math.min(x.from + 100, x.to)))[0].length;
574
- b2 && y.head != x.from + b2 && (S = EditorSelection.cursor(x.from + b2));
569
+ function moveByLineBoundary(e6, b, x) {
570
+ let S = e6.lineBlockAt(b.head), C = e6.moveToLineBoundary(b, x);
571
+ if (C.head == b.head && C.head != (x ? S.to : S.from) && (C = e6.moveToLineBoundary(b, x, false)), !x && C.head == S.from && S.length) {
572
+ let x2 = /^\s*/.exec(e6.state.sliceDoc(S.from, Math.min(S.from + 100, S.to)))[0].length;
573
+ x2 && b.head != S.from + x2 && (C = EditorSelection.cursor(S.from + x2));
575
574
  }
576
- return S;
575
+ return C;
577
576
  }
578
- var cursorLineBoundaryForward = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, true)), cursorLineBoundaryBackward = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, false)), cursorLineBoundaryLeft = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, !ltrAtCursor(e6))), cursorLineBoundaryRight = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, ltrAtCursor(e6))), cursorLineStart = (e6) => moveSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).from, 1)), cursorLineEnd = (e6) => moveSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).to, -1));
579
- function toMatchingBracket(e6, y, b) {
580
- let x = false, S = updateSel(e6.selection, (y2) => {
581
- let S2 = matchBrackets(e6, y2.head, -1) || matchBrackets(e6, y2.head, 1) || y2.head > 0 && matchBrackets(e6, y2.head - 1, 1) || y2.head < e6.doc.length && matchBrackets(e6, y2.head + 1, -1);
582
- if (!S2 || !S2.end) return y2;
583
- x = true;
584
- let C = S2.start.from == y2.head ? S2.end.to : S2.end.from;
585
- return b ? EditorSelection.range(y2.anchor, C) : EditorSelection.cursor(C);
577
+ var cursorLineBoundaryForward = (e6) => moveSel(e6, (b) => moveByLineBoundary(e6, b, true)), cursorLineBoundaryBackward = (e6) => moveSel(e6, (b) => moveByLineBoundary(e6, b, false)), cursorLineBoundaryLeft = (e6) => moveSel(e6, (b) => moveByLineBoundary(e6, b, !ltrAtCursor(e6))), cursorLineBoundaryRight = (e6) => moveSel(e6, (b) => moveByLineBoundary(e6, b, ltrAtCursor(e6))), cursorLineStart = (e6) => moveSel(e6, (b) => EditorSelection.cursor(e6.lineBlockAt(b.head).from, 1)), cursorLineEnd = (e6) => moveSel(e6, (b) => EditorSelection.cursor(e6.lineBlockAt(b.head).to, -1));
578
+ function toMatchingBracket(e6, b, x) {
579
+ let S = false, C = updateSel(e6.selection, (b2) => {
580
+ let C2 = matchBrackets(e6, b2.head, -1) || matchBrackets(e6, b2.head, 1) || b2.head > 0 && matchBrackets(e6, b2.head - 1, 1) || b2.head < e6.doc.length && matchBrackets(e6, b2.head + 1, -1);
581
+ if (!C2 || !C2.end) return b2;
582
+ S = true;
583
+ let w = C2.start.from == b2.head ? C2.end.to : C2.end.from;
584
+ return x ? EditorSelection.range(b2.anchor, w) : EditorSelection.cursor(w);
586
585
  });
587
- return x ? (y(setSel(e6, S)), true) : false;
586
+ return S ? (b(setSel(e6, C)), true) : false;
588
587
  }
589
- var cursorMatchingBracket = ({ state: e6, dispatch: y }) => toMatchingBracket(e6, y, false);
590
- function extendSel(e6, y) {
591
- let b = updateSel(e6.state.selection, (e7) => {
592
- let b2 = y(e7);
593
- return EditorSelection.range(e7.anchor, b2.head, b2.goalColumn, b2.bidiLevel || void 0);
588
+ var cursorMatchingBracket = ({ state: e6, dispatch: b }) => toMatchingBracket(e6, b, false);
589
+ function extendSel(e6, b) {
590
+ let x = updateSel(e6.state.selection, (e7) => {
591
+ let x2 = b(e7);
592
+ return EditorSelection.range(e7.anchor, x2.head, x2.goalColumn, x2.bidiLevel || void 0);
594
593
  });
595
- return b.eq(e6.state.selection) ? false : (e6.dispatch(setSel(e6.state, b)), true);
594
+ return x.eq(e6.state.selection) ? false : (e6.dispatch(setSel(e6.state, x)), true);
596
595
  }
597
- function selectByChar(e6, y) {
598
- return extendSel(e6, (b) => e6.moveByChar(b, y));
596
+ function selectByChar(e6, b) {
597
+ return extendSel(e6, (x) => e6.moveByChar(x, b));
599
598
  }
600
599
  var selectCharLeft = (e6) => selectByChar(e6, !ltrAtCursor(e6)), selectCharRight = (e6) => selectByChar(e6, ltrAtCursor(e6));
601
- function selectByGroup(e6, y) {
602
- return extendSel(e6, (b) => e6.moveByGroup(b, y));
600
+ function selectByGroup(e6, b) {
601
+ return extendSel(e6, (x) => e6.moveByGroup(x, b));
603
602
  }
604
- var selectGroupLeft = (e6) => selectByGroup(e6, !ltrAtCursor(e6)), selectGroupRight = (e6) => selectByGroup(e6, ltrAtCursor(e6)), selectSyntaxLeft = (e6) => extendSel(e6, (y) => moveBySyntax(e6.state, y, !ltrAtCursor(e6))), selectSyntaxRight = (e6) => extendSel(e6, (y) => moveBySyntax(e6.state, y, ltrAtCursor(e6)));
605
- function selectByLine(e6, y) {
606
- return extendSel(e6, (b) => e6.moveVertically(b, y));
603
+ var selectGroupLeft = (e6) => selectByGroup(e6, !ltrAtCursor(e6)), selectGroupRight = (e6) => selectByGroup(e6, ltrAtCursor(e6)), selectSyntaxLeft = (e6) => extendSel(e6, (b) => moveBySyntax(e6.state, b, !ltrAtCursor(e6))), selectSyntaxRight = (e6) => extendSel(e6, (b) => moveBySyntax(e6.state, b, ltrAtCursor(e6)));
604
+ function selectByLine(e6, b) {
605
+ return extendSel(e6, (x) => e6.moveVertically(x, b));
607
606
  }
608
607
  var selectLineUp = (e6) => selectByLine(e6, false), selectLineDown = (e6) => selectByLine(e6, true);
609
- function selectByPage(e6, y) {
610
- return extendSel(e6, (b) => e6.moveVertically(b, y, pageInfo(e6).height));
608
+ function selectByPage(e6, b) {
609
+ return extendSel(e6, (x) => e6.moveVertically(x, b, pageInfo(e6).height));
611
610
  }
612
- var selectPageUp = (e6) => selectByPage(e6, false), selectPageDown = (e6) => selectByPage(e6, true), selectLineBoundaryForward = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, true)), selectLineBoundaryBackward = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, false)), selectLineBoundaryLeft = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, !ltrAtCursor(e6))), selectLineBoundaryRight = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, ltrAtCursor(e6))), selectLineStart = (e6) => extendSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).from)), selectLineEnd = (e6) => extendSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).to)), cursorDocStart = ({ state: e6, dispatch: y }) => (y(setSel(e6, { anchor: 0 })), true), cursorDocEnd = ({ state: e6, dispatch: y }) => (y(setSel(e6, { anchor: e6.doc.length })), true), selectDocStart = ({ state: e6, dispatch: y }) => (y(setSel(e6, {
611
+ var selectPageUp = (e6) => selectByPage(e6, false), selectPageDown = (e6) => selectByPage(e6, true), selectLineBoundaryForward = (e6) => extendSel(e6, (b) => moveByLineBoundary(e6, b, true)), selectLineBoundaryBackward = (e6) => extendSel(e6, (b) => moveByLineBoundary(e6, b, false)), selectLineBoundaryLeft = (e6) => extendSel(e6, (b) => moveByLineBoundary(e6, b, !ltrAtCursor(e6))), selectLineBoundaryRight = (e6) => extendSel(e6, (b) => moveByLineBoundary(e6, b, ltrAtCursor(e6))), selectLineStart = (e6) => extendSel(e6, (b) => EditorSelection.cursor(e6.lineBlockAt(b.head).from)), selectLineEnd = (e6) => extendSel(e6, (b) => EditorSelection.cursor(e6.lineBlockAt(b.head).to)), cursorDocStart = ({ state: e6, dispatch: b }) => (b(setSel(e6, { anchor: 0 })), true), cursorDocEnd = ({ state: e6, dispatch: b }) => (b(setSel(e6, { anchor: e6.doc.length })), true), selectDocStart = ({ state: e6, dispatch: b }) => (b(setSel(e6, {
613
612
  anchor: e6.selection.main.anchor,
614
613
  head: 0
615
- })), true), selectDocEnd = ({ state: e6, dispatch: y }) => (y(setSel(e6, {
614
+ })), true), selectDocEnd = ({ state: e6, dispatch: b }) => (b(setSel(e6, {
616
615
  anchor: e6.selection.main.anchor,
617
616
  head: e6.doc.length
618
- })), true), selectAll = ({ state: e6, dispatch: y }) => (y(e6.update({
617
+ })), true), selectAll = ({ state: e6, dispatch: b }) => (b(e6.update({
619
618
  selection: {
620
619
  anchor: 0,
621
620
  head: e6.doc.length
622
621
  },
623
622
  userEvent: "select"
624
- })), true), selectLine = ({ state: e6, dispatch: y }) => {
625
- let b = selectedLineBlocks(e6).map(({ from: y2, to: b2 }) => EditorSelection.range(y2, Math.min(b2 + 1, e6.doc.length)));
626
- return y(e6.update({
627
- selection: EditorSelection.create(b),
623
+ })), true), selectLine = ({ state: e6, dispatch: b }) => {
624
+ let x = selectedLineBlocks(e6).map(({ from: b2, to: x2 }) => EditorSelection.range(b2, Math.min(x2 + 1, e6.doc.length)));
625
+ return b(e6.update({
626
+ selection: EditorSelection.create(x),
628
627
  userEvent: "select"
629
628
  })), true;
630
- }, selectParentSyntax = ({ state: e6, dispatch: y }) => {
631
- let b = updateSel(e6.selection, (y2) => {
632
- let b2 = syntaxTree(e6), x = b2.resolveStack(y2.from, 1);
633
- if (y2.empty) {
634
- let e7 = b2.resolveStack(y2.from, -1);
635
- e7.node.from >= x.node.from && e7.node.to <= x.node.to && (x = e7);
629
+ }, selectParentSyntax = ({ state: e6, dispatch: b }) => {
630
+ let x = updateSel(e6.selection, (b2) => {
631
+ let x2 = syntaxTree(e6), S = x2.resolveStack(b2.from, 1);
632
+ if (b2.empty) {
633
+ let e7 = x2.resolveStack(b2.from, -1);
634
+ e7.node.from >= S.node.from && e7.node.to <= S.node.to && (S = e7);
636
635
  }
637
- for (let e7 = x; e7; e7 = e7.next) {
638
- let { node: b3 } = e7;
639
- if ((b3.from < y2.from && b3.to >= y2.to || b3.to > y2.to && b3.from <= y2.from) && e7.next) return EditorSelection.range(b3.to, b3.from);
636
+ for (let e7 = S; e7; e7 = e7.next) {
637
+ let { node: x3 } = e7;
638
+ if ((x3.from < b2.from && x3.to >= b2.to || x3.to > b2.to && x3.from <= b2.from) && e7.next) return EditorSelection.range(x3.to, x3.from);
640
639
  }
641
- return y2;
640
+ return b2;
642
641
  });
643
- return b.eq(e6.selection) ? false : (y(setSel(e6, b)), true);
642
+ return x.eq(e6.selection) ? false : (b(setSel(e6, x)), true);
644
643
  };
645
- function addCursorVertically(e6, y) {
646
- let { state: b } = e6, x = b.selection, S = b.selection.ranges.slice();
647
- for (let x2 of b.selection.ranges) {
648
- let C = b.doc.lineAt(x2.head);
649
- if (y ? C.to < e6.state.doc.length : C.from > 0) for (let b2 = x2; ; ) {
650
- let x3 = e6.moveVertically(b2, y);
651
- if (x3.head < C.from || x3.head > C.to) {
652
- S.some((e7) => e7.head == x3.head) || S.push(x3);
644
+ function addCursorVertically(e6, b) {
645
+ let { state: x } = e6, S = x.selection, C = x.selection.ranges.slice();
646
+ for (let S2 of x.selection.ranges) {
647
+ let w = x.doc.lineAt(S2.head);
648
+ if (b ? w.to < e6.state.doc.length : w.from > 0) for (let x2 = S2; ; ) {
649
+ let S3 = e6.moveVertically(x2, b);
650
+ if (S3.head < w.from || S3.head > w.to) {
651
+ C.some((e7) => e7.head == S3.head) || C.push(S3);
653
652
  break;
654
- } else if (x3.head == b2.head) break;
655
- else b2 = x3;
653
+ } else if (S3.head == x2.head) break;
654
+ else x2 = S3;
656
655
  }
657
656
  }
658
- return S.length == x.ranges.length ? false : (e6.dispatch(setSel(b, EditorSelection.create(S, S.length - 1))), true);
657
+ return C.length == S.ranges.length ? false : (e6.dispatch(setSel(x, EditorSelection.create(C, C.length - 1))), true);
659
658
  }
660
- var addCursorAbove = (e6) => addCursorVertically(e6, false), addCursorBelow = (e6) => addCursorVertically(e6, true), simplifySelection = ({ state: e6, dispatch: y }) => {
661
- let b = e6.selection, x = null;
662
- return b.ranges.length > 1 ? x = EditorSelection.create([b.main]) : b.main.empty || (x = EditorSelection.create([EditorSelection.cursor(b.main.head)])), x ? (y(setSel(e6, x)), true) : false;
659
+ var addCursorAbove = (e6) => addCursorVertically(e6, false), addCursorBelow = (e6) => addCursorVertically(e6, true), simplifySelection = ({ state: e6, dispatch: b }) => {
660
+ let x = e6.selection, S = null;
661
+ return x.ranges.length > 1 ? S = EditorSelection.create([x.main]) : x.main.empty || (S = EditorSelection.create([EditorSelection.cursor(x.main.head)])), S ? (b(setSel(e6, S)), true) : false;
663
662
  };
664
- function deleteBy(e6, y) {
663
+ function deleteBy(e6, b) {
665
664
  if (e6.state.readOnly) return false;
666
- let b = "delete.selection", { state: x } = e6, S = x.changeByRange((x2) => {
667
- let { from: S2, to: C } = x2;
668
- if (S2 == C) {
669
- let w = y(x2);
670
- w < S2 ? (b = "delete.backward", w = skipAtomic(e6, w, false)) : w > S2 && (b = "delete.forward", w = skipAtomic(e6, w, true)), S2 = Math.min(S2, w), C = Math.max(C, w);
671
- } else S2 = skipAtomic(e6, S2, false), C = skipAtomic(e6, C, true);
672
- return S2 == C ? { range: x2 } : {
665
+ let x = "delete.selection", { state: S } = e6, C = S.changeByRange((S2) => {
666
+ let { from: C2, to: w } = S2;
667
+ if (C2 == w) {
668
+ let T = b(S2);
669
+ T < C2 ? (x = "delete.backward", T = skipAtomic(e6, T, false)) : T > C2 && (x = "delete.forward", T = skipAtomic(e6, T, true)), C2 = Math.min(C2, T), w = Math.max(w, T);
670
+ } else C2 = skipAtomic(e6, C2, false), w = skipAtomic(e6, w, true);
671
+ return C2 == w ? { range: S2 } : {
673
672
  changes: {
674
- from: S2,
675
- to: C
673
+ from: C2,
674
+ to: w
676
675
  },
677
- range: EditorSelection.cursor(S2, S2 < x2.head ? -1 : 1)
676
+ range: EditorSelection.cursor(C2, C2 < S2.head ? -1 : 1)
678
677
  };
679
678
  });
680
- return S.changes.empty ? false : (e6.dispatch(x.update(S, {
679
+ return C.changes.empty ? false : (e6.dispatch(S.update(C, {
681
680
  scrollIntoView: true,
682
- userEvent: b,
683
- effects: b == "delete.selection" ? EditorView.announce.of(x.phrase("Selection deleted")) : void 0
681
+ userEvent: x,
682
+ effects: x == "delete.selection" ? EditorView.announce.of(S.phrase("Selection deleted")) : void 0
684
683
  })), true);
685
684
  }
686
- function skipAtomic(e6, y, b) {
687
- if (e6 instanceof EditorView) for (let x of e6.state.facet(EditorView.atomicRanges).map((y2) => y2(e6))) x.between(y, y, (e7, x2) => {
688
- e7 < y && x2 > y && (y = b ? x2 : e7);
685
+ function skipAtomic(e6, b, x) {
686
+ if (e6 instanceof EditorView) for (let S of e6.state.facet(EditorView.atomicRanges).map((b2) => b2(e6))) S.between(b, b, (e7, S2) => {
687
+ e7 < b && S2 > b && (b = x ? S2 : e7);
689
688
  });
690
- return y;
689
+ return b;
691
690
  }
692
- var deleteByChar = (e6, y, b) => deleteBy(e6, (x) => {
693
- let S = x.from, { state: C } = e6, w = C.doc.lineAt(S), T, E;
694
- if (b && !y && S > w.from && S < w.from + 200 && !/[^ \t]/.test(T = w.text.slice(0, S - w.from))) {
695
- if (T[T.length - 1] == " ") return S - 1;
696
- let e7 = countColumn(T, C.tabSize) % getIndentUnit(C) || getIndentUnit(C);
697
- for (let y2 = 0; y2 < e7 && T[T.length - 1 - y2] == " "; y2++) S--;
698
- E = S;
699
- } else E = findClusterBreak(w.text, S - w.from, y, y) + w.from, E == S && w.number != (y ? C.doc.lines : 1) ? E += y ? 1 : -1 : !y && /[\ufe00-\ufe0f]/.test(w.text.slice(E - w.from, S - w.from)) && (E = findClusterBreak(w.text, E - w.from, false, false) + w.from);
700
- return E;
701
- }), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6, y) => deleteBy(e6, (b) => {
702
- let x = b.head, { state: S } = e6, C = S.doc.lineAt(x), w = S.charCategorizer(x);
691
+ var deleteByChar = (e6, b, x) => deleteBy(e6, (S) => {
692
+ let C = S.from, { state: w } = e6, T = w.doc.lineAt(C), E, D;
693
+ if (x && !b && C > T.from && C < T.from + 200 && !/[^ \t]/.test(E = T.text.slice(0, C - T.from))) {
694
+ if (E[E.length - 1] == " ") return C - 1;
695
+ let e7 = countColumn(E, w.tabSize) % getIndentUnit(w) || getIndentUnit(w);
696
+ for (let b2 = 0; b2 < e7 && E[E.length - 1 - b2] == " "; b2++) C--;
697
+ D = C;
698
+ } else D = findClusterBreak(T.text, C - T.from, b, b) + T.from, D == C && T.number != (b ? w.doc.lines : 1) ? D += b ? 1 : -1 : !b && /[\ufe00-\ufe0f]/.test(T.text.slice(D - T.from, C - T.from)) && (D = findClusterBreak(T.text, D - T.from, false, false) + T.from);
699
+ return D;
700
+ }), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6, b) => deleteBy(e6, (x) => {
701
+ let S = x.head, { state: C } = e6, w = C.doc.lineAt(S), T = C.charCategorizer(S);
703
702
  for (let e7 = null; ; ) {
704
- if (x == (y ? C.to : C.from)) {
705
- x == b.head && C.number != (y ? S.doc.lines : 1) && (x += y ? 1 : -1);
703
+ if (S == (b ? w.to : w.from)) {
704
+ S == x.head && w.number != (b ? C.doc.lines : 1) && (S += b ? 1 : -1);
706
705
  break;
707
706
  }
708
- let T = findClusterBreak(C.text, x - C.from, y) + C.from, E = C.text.slice(Math.min(x, T) - C.from, Math.max(x, T) - C.from), D = w(E);
709
- if (e7 != null && D != e7) break;
710
- (E != " " || x != b.head) && (e7 = D), x = T;
707
+ let E = findClusterBreak(w.text, S - w.from, b) + w.from, D = w.text.slice(Math.min(S, E) - w.from, Math.max(S, E) - w.from), O = T(D);
708
+ if (e7 != null && O != e7) break;
709
+ (D != " " || S != x.head) && (e7 = O), S = E;
711
710
  }
712
- return x;
713
- }), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (y) => {
714
- let b = e6.lineBlockAt(y.head).to;
715
- return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
716
- }), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (y) => {
717
- let b = e6.moveToLineBoundary(y, false).head;
718
- return y.head > b ? b : Math.max(0, y.head - 1);
719
- }), deleteLineBoundaryForward = (e6) => deleteBy(e6, (y) => {
720
- let b = e6.moveToLineBoundary(y, true).head;
721
- return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
722
- }), splitLine = ({ state: e6, dispatch: y }) => {
711
+ return S;
712
+ }), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (b) => {
713
+ let x = e6.lineBlockAt(b.head).to;
714
+ return b.head < x ? x : Math.min(e6.state.doc.length, b.head + 1);
715
+ }), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (b) => {
716
+ let x = e6.moveToLineBoundary(b, false).head;
717
+ return b.head > x ? x : Math.max(0, b.head - 1);
718
+ }), deleteLineBoundaryForward = (e6) => deleteBy(e6, (b) => {
719
+ let x = e6.moveToLineBoundary(b, true).head;
720
+ return b.head < x ? x : Math.min(e6.state.doc.length, b.head + 1);
721
+ }), splitLine = ({ state: e6, dispatch: b }) => {
723
722
  if (e6.readOnly) return false;
724
- let b = e6.changeByRange((e7) => ({
723
+ let x = e6.changeByRange((e7) => ({
725
724
  changes: {
726
725
  from: e7.from,
727
726
  to: e7.to,
@@ -729,205 +728,205 @@ var deleteByChar = (e6, y, b) => deleteBy(e6, (x) => {
729
728
  },
730
729
  range: EditorSelection.cursor(e7.from)
731
730
  }));
732
- return y(e6.update(b, {
731
+ return b(e6.update(x, {
733
732
  scrollIntoView: true,
734
733
  userEvent: "input"
735
734
  })), true;
736
- }, transposeChars = ({ state: e6, dispatch: y }) => {
735
+ }, transposeChars = ({ state: e6, dispatch: b }) => {
737
736
  if (e6.readOnly) return false;
738
- let b = e6.changeByRange((y2) => {
739
- if (!y2.empty || y2.from == 0 || y2.from == e6.doc.length) return { range: y2 };
740
- let b2 = y2.from, x = e6.doc.lineAt(b2), S = b2 == x.from ? b2 - 1 : findClusterBreak(x.text, b2 - x.from, false) + x.from, C = b2 == x.to ? b2 + 1 : findClusterBreak(x.text, b2 - x.from, true) + x.from;
737
+ let x = e6.changeByRange((b2) => {
738
+ if (!b2.empty || b2.from == 0 || b2.from == e6.doc.length) return { range: b2 };
739
+ let x2 = b2.from, S = e6.doc.lineAt(x2), C = x2 == S.from ? x2 - 1 : findClusterBreak(S.text, x2 - S.from, false) + S.from, w = x2 == S.to ? x2 + 1 : findClusterBreak(S.text, x2 - S.from, true) + S.from;
741
740
  return {
742
741
  changes: {
743
- from: S,
744
- to: C,
745
- insert: e6.doc.slice(b2, C).append(e6.doc.slice(S, b2))
742
+ from: C,
743
+ to: w,
744
+ insert: e6.doc.slice(x2, w).append(e6.doc.slice(C, x2))
746
745
  },
747
- range: EditorSelection.cursor(C)
746
+ range: EditorSelection.cursor(w)
748
747
  };
749
748
  });
750
- return b.changes.empty ? false : (y(e6.update(b, {
749
+ return x.changes.empty ? false : (b(e6.update(x, {
751
750
  scrollIntoView: true,
752
751
  userEvent: "move.character"
753
752
  })), true);
754
753
  };
755
754
  function selectedLineBlocks(e6) {
756
- let y = [], b = -1;
757
- for (let x of e6.selection.ranges) {
758
- let S = e6.doc.lineAt(x.from), C = e6.doc.lineAt(x.to);
759
- if (!x.empty && x.to == C.from && (C = e6.doc.lineAt(x.to - 1)), b >= S.number) {
760
- let e7 = y[y.length - 1];
761
- e7.to = C.to, e7.ranges.push(x);
762
- } else y.push({
763
- from: S.from,
764
- to: C.to,
765
- ranges: [x]
755
+ let b = [], x = -1;
756
+ for (let S of e6.selection.ranges) {
757
+ let C = e6.doc.lineAt(S.from), w = e6.doc.lineAt(S.to);
758
+ if (!S.empty && S.to == w.from && (w = e6.doc.lineAt(S.to - 1)), x >= C.number) {
759
+ let e7 = b[b.length - 1];
760
+ e7.to = w.to, e7.ranges.push(S);
761
+ } else b.push({
762
+ from: C.from,
763
+ to: w.to,
764
+ ranges: [S]
766
765
  });
767
- b = C.number + 1;
766
+ x = w.number + 1;
768
767
  }
769
- return y;
768
+ return b;
770
769
  }
771
- function moveLine(e6, y, b) {
770
+ function moveLine(e6, b, x) {
772
771
  if (e6.readOnly) return false;
773
- let x = [], S = [];
774
- for (let y2 of selectedLineBlocks(e6)) {
775
- if (b ? y2.to == e6.doc.length : y2.from == 0) continue;
776
- let C = e6.doc.lineAt(b ? y2.to + 1 : y2.from - 1), w = C.length + 1;
777
- if (b) {
778
- x.push({
779
- from: y2.to,
780
- to: C.to
772
+ let S = [], C = [];
773
+ for (let b2 of selectedLineBlocks(e6)) {
774
+ if (x ? b2.to == e6.doc.length : b2.from == 0) continue;
775
+ let w = e6.doc.lineAt(x ? b2.to + 1 : b2.from - 1), T = w.length + 1;
776
+ if (x) {
777
+ S.push({
778
+ from: b2.to,
779
+ to: w.to
781
780
  }, {
782
- from: y2.from,
783
- insert: C.text + e6.lineBreak
781
+ from: b2.from,
782
+ insert: w.text + e6.lineBreak
784
783
  });
785
- for (let b2 of y2.ranges) S.push(EditorSelection.range(Math.min(e6.doc.length, b2.anchor + w), Math.min(e6.doc.length, b2.head + w)));
784
+ for (let x2 of b2.ranges) C.push(EditorSelection.range(Math.min(e6.doc.length, x2.anchor + T), Math.min(e6.doc.length, x2.head + T)));
786
785
  } else {
787
- x.push({
788
- from: C.from,
789
- to: y2.from
786
+ S.push({
787
+ from: w.from,
788
+ to: b2.from
790
789
  }, {
791
- from: y2.to,
792
- insert: e6.lineBreak + C.text
790
+ from: b2.to,
791
+ insert: e6.lineBreak + w.text
793
792
  });
794
- for (let e7 of y2.ranges) S.push(EditorSelection.range(e7.anchor - w, e7.head - w));
793
+ for (let e7 of b2.ranges) C.push(EditorSelection.range(e7.anchor - T, e7.head - T));
795
794
  }
796
795
  }
797
- return x.length ? (y(e6.update({
798
- changes: x,
796
+ return S.length ? (b(e6.update({
797
+ changes: S,
799
798
  scrollIntoView: true,
800
- selection: EditorSelection.create(S, e6.selection.mainIndex),
799
+ selection: EditorSelection.create(C, e6.selection.mainIndex),
801
800
  userEvent: "move.line"
802
801
  })), true) : false;
803
802
  }
804
- var moveLineUp = ({ state: e6, dispatch: y }) => moveLine(e6, y, false), moveLineDown = ({ state: e6, dispatch: y }) => moveLine(e6, y, true);
805
- function copyLine(e6, y, b) {
803
+ var moveLineUp = ({ state: e6, dispatch: b }) => moveLine(e6, b, false), moveLineDown = ({ state: e6, dispatch: b }) => moveLine(e6, b, true);
804
+ function copyLine(e6, b, x) {
806
805
  if (e6.readOnly) return false;
807
- let x = [];
808
- for (let y2 of selectedLineBlocks(e6)) b ? x.push({
809
- from: y2.from,
810
- insert: e6.doc.slice(y2.from, y2.to) + e6.lineBreak
811
- }) : x.push({
812
- from: y2.to,
813
- insert: e6.lineBreak + e6.doc.slice(y2.from, y2.to)
806
+ let S = [];
807
+ for (let b2 of selectedLineBlocks(e6)) x ? S.push({
808
+ from: b2.from,
809
+ insert: e6.doc.slice(b2.from, b2.to) + e6.lineBreak
810
+ }) : S.push({
811
+ from: b2.to,
812
+ insert: e6.lineBreak + e6.doc.slice(b2.from, b2.to)
814
813
  });
815
- let S = e6.changes(x);
816
- return y(e6.update({
817
- changes: S,
818
- selection: e6.selection.map(S, b ? 1 : -1),
814
+ let C = e6.changes(S);
815
+ return b(e6.update({
816
+ changes: C,
817
+ selection: e6.selection.map(C, x ? 1 : -1),
819
818
  scrollIntoView: true,
820
819
  userEvent: "input.copyline"
821
820
  })), true;
822
821
  }
823
- var copyLineUp = ({ state: e6, dispatch: y }) => copyLine(e6, y, false), copyLineDown = ({ state: e6, dispatch: y }) => copyLine(e6, y, true), deleteLine = (e6) => {
822
+ var copyLineUp = ({ state: e6, dispatch: b }) => copyLine(e6, b, false), copyLineDown = ({ state: e6, dispatch: b }) => copyLine(e6, b, true), deleteLine = (e6) => {
824
823
  if (e6.state.readOnly) return false;
825
- let { state: y } = e6, b = y.changes(selectedLineBlocks(y).map(({ from: e7, to: b2 }) => (e7 > 0 ? e7-- : b2 < y.doc.length && b2++, {
824
+ let { state: b } = e6, x = b.changes(selectedLineBlocks(b).map(({ from: e7, to: x2 }) => (e7 > 0 ? e7-- : x2 < b.doc.length && x2++, {
826
825
  from: e7,
827
- to: b2
828
- }))), x = updateSel(y.selection, (y2) => {
829
- let b2;
826
+ to: x2
827
+ }))), S = updateSel(b.selection, (b2) => {
828
+ let x2;
830
829
  if (e6.lineWrapping) {
831
- let x2 = e6.lineBlockAt(y2.head), S = e6.coordsAtPos(y2.head, y2.assoc || 1);
832
- S && (b2 = x2.bottom + e6.documentTop - S.bottom + e6.defaultLineHeight / 2);
830
+ let S2 = e6.lineBlockAt(b2.head), C = e6.coordsAtPos(b2.head, b2.assoc || 1);
831
+ C && (x2 = S2.bottom + e6.documentTop - C.bottom + e6.defaultLineHeight / 2);
833
832
  }
834
- return e6.moveVertically(y2, true, b2);
835
- }).map(b);
833
+ return e6.moveVertically(b2, true, x2);
834
+ }).map(x);
836
835
  return e6.dispatch({
837
- changes: b,
838
- selection: x,
836
+ changes: x,
837
+ selection: S,
839
838
  scrollIntoView: true,
840
839
  userEvent: "delete.line"
841
840
  }), true;
842
841
  };
843
- function isBetweenBrackets(e6, y) {
844
- if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(y - 1, y + 1))) return {
845
- from: y,
846
- to: y
842
+ function isBetweenBrackets(e6, b) {
843
+ if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(b - 1, b + 1))) return {
844
+ from: b,
845
+ to: b
847
846
  };
848
- let b = syntaxTree(e6).resolveInner(y), x = b.childBefore(y), S = b.childAfter(y), C;
849
- return x && S && x.to <= y && S.from >= y && (C = x.type.prop(NodeProp.closedBy)) && C.indexOf(S.name) > -1 && e6.doc.lineAt(x.to).from == e6.doc.lineAt(S.from).from && !/\S/.test(e6.sliceDoc(x.to, S.from)) ? {
850
- from: x.to,
851
- to: S.from
847
+ let x = syntaxTree(e6).resolveInner(b), S = x.childBefore(b), C = x.childAfter(b), w;
848
+ return S && C && S.to <= b && C.from >= b && (w = S.type.prop(NodeProp.closedBy)) && w.indexOf(C.name) > -1 && e6.doc.lineAt(S.to).from == e6.doc.lineAt(C.from).from && !/\S/.test(e6.sliceDoc(S.to, C.from)) ? {
849
+ from: S.to,
850
+ to: C.from
852
851
  } : null;
853
852
  }
854
853
  var insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false), insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
855
854
  function newlineAndIndent(e6) {
856
- return ({ state: y, dispatch: b }) => {
857
- if (y.readOnly) return false;
858
- let x = y.changeByRange((b2) => {
859
- let { from: x2, to: S } = b2, C = y.doc.lineAt(x2), w = !e6 && x2 == S && isBetweenBrackets(y, x2);
860
- e6 && (x2 = S = (S <= C.to ? C : y.doc.lineAt(S)).to);
861
- let T = new IndentContext(y, {
862
- simulateBreak: x2,
863
- simulateDoubleBreak: !!w
864
- }), E = getIndentation(T, x2);
865
- for (E ?? (E = countColumn(/^\s*/.exec(y.doc.lineAt(x2).text)[0], y.tabSize)); S < C.to && /\s/.test(C.text[S - C.from]); ) S++;
866
- w ? { from: x2, to: S } = w : x2 > C.from && x2 < C.from + 100 && !/\S/.test(C.text.slice(0, x2)) && (x2 = C.from);
867
- let D = ["", indentString(y, E)];
868
- return w && D.push(indentString(y, T.lineIndent(C.from, -1))), {
855
+ return ({ state: b, dispatch: x }) => {
856
+ if (b.readOnly) return false;
857
+ let S = b.changeByRange((x2) => {
858
+ let { from: S2, to: C } = x2, w = b.doc.lineAt(S2), T = !e6 && S2 == C && isBetweenBrackets(b, S2);
859
+ e6 && (S2 = C = (C <= w.to ? w : b.doc.lineAt(C)).to);
860
+ let E = new IndentContext(b, {
861
+ simulateBreak: S2,
862
+ simulateDoubleBreak: !!T
863
+ }), D = getIndentation(E, S2);
864
+ for (D ?? (D = countColumn(/^\s*/.exec(b.doc.lineAt(S2).text)[0], b.tabSize)); C < w.to && /\s/.test(w.text[C - w.from]); ) C++;
865
+ T ? { from: S2, to: C } = T : S2 > w.from && S2 < w.from + 100 && !/\S/.test(w.text.slice(0, S2)) && (S2 = w.from);
866
+ let O = ["", indentString(b, D)];
867
+ return T && O.push(indentString(b, E.lineIndent(w.from, -1))), {
869
868
  changes: {
870
- from: x2,
871
- to: S,
872
- insert: Text.of(D)
869
+ from: S2,
870
+ to: C,
871
+ insert: Text.of(O)
873
872
  },
874
- range: EditorSelection.cursor(x2 + 1 + D[1].length)
873
+ range: EditorSelection.cursor(S2 + 1 + O[1].length)
875
874
  };
876
875
  });
877
- return b(y.update(x, {
876
+ return x(b.update(S, {
878
877
  scrollIntoView: true,
879
878
  userEvent: "input"
880
879
  })), true;
881
880
  };
882
881
  }
883
- function changeBySelectedLine(e6, y) {
884
- let b = -1;
885
- return e6.changeByRange((x) => {
886
- let S = [];
887
- for (let C2 = x.from; C2 <= x.to; ) {
888
- let w = e6.doc.lineAt(C2);
889
- w.number > b && (x.empty || x.to > w.from) && (y(w, S, x), b = w.number), C2 = w.to + 1;
882
+ function changeBySelectedLine(e6, b) {
883
+ let x = -1;
884
+ return e6.changeByRange((S) => {
885
+ let C = [];
886
+ for (let w2 = S.from; w2 <= S.to; ) {
887
+ let T = e6.doc.lineAt(w2);
888
+ T.number > x && (S.empty || S.to > T.from) && (b(T, C, S), x = T.number), w2 = T.to + 1;
890
889
  }
891
- let C = e6.changes(S);
890
+ let w = e6.changes(C);
892
891
  return {
893
- changes: S,
894
- range: EditorSelection.range(C.mapPos(x.anchor, 1), C.mapPos(x.head, 1))
892
+ changes: C,
893
+ range: EditorSelection.range(w.mapPos(S.anchor, 1), w.mapPos(S.head, 1))
895
894
  };
896
895
  });
897
896
  }
898
- var indentSelection = ({ state: e6, dispatch: y }) => {
897
+ var indentSelection = ({ state: e6, dispatch: b }) => {
899
898
  if (e6.readOnly) return false;
900
- let b = /* @__PURE__ */ Object.create(null), x = new IndentContext(e6, { overrideIndentation: (e7) => b[e7] ?? -1 }), S = changeBySelectedLine(e6, (y2, S2, C) => {
901
- let w = getIndentation(x, y2.from);
902
- if (w == null) return;
903
- /\S/.test(y2.text) || (w = 0);
904
- let T = /^\s*/.exec(y2.text)[0], E = indentString(e6, w);
905
- (T != E || C.from < y2.from + T.length) && (b[y2.from] = w, S2.push({
906
- from: y2.from,
907
- to: y2.from + T.length,
908
- insert: E
899
+ let x = /* @__PURE__ */ Object.create(null), S = new IndentContext(e6, { overrideIndentation: (e7) => x[e7] ?? -1 }), C = changeBySelectedLine(e6, (b2, C2, w) => {
900
+ let T = getIndentation(S, b2.from);
901
+ if (T == null) return;
902
+ /\S/.test(b2.text) || (T = 0);
903
+ let E = /^\s*/.exec(b2.text)[0], D = indentString(e6, T);
904
+ (E != D || w.from < b2.from + E.length) && (x[b2.from] = T, C2.push({
905
+ from: b2.from,
906
+ to: b2.from + E.length,
907
+ insert: D
909
908
  }));
910
909
  });
911
- return S.changes.empty || y(e6.update(S, { userEvent: "indent" })), true;
912
- }, indentMore = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
913
- b.push({
914
- from: y2.from,
910
+ return C.changes.empty || b(e6.update(C, { userEvent: "indent" })), true;
911
+ }, indentMore = ({ state: e6, dispatch: b }) => e6.readOnly ? false : (b(e6.update(changeBySelectedLine(e6, (b2, x) => {
912
+ x.push({
913
+ from: b2.from,
915
914
  insert: e6.facet(indentUnit)
916
915
  });
917
- }), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
918
- let x = /^\s*/.exec(y2.text)[0];
919
- if (!x) return;
920
- let S = countColumn(x, e6.tabSize), C = 0, w = indentString(e6, Math.max(0, S - getIndentUnit(e6)));
921
- for (; C < x.length && C < w.length && x.charCodeAt(C) == w.charCodeAt(C); ) C++;
922
- b.push({
923
- from: y2.from + C,
924
- to: y2.from + x.length,
925
- insert: w.slice(C)
916
+ }), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch: b }) => e6.readOnly ? false : (b(e6.update(changeBySelectedLine(e6, (b2, x) => {
917
+ let S = /^\s*/.exec(b2.text)[0];
918
+ if (!S) return;
919
+ let C = countColumn(S, e6.tabSize), w = 0, T = indentString(e6, Math.max(0, C - getIndentUnit(e6)));
920
+ for (; w < S.length && w < T.length && S.charCodeAt(w) == T.charCodeAt(w); ) w++;
921
+ x.push({
922
+ from: b2.from + w,
923
+ to: b2.from + S.length,
924
+ insert: T.slice(w)
926
925
  });
927
- }), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch: y }) => e6.selection.ranges.some((e7) => !e7.empty) ? indentMore({
926
+ }), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch: b }) => e6.selection.ranges.some((e7) => !e7.empty) ? indentMore({
928
927
  state: e6,
929
- dispatch: y
930
- }) : (y(e6.update(e6.replaceSelection(" "), {
928
+ dispatch: b
929
+ }) : (b(e6.update(e6.replaceSelection(" "), {
931
930
  scrollIntoView: true,
932
931
  userEvent: "input"
933
932
  })), true), emacsStyleKeymap = [
@@ -1232,135 +1231,135 @@ var indentSelection = ({ state: e6, dispatch: y }) => {
1232
1231
  run: indentMore,
1233
1232
  shift: indentLess
1234
1233
  }, SelectedDiagnostic = class {
1235
- constructor(e6, y, b) {
1236
- this.from = e6, this.to = y, this.diagnostic = b;
1234
+ constructor(e6, b, x) {
1235
+ this.from = e6, this.to = b, this.diagnostic = x;
1237
1236
  }
1238
1237
  }, LintState = class e3 {
1239
- constructor(e6, y, b) {
1240
- this.diagnostics = e6, this.panel = y, this.selected = b;
1238
+ constructor(e6, b, x) {
1239
+ this.diagnostics = e6, this.panel = b, this.selected = x;
1241
1240
  }
1242
- static init(y, b, x) {
1243
- let S = x.facet(lintConfig).markerFilter;
1244
- S && (y = S(y, x));
1245
- let C = y.slice().sort((e6, y2) => e6.from - y2.from || e6.to - y2.to), w = new RangeSetBuilder(), T = [], E = 0, D = x.doc.iter(), O = 0, k = x.doc.length;
1241
+ static init(b, x, S) {
1242
+ let C = S.facet(lintConfig).markerFilter;
1243
+ C && (b = C(b, S));
1244
+ let w = b.slice().sort((e6, b2) => e6.from - b2.from || e6.to - b2.to), T = new RangeSetBuilder(), E = [], D = 0, O = S.doc.iter(), k = 0, A = S.doc.length;
1246
1245
  for (let e6 = 0; ; ) {
1247
- let y2 = e6 == C.length ? null : C[e6];
1248
- if (!y2 && !T.length) break;
1249
- let b2, x2;
1250
- if (T.length) b2 = E, x2 = T.reduce((e7, y3) => Math.min(e7, y3.to), y2 && y2.from > b2 ? y2.from : 1e8);
1246
+ let b2 = e6 == w.length ? null : w[e6];
1247
+ if (!b2 && !E.length) break;
1248
+ let x2, S2;
1249
+ if (E.length) x2 = D, S2 = E.reduce((e7, b3) => Math.min(e7, b3.to), b2 && b2.from > x2 ? b2.from : 1e8);
1251
1250
  else {
1252
- if (b2 = y2.from, b2 > k) break;
1253
- x2 = y2.to, T.push(y2), e6++;
1251
+ if (x2 = b2.from, x2 > A) break;
1252
+ S2 = b2.to, E.push(b2), e6++;
1254
1253
  }
1255
- for (; e6 < C.length; ) {
1256
- let y3 = C[e6];
1257
- if (y3.from == b2 && (y3.to > y3.from || y3.to == b2)) T.push(y3), e6++, x2 = Math.min(y3.to, x2);
1254
+ for (; e6 < w.length; ) {
1255
+ let b3 = w[e6];
1256
+ if (b3.from == x2 && (b3.to > b3.from || b3.to == x2)) E.push(b3), e6++, S2 = Math.min(b3.to, S2);
1258
1257
  else {
1259
- x2 = Math.min(y3.from, x2);
1258
+ S2 = Math.min(b3.from, S2);
1260
1259
  break;
1261
1260
  }
1262
1261
  }
1263
- x2 = Math.min(x2, k);
1264
- let S2 = false;
1265
- if (T.some((e7) => e7.from == b2 && (e7.to == x2 || x2 == k)) && (S2 = b2 == x2, !S2 && x2 - b2 < 10)) {
1266
- let e7 = b2 - (O + D.value.length);
1267
- e7 > 0 && (D.next(e7), O = b2);
1268
- for (let e8 = b2; ; ) {
1269
- if (e8 >= x2) {
1270
- S2 = true;
1262
+ S2 = Math.min(S2, A);
1263
+ let C2 = false;
1264
+ if (E.some((e7) => e7.from == x2 && (e7.to == S2 || S2 == A)) && (C2 = x2 == S2, !C2 && S2 - x2 < 10)) {
1265
+ let e7 = x2 - (k + O.value.length);
1266
+ e7 > 0 && (O.next(e7), k = x2);
1267
+ for (let e8 = x2; ; ) {
1268
+ if (e8 >= S2) {
1269
+ C2 = true;
1271
1270
  break;
1272
1271
  }
1273
- if (!D.lineBreak && O + D.value.length > e8) break;
1274
- e8 = O + D.value.length, O += D.value.length, D.next();
1272
+ if (!O.lineBreak && k + O.value.length > e8) break;
1273
+ e8 = k + O.value.length, k += O.value.length, O.next();
1275
1274
  }
1276
1275
  }
1277
- let A2 = maxSeverity(T);
1278
- if (S2) w.add(b2, b2, Decoration.widget({
1279
- widget: new DiagnosticWidget(A2),
1280
- diagnostics: T.slice()
1276
+ let j2 = maxSeverity(E);
1277
+ if (C2) T.add(x2, x2, Decoration.widget({
1278
+ widget: new DiagnosticWidget(j2),
1279
+ diagnostics: E.slice()
1281
1280
  }));
1282
1281
  else {
1283
- let e7 = T.reduce((e8, y3) => y3.markClass ? e8 + " " + y3.markClass : e8, "");
1284
- w.add(b2, x2, Decoration.mark({
1285
- class: "cm-lintRange cm-lintRange-" + A2 + e7,
1286
- diagnostics: T.slice(),
1287
- inclusiveEnd: T.some((e8) => e8.to > x2)
1282
+ let e7 = E.reduce((e8, b3) => b3.markClass ? e8 + " " + b3.markClass : e8, "");
1283
+ T.add(x2, S2, Decoration.mark({
1284
+ class: "cm-lintRange cm-lintRange-" + j2 + e7,
1285
+ diagnostics: E.slice(),
1286
+ inclusiveEnd: E.some((e8) => e8.to > S2)
1288
1287
  }));
1289
1288
  }
1290
- if (E = x2, E == k) break;
1291
- for (let e7 = 0; e7 < T.length; e7++) T[e7].to <= E && T.splice(e7--, 1);
1289
+ if (D = S2, D == A) break;
1290
+ for (let e7 = 0; e7 < E.length; e7++) E[e7].to <= D && E.splice(e7--, 1);
1292
1291
  }
1293
- let A = w.finish();
1294
- return new e3(A, b, findDiagnostic(A));
1292
+ let j = T.finish();
1293
+ return new e3(j, x, findDiagnostic(j));
1295
1294
  }
1296
1295
  };
1297
- function findDiagnostic(e6, y = null, b = 0) {
1298
- let x = null;
1299
- return e6.between(b, 1e9, (e7, b2, { spec: S }) => {
1300
- if (!(y && S.diagnostics.indexOf(y) < 0)) if (!x) x = new SelectedDiagnostic(e7, b2, y || S.diagnostics[0]);
1301
- else if (S.diagnostics.indexOf(x.diagnostic) < 0) return false;
1302
- else x = new SelectedDiagnostic(x.from, b2, x.diagnostic);
1303
- }), x;
1296
+ function findDiagnostic(e6, b = null, x = 0) {
1297
+ let S = null;
1298
+ return e6.between(x, 1e9, (e7, x2, { spec: C }) => {
1299
+ if (!(b && C.diagnostics.indexOf(b) < 0)) if (!S) S = new SelectedDiagnostic(e7, x2, b || C.diagnostics[0]);
1300
+ else if (C.diagnostics.indexOf(S.diagnostic) < 0) return false;
1301
+ else S = new SelectedDiagnostic(S.from, x2, S.diagnostic);
1302
+ }), S;
1304
1303
  }
1305
- function hideTooltip(e6, y) {
1306
- let b = y.pos, x = y.end || b, S = e6.state.facet(lintConfig).hideOn(e6, b, x);
1307
- if (S != null) return S;
1308
- let C = e6.startState.doc.lineAt(y.pos);
1309
- return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(C.from, Math.max(C.to, x)));
1304
+ function hideTooltip(e6, b) {
1305
+ let x = b.pos, S = b.end || x, C = e6.state.facet(lintConfig).hideOn(e6, x, S);
1306
+ if (C != null) return C;
1307
+ let w = e6.startState.doc.lineAt(b.pos);
1308
+ return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(w.from, Math.max(w.to, S)));
1310
1309
  }
1311
- function maybeEnableLint(e6, y) {
1312
- return e6.field(lintState, false) ? y : y.concat(StateEffect.appendConfig.of(lintExtensions));
1310
+ function maybeEnableLint(e6, b) {
1311
+ return e6.field(lintState, false) ? b : b.concat(StateEffect.appendConfig.of(lintExtensions));
1313
1312
  }
1314
- function setDiagnostics(e6, y) {
1315
- return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(y)]) };
1313
+ function setDiagnostics(e6, b) {
1314
+ return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(b)]) };
1316
1315
  }
1317
1316
  var setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define(), togglePanel$1 = /* @__PURE__ */ StateEffect.define(), movePanelSelection = /* @__PURE__ */ StateEffect.define(), lintState = /* @__PURE__ */ StateField.define({
1318
1317
  create() {
1319
1318
  return new LintState(Decoration.none, null, null);
1320
1319
  },
1321
- update(e6, y) {
1322
- if (y.docChanged && e6.diagnostics.size) {
1323
- let b = e6.diagnostics.map(y.changes), x = null, S = e6.panel;
1320
+ update(e6, b) {
1321
+ if (b.docChanged && e6.diagnostics.size) {
1322
+ let x = e6.diagnostics.map(b.changes), S = null, C = e6.panel;
1324
1323
  if (e6.selected) {
1325
- let S2 = y.changes.mapPos(e6.selected.from, 1);
1326
- x = findDiagnostic(b, e6.selected.diagnostic, S2) || findDiagnostic(b, null, S2);
1324
+ let C2 = b.changes.mapPos(e6.selected.from, 1);
1325
+ S = findDiagnostic(x, e6.selected.diagnostic, C2) || findDiagnostic(x, null, C2);
1327
1326
  }
1328
- !b.size && S && y.state.facet(lintConfig).autoPanel && (S = null), e6 = new LintState(b, S, x);
1327
+ !x.size && C && b.state.facet(lintConfig).autoPanel && (C = null), e6 = new LintState(x, C, S);
1329
1328
  }
1330
- for (let b of y.effects) if (b.is(setDiagnosticsEffect)) {
1331
- let x = y.state.facet(lintConfig).autoPanel ? b.value.length ? LintPanel.open : null : e6.panel;
1332
- e6 = LintState.init(b.value, x, y.state);
1333
- } else b.is(togglePanel$1) ? e6 = new LintState(e6.diagnostics, b.value ? LintPanel.open : null, e6.selected) : b.is(movePanelSelection) && (e6 = new LintState(e6.diagnostics, e6.panel, b.value));
1329
+ for (let x of b.effects) if (x.is(setDiagnosticsEffect)) {
1330
+ let S = b.state.facet(lintConfig).autoPanel ? x.value.length ? LintPanel.open : null : e6.panel;
1331
+ e6 = LintState.init(x.value, S, b.state);
1332
+ } else x.is(togglePanel$1) ? e6 = new LintState(e6.diagnostics, x.value ? LintPanel.open : null, e6.selected) : x.is(movePanelSelection) && (e6 = new LintState(e6.diagnostics, e6.panel, x.value));
1334
1333
  return e6;
1335
1334
  },
1336
1335
  provide: (e6) => [showPanel.from(e6, (e7) => e7.panel), EditorView.decorations.from(e6, (e7) => e7.diagnostics)]
1337
1336
  }), activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
1338
- function lintTooltip(e6, y, b) {
1339
- let { diagnostics: x } = e6.state.field(lintState), S, C = -1, w = -1;
1340
- x.between(y - (b < 0 ? 1 : 0), y + (b > 0 ? 1 : 0), (e7, x2, { spec: T2 }) => {
1341
- if (y >= e7 && y <= x2 && (e7 == x2 || (y > e7 || b > 0) && (y < x2 || b < 0))) return S = T2.diagnostics, C = e7, w = x2, false;
1337
+ function lintTooltip(e6, b, x) {
1338
+ let { diagnostics: S } = e6.state.field(lintState), C, w = -1, T = -1;
1339
+ S.between(b - (x < 0 ? 1 : 0), b + (x > 0 ? 1 : 0), (e7, S2, { spec: E2 }) => {
1340
+ if (b >= e7 && b <= S2 && (e7 == S2 || (b > e7 || x > 0) && (b < S2 || x < 0))) return C = E2.diagnostics, w = e7, T = S2, false;
1342
1341
  });
1343
- let T = e6.state.facet(lintConfig).tooltipFilter;
1344
- return S && T && (S = T(S, e6.state)), S ? {
1345
- pos: C,
1346
- end: w,
1347
- above: e6.state.doc.lineAt(C).to < w,
1342
+ let E = e6.state.facet(lintConfig).tooltipFilter;
1343
+ return C && E && (C = E(C, e6.state)), C ? {
1344
+ pos: w,
1345
+ end: T,
1346
+ above: e6.state.doc.lineAt(w).to < T,
1348
1347
  create() {
1349
- return { dom: diagnosticsTooltip(e6, S) };
1348
+ return { dom: diagnosticsTooltip(e6, C) };
1350
1349
  }
1351
1350
  } : null;
1352
1351
  }
1353
- function diagnosticsTooltip(e6, y) {
1354
- return crelt("ul", { class: "cm-tooltip-lint" }, y.map((y2) => renderDiagnostic(e6, y2, false)));
1352
+ function diagnosticsTooltip(e6, b) {
1353
+ return crelt("ul", { class: "cm-tooltip-lint" }, b.map((b2) => renderDiagnostic(e6, b2, false)));
1355
1354
  }
1356
1355
  var openLintPanel = (e6) => {
1357
- let y = e6.state.field(lintState, false);
1358
- (!y || !y.panel) && e6.dispatch({ effects: maybeEnableLint(e6.state, [togglePanel$1.of(true)]) });
1359
- let b = getPanel(e6, LintPanel.open);
1360
- return b && b.dom.querySelector(".cm-panel-lint ul").focus(), true;
1356
+ let b = e6.state.field(lintState, false);
1357
+ (!b || !b.panel) && e6.dispatch({ effects: maybeEnableLint(e6.state, [togglePanel$1.of(true)]) });
1358
+ let x = getPanel(e6, LintPanel.open);
1359
+ return x && x.dom.querySelector(".cm-panel-lint ul").focus(), true;
1361
1360
  }, closeLintPanel = (e6) => {
1362
- let y = e6.state.field(lintState, false);
1363
- return !y || !y.panel ? false : (e6.dispatch({ effects: togglePanel$1.of(false) }), true);
1361
+ let b = e6.state.field(lintState, false);
1362
+ return !b || !b.panel ? false : (e6.dispatch({ effects: togglePanel$1.of(false) }), true);
1364
1363
  }, lintKeymap = [{
1365
1364
  key: "Mod-Shift-m",
1366
1365
  run: openLintPanel,
@@ -1368,13 +1367,13 @@ var openLintPanel = (e6) => {
1368
1367
  }, {
1369
1368
  key: "F8",
1370
1369
  run: (e6) => {
1371
- let y = e6.state.field(lintState, false);
1372
- if (!y) return false;
1373
- let b = e6.state.selection.main, x = y.diagnostics.iter(b.to + 1);
1374
- return !x.value && (x = y.diagnostics.iter(0), !x.value || x.from == b.from && x.to == b.to) ? false : (e6.dispatch({
1370
+ let b = e6.state.field(lintState, false);
1371
+ if (!b) return false;
1372
+ let x = e6.state.selection.main, S = b.diagnostics.iter(x.to + 1);
1373
+ return !S.value && (S = b.diagnostics.iter(0), !S.value || S.from == x.from && S.to == x.to) ? false : (e6.dispatch({
1375
1374
  selection: {
1376
- anchor: x.from,
1377
- head: x.to
1375
+ anchor: S.from,
1376
+ head: S.to
1378
1377
  },
1379
1378
  scrollIntoView: true
1380
1379
  }), true);
@@ -1382,8 +1381,8 @@ var openLintPanel = (e6) => {
1382
1381
  }], lintPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
1383
1382
  constructor(e6) {
1384
1383
  this.view = e6, this.timeout = -1, this.set = true;
1385
- let { delay: y } = e6.state.facet(lintConfig);
1386
- this.lintTime = Date.now() + y, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, y);
1384
+ let { delay: b } = e6.state.facet(lintConfig);
1385
+ this.lintTime = Date.now() + b, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, b);
1387
1386
  }
1388
1387
  run() {
1389
1388
  clearTimeout(this.timeout);
@@ -1391,17 +1390,17 @@ var openLintPanel = (e6) => {
1391
1390
  if (e6 < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e6);
1392
1391
  else {
1393
1392
  this.set = false;
1394
- let { state: e7 } = this.view, { sources: y } = e7.facet(lintConfig);
1395
- y.length && batchResults(y.map((e8) => Promise.resolve(e8(this.view))), (y2) => {
1396
- this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state, y2.reduce((e8, y3) => e8.concat(y3))));
1393
+ let { state: e7 } = this.view, { sources: b } = e7.facet(lintConfig);
1394
+ b.length && batchResults(b.map((e8) => Promise.resolve(e8(this.view))), (b2) => {
1395
+ this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state, b2.reduce((e8, b3) => e8.concat(b3))));
1397
1396
  }, (e8) => {
1398
1397
  logException(this.view.state, e8);
1399
1398
  });
1400
1399
  }
1401
1400
  }
1402
1401
  update(e6) {
1403
- let y = e6.state.facet(lintConfig);
1404
- (e6.docChanged || y != e6.startState.facet(lintConfig) || y.needsRefresh && y.needsRefresh(e6)) && (this.lintTime = Date.now() + y.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, y.delay)));
1402
+ let b = e6.state.facet(lintConfig);
1403
+ (e6.docChanged || b != e6.startState.facet(lintConfig) || b.needsRefresh && b.needsRefresh(e6)) && (this.lintTime = Date.now() + b.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, b.delay)));
1405
1404
  }
1406
1405
  force() {
1407
1406
  this.set && (this.lintTime = Date.now(), this.run());
@@ -1410,11 +1409,11 @@ var openLintPanel = (e6) => {
1410
1409
  clearTimeout(this.timeout);
1411
1410
  }
1412
1411
  });
1413
- function batchResults(e6, y, b) {
1414
- let x = [], S = -1;
1415
- for (let C of e6) C.then((b2) => {
1416
- x.push(b2), clearTimeout(S), x.length == e6.length ? y(x) : S = setTimeout(() => y(x), 200);
1417
- }, b);
1412
+ function batchResults(e6, b, x) {
1413
+ let S = [], C = -1;
1414
+ for (let w of e6) w.then((x2) => {
1415
+ S.push(x2), clearTimeout(C), S.length == e6.length ? b(S) : C = setTimeout(() => b(S), 200);
1416
+ }, x);
1418
1417
  }
1419
1418
  var lintConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
1420
1419
  return {
@@ -1429,61 +1428,61 @@ var lintConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
1429
1428
  delay: Math.max,
1430
1429
  markerFilter: combineFilter,
1431
1430
  tooltipFilter: combineFilter,
1432
- needsRefresh: (e7, y) => e7 ? y ? (b) => e7(b) || y(b) : e7 : y,
1433
- hideOn: (e7, y) => e7 ? y ? (b, x, S) => e7(b, x, S) || y(b, x, S) : e7 : y,
1434
- autoPanel: (e7, y) => e7 || y
1431
+ needsRefresh: (e7, b) => e7 ? b ? (x) => e7(x) || b(x) : e7 : b,
1432
+ hideOn: (e7, b) => e7 ? b ? (x, S, C) => e7(x, S, C) || b(x, S, C) : e7 : b,
1433
+ autoPanel: (e7, b) => e7 || b
1435
1434
  })
1436
1435
  };
1437
1436
  } });
1438
- function combineFilter(e6, y) {
1439
- return e6 ? y ? (b, x) => y(e6(b, x), x) : e6 : y;
1437
+ function combineFilter(e6, b) {
1438
+ return e6 ? b ? (x, S) => b(e6(x, S), S) : e6 : b;
1440
1439
  }
1441
- function linter(e6, y = {}) {
1440
+ function linter(e6, b = {}) {
1442
1441
  return [
1443
1442
  lintConfig.of({
1444
1443
  source: e6,
1445
- config: y
1444
+ config: b
1446
1445
  }),
1447
1446
  lintPlugin,
1448
1447
  lintExtensions
1449
1448
  ];
1450
1449
  }
1451
1450
  function assignKeys(e6) {
1452
- let y = [];
1453
- if (e6) actions: for (let { name: b } of e6) {
1454
- for (let e7 = 0; e7 < b.length; e7++) {
1455
- let x = b[e7];
1456
- if (/[a-zA-Z]/.test(x) && !y.some((e8) => e8.toLowerCase() == x.toLowerCase())) {
1457
- y.push(x);
1451
+ let b = [];
1452
+ if (e6) actions: for (let { name: x } of e6) {
1453
+ for (let e7 = 0; e7 < x.length; e7++) {
1454
+ let S = x[e7];
1455
+ if (/[a-zA-Z]/.test(S) && !b.some((e8) => e8.toLowerCase() == S.toLowerCase())) {
1456
+ b.push(S);
1458
1457
  continue actions;
1459
1458
  }
1460
1459
  }
1461
- y.push("");
1460
+ b.push("");
1462
1461
  }
1463
- return y;
1462
+ return b;
1464
1463
  }
1465
- function renderDiagnostic(e6, y, b) {
1464
+ function renderDiagnostic(e6, b, x) {
1466
1465
  var _a;
1467
- let x = b ? assignKeys(y.actions) : [];
1468
- return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + y.severity }, crelt("span", { class: "cm-diagnosticText" }, y.renderMessage ? y.renderMessage(e6) : y.message), (_a = y.actions) == null ? void 0 : _a.map((b2, S) => {
1469
- let C = false, w = (x2) => {
1470
- if (x2.preventDefault(), C) return;
1471
- C = true;
1472
- let S2 = findDiagnostic(e6.state.field(lintState).diagnostics, y);
1473
- S2 && b2.apply(e6, S2.from, S2.to);
1474
- }, { name: T } = b2, E = x[S] ? T.indexOf(x[S]) : -1, D = E < 0 ? T : [
1475
- T.slice(0, E),
1476
- crelt("u", T.slice(E, E + 1)),
1477
- T.slice(E + 1)
1466
+ let S = x ? assignKeys(b.actions) : [];
1467
+ return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + b.severity }, crelt("span", { class: "cm-diagnosticText" }, b.renderMessage ? b.renderMessage(e6) : b.message), (_a = b.actions) == null ? void 0 : _a.map((x2, C) => {
1468
+ let w = false, T = (S2) => {
1469
+ if (S2.preventDefault(), w) return;
1470
+ w = true;
1471
+ let C2 = findDiagnostic(e6.state.field(lintState).diagnostics, b);
1472
+ C2 && x2.apply(e6, C2.from, C2.to);
1473
+ }, { name: E } = x2, D = S[C] ? E.indexOf(S[C]) : -1, O = D < 0 ? E : [
1474
+ E.slice(0, D),
1475
+ crelt("u", E.slice(D, D + 1)),
1476
+ E.slice(D + 1)
1478
1477
  ];
1479
1478
  return crelt("button", {
1480
1479
  type: "button",
1481
- class: "cm-diagnosticAction" + (b2.markClass ? " " + b2.markClass : ""),
1482
- onclick: w,
1483
- onmousedown: w,
1484
- "aria-label": ` Action: ${T}${E < 0 ? "" : ` (access key "${x[S]})"`}.`
1485
- }, D);
1486
- }), y.source && crelt("div", { class: "cm-diagnosticSource" }, y.source));
1480
+ class: "cm-diagnosticAction" + (x2.markClass ? " " + x2.markClass : ""),
1481
+ onclick: T,
1482
+ onmousedown: T,
1483
+ "aria-label": ` Action: ${E}${D < 0 ? "" : ` (access key "${S[C]})"`}.`
1484
+ }, O);
1485
+ }), b.source && crelt("div", { class: "cm-diagnosticSource" }, b.source));
1487
1486
  }
1488
1487
  var DiagnosticWidget = class extends WidgetType {
1489
1488
  constructor(e6) {
@@ -1496,36 +1495,38 @@ var DiagnosticWidget = class extends WidgetType {
1496
1495
  return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
1497
1496
  }
1498
1497
  }, PanelItem = class {
1499
- constructor(e6, y) {
1500
- this.diagnostic = y, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = renderDiagnostic(e6, y, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
1498
+ constructor(e6, b) {
1499
+ this.diagnostic = b, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = renderDiagnostic(e6, b, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
1501
1500
  }
1502
1501
  }, LintPanel = class e4 {
1503
1502
  constructor(e6) {
1504
1503
  this.view = e6, this.items = [];
1505
- let y = (y2) => {
1506
- if (y2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
1507
- else if (y2.keyCode == 38 || y2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
1508
- else if (y2.keyCode == 40 || y2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
1509
- else if (y2.keyCode == 36) this.moveSelection(0);
1510
- else if (y2.keyCode == 35) this.moveSelection(this.items.length - 1);
1511
- else if (y2.keyCode == 13) this.view.focus();
1512
- else if (y2.keyCode >= 65 && y2.keyCode <= 90 && this.selectedIndex >= 0) {
1513
- let { diagnostic: b2 } = this.items[this.selectedIndex], x = assignKeys(b2.actions);
1514
- for (let S = 0; S < x.length; S++) if (x[S].toUpperCase().charCodeAt(0) == y2.keyCode) {
1515
- let y3 = findDiagnostic(this.view.state.field(lintState).diagnostics, b2);
1516
- y3 && b2.actions[S].apply(e6, y3.from, y3.to);
1517
- }
1518
- } else return;
1519
- y2.preventDefault();
1520
- }, b = (e7) => {
1521
- for (let y2 = 0; y2 < this.items.length; y2++) this.items[y2].dom.contains(e7.target) && this.moveSelection(y2);
1504
+ let b = (b2) => {
1505
+ if (!(b2.ctrlKey || b2.altKey || b2.metaKey)) {
1506
+ if (b2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
1507
+ else if (b2.keyCode == 38 || b2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
1508
+ else if (b2.keyCode == 40 || b2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
1509
+ else if (b2.keyCode == 36) this.moveSelection(0);
1510
+ else if (b2.keyCode == 35) this.moveSelection(this.items.length - 1);
1511
+ else if (b2.keyCode == 13) this.view.focus();
1512
+ else if (b2.keyCode >= 65 && b2.keyCode <= 90 && this.selectedIndex >= 0) {
1513
+ let { diagnostic: x2 } = this.items[this.selectedIndex], S = assignKeys(x2.actions);
1514
+ for (let C = 0; C < S.length; C++) if (S[C].toUpperCase().charCodeAt(0) == b2.keyCode) {
1515
+ let b3 = findDiagnostic(this.view.state.field(lintState).diagnostics, x2);
1516
+ b3 && x2.actions[C].apply(e6, b3.from, b3.to);
1517
+ }
1518
+ } else return;
1519
+ b2.preventDefault();
1520
+ }
1521
+ }, x = (e7) => {
1522
+ for (let b2 = 0; b2 < this.items.length; b2++) this.items[b2].dom.contains(e7.target) && this.moveSelection(b2);
1522
1523
  };
1523
1524
  this.list = crelt("ul", {
1524
1525
  tabIndex: 0,
1525
1526
  role: "listbox",
1526
1527
  "aria-label": this.view.state.phrase("Diagnostics"),
1527
- onkeydown: y,
1528
- onclick: b
1528
+ onkeydown: b,
1529
+ onclick: x
1529
1530
  }), this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
1530
1531
  type: "button",
1531
1532
  name: "close",
@@ -1536,75 +1537,75 @@ var DiagnosticWidget = class extends WidgetType {
1536
1537
  get selectedIndex() {
1537
1538
  let e6 = this.view.state.field(lintState).selected;
1538
1539
  if (!e6) return -1;
1539
- for (let y = 0; y < this.items.length; y++) if (this.items[y].diagnostic == e6.diagnostic) return y;
1540
+ for (let b = 0; b < this.items.length; b++) if (this.items[b].diagnostic == e6.diagnostic) return b;
1540
1541
  return -1;
1541
1542
  }
1542
1543
  update() {
1543
- let { diagnostics: e6, selected: y } = this.view.state.field(lintState), b = 0, x = false, S = null, C = /* @__PURE__ */ new Set();
1544
- for (e6.between(0, this.view.state.doc.length, (e7, w, { spec: T }) => {
1545
- for (let e8 of T.diagnostics) {
1546
- if (C.has(e8)) continue;
1547
- C.add(e8);
1548
- let w2 = -1, T2;
1549
- for (let y2 = b; y2 < this.items.length; y2++) if (this.items[y2].diagnostic == e8) {
1550
- w2 = y2;
1544
+ let { diagnostics: e6, selected: b } = this.view.state.field(lintState), x = 0, S = false, C = null, w = /* @__PURE__ */ new Set();
1545
+ for (e6.between(0, this.view.state.doc.length, (e7, T, { spec: E }) => {
1546
+ for (let e8 of E.diagnostics) {
1547
+ if (w.has(e8)) continue;
1548
+ w.add(e8);
1549
+ let T2 = -1, E2;
1550
+ for (let b2 = x; b2 < this.items.length; b2++) if (this.items[b2].diagnostic == e8) {
1551
+ T2 = b2;
1551
1552
  break;
1552
1553
  }
1553
- w2 < 0 ? (T2 = new PanelItem(this.view, e8), this.items.splice(b, 0, T2), x = true) : (T2 = this.items[w2], w2 > b && (this.items.splice(b, w2 - b), x = true)), y && T2.diagnostic == y.diagnostic ? T2.dom.hasAttribute("aria-selected") || (T2.dom.setAttribute("aria-selected", "true"), S = T2) : T2.dom.hasAttribute("aria-selected") && T2.dom.removeAttribute("aria-selected"), b++;
1554
+ T2 < 0 ? (E2 = new PanelItem(this.view, e8), this.items.splice(x, 0, E2), S = true) : (E2 = this.items[T2], T2 > x && (this.items.splice(x, T2 - x), S = true)), b && E2.diagnostic == b.diagnostic ? E2.dom.hasAttribute("aria-selected") || (E2.dom.setAttribute("aria-selected", "true"), C = E2) : E2.dom.hasAttribute("aria-selected") && E2.dom.removeAttribute("aria-selected"), x++;
1554
1555
  }
1555
- }); b < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) x = true, this.items.pop();
1556
+ }); x < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) S = true, this.items.pop();
1556
1557
  this.items.length == 0 && (this.items.push(new PanelItem(this.view, {
1557
1558
  from: -1,
1558
1559
  to: -1,
1559
1560
  severity: "info",
1560
1561
  message: this.view.state.phrase("No diagnostics")
1561
- })), x = true), S ? (this.list.setAttribute("aria-activedescendant", S.id), this.view.requestMeasure({
1562
+ })), S = true), C ? (this.list.setAttribute("aria-activedescendant", C.id), this.view.requestMeasure({
1562
1563
  key: this,
1563
1564
  read: () => ({
1564
- sel: S.dom.getBoundingClientRect(),
1565
+ sel: C.dom.getBoundingClientRect(),
1565
1566
  panel: this.list.getBoundingClientRect()
1566
1567
  }),
1567
- write: ({ sel: e7, panel: y2 }) => {
1568
- let b2 = y2.height / this.list.offsetHeight;
1569
- e7.top < y2.top ? this.list.scrollTop -= (y2.top - e7.top) / b2 : e7.bottom > y2.bottom && (this.list.scrollTop += (e7.bottom - y2.bottom) / b2);
1568
+ write: ({ sel: e7, panel: b2 }) => {
1569
+ let x2 = b2.height / this.list.offsetHeight;
1570
+ e7.top < b2.top ? this.list.scrollTop -= (b2.top - e7.top) / x2 : e7.bottom > b2.bottom && (this.list.scrollTop += (e7.bottom - b2.bottom) / x2);
1570
1571
  }
1571
- })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), x && this.sync();
1572
+ })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), S && this.sync();
1572
1573
  }
1573
1574
  sync() {
1574
1575
  let e6 = this.list.firstChild;
1575
- function y() {
1576
- let y2 = e6;
1577
- e6 = y2.nextSibling, y2.remove();
1576
+ function b() {
1577
+ let b2 = e6;
1578
+ e6 = b2.nextSibling, b2.remove();
1578
1579
  }
1579
- for (let b of this.items) if (b.dom.parentNode == this.list) {
1580
- for (; e6 != b.dom; ) y();
1581
- e6 = b.dom.nextSibling;
1582
- } else this.list.insertBefore(b.dom, e6);
1583
- for (; e6; ) y();
1580
+ for (let x of this.items) if (x.dom.parentNode == this.list) {
1581
+ for (; e6 != x.dom; ) b();
1582
+ e6 = x.dom.nextSibling;
1583
+ } else this.list.insertBefore(x.dom, e6);
1584
+ for (; e6; ) b();
1584
1585
  }
1585
1586
  moveSelection(e6) {
1586
1587
  if (this.selectedIndex < 0) return;
1587
- let y = findDiagnostic(this.view.state.field(lintState).diagnostics, this.items[e6].diagnostic);
1588
- y && this.view.dispatch({
1588
+ let b = findDiagnostic(this.view.state.field(lintState).diagnostics, this.items[e6].diagnostic);
1589
+ b && this.view.dispatch({
1589
1590
  selection: {
1590
- anchor: y.from,
1591
- head: y.to
1591
+ anchor: b.from,
1592
+ head: b.to
1592
1593
  },
1593
1594
  scrollIntoView: true,
1594
- effects: movePanelSelection.of(y)
1595
+ effects: movePanelSelection.of(b)
1595
1596
  });
1596
1597
  }
1597
- static open(y) {
1598
- return new e4(y);
1598
+ static open(b) {
1599
+ return new e4(b);
1599
1600
  }
1600
1601
  };
1601
- function svg(e6, y = 'viewBox="0 0 40 40"') {
1602
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${y}>${encodeURIComponent(e6)}</svg>')`;
1602
+ function svg(e6, b = 'viewBox="0 0 40 40"') {
1603
+ return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${b}>${encodeURIComponent(e6)}</svg>')`;
1603
1604
  }
1604
1605
  function underline(e6) {
1605
1606
  return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e6}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
1606
1607
  }
1607
- var baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
1608
+ var baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({
1608
1609
  ".cm-diagnostic": {
1609
1610
  padding: "3px 6px 3px 8px",
1610
1611
  marginLeft: "-1px",
@@ -1693,40 +1694,40 @@ function severityWeight(e6) {
1693
1694
  return e6 == "error" ? 4 : e6 == "warning" ? 3 : e6 == "info" ? 2 : 1;
1694
1695
  }
1695
1696
  function maxSeverity(e6) {
1696
- let y = "hint", b = 1;
1697
- for (let x of e6) {
1698
- let e7 = severityWeight(x.severity);
1699
- e7 > b && (b = e7, y = x.severity);
1697
+ let b = "hint", x = 1;
1698
+ for (let S of e6) {
1699
+ let e7 = severityWeight(S.severity);
1700
+ e7 > x && (x = e7, b = S.severity);
1700
1701
  }
1701
- return y;
1702
+ return b;
1702
1703
  }
1703
1704
  var lintExtensions = [
1704
1705
  lintState,
1705
1706
  /* @__PURE__ */ EditorView.decorations.compute([lintState], (e6) => {
1706
- let { selected: y, panel: b } = e6.field(lintState);
1707
- return !y || !b || y.from == y.to ? Decoration.none : Decoration.set([activeMark.range(y.from, y.to)]);
1707
+ let { selected: b, panel: x } = e6.field(lintState);
1708
+ return !b || !x || b.from == b.to ? Decoration.none : Decoration.set([activeMark.range(b.from, b.to)]);
1708
1709
  }),
1709
1710
  /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
1710
- baseTheme$2
1711
+ baseTheme$1
1711
1712
  ];
1712
- function forEachDiagnostic(e6, y) {
1713
- let b = e6.field(lintState, false);
1714
- if (b && b.diagnostics.size) {
1715
- let e7 = [], x = [], S = -1;
1716
- for (let C = RangeSet.iter([b.diagnostics]); ; C.next()) {
1717
- for (let b2 = 0; b2 < e7.length; b2++) (!C.value || C.value.spec.diagnostics.indexOf(e7[b2]) < 0) && (y(e7[b2], x[b2], S), e7.splice(b2, 1), x.splice(b2--, 1));
1718
- if (!C.value) break;
1719
- for (let y2 of C.value.spec.diagnostics) e7.indexOf(y2) < 0 && (e7.push(y2), x.push(C.from));
1720
- S = C.to;
1713
+ function forEachDiagnostic(e6, b) {
1714
+ let x = e6.field(lintState, false);
1715
+ if (x && x.diagnostics.size) {
1716
+ let e7 = [], S = [], C = -1;
1717
+ for (let w = RangeSet.iter([x.diagnostics]); ; w.next()) {
1718
+ for (let x2 = 0; x2 < e7.length; x2++) (!w.value || w.value.spec.diagnostics.indexOf(e7[x2]) < 0) && (b(e7[x2], S[x2], C), e7.splice(x2, 1), S.splice(x2--, 1));
1719
+ if (!w.value) break;
1720
+ for (let b2 of w.value.spec.diagnostics) e7.indexOf(b2) < 0 && (e7.push(b2), S.push(w.from));
1721
+ C = w.to;
1721
1722
  }
1722
1723
  }
1723
1724
  }
1724
1725
  var basicNormalize = typeof String.prototype.normalize == "function" ? (e6) => e6.normalize("NFKD") : (e6) => e6, SearchCursor = class {
1725
- constructor(e6, y, b = 0, x = e6.length, S, C) {
1726
- this.test = C, this.value = {
1726
+ constructor(e6, b, x = 0, S = e6.length, C, w) {
1727
+ this.test = w, this.value = {
1727
1728
  from: 0,
1728
1729
  to: 0
1729
- }, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e6.iterRange(b, x), this.bufferStart = b, this.normalize = S ? (e7) => S(basicNormalize(e7)) : basicNormalize, this.query = this.normalize(y);
1730
+ }, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e6.iterRange(x, S), this.bufferStart = x, this.normalize = C ? (e7) => C(basicNormalize(e7)) : basicNormalize, this.query = this.normalize(b);
1730
1731
  }
1731
1732
  peek() {
1732
1733
  if (this.bufferPos == this.buffer.length) {
@@ -1743,32 +1744,32 @@ var basicNormalize = typeof String.prototype.normalize == "function" ? (e6) => e
1743
1744
  for (; ; ) {
1744
1745
  let e6 = this.peek();
1745
1746
  if (e6 < 0) return this.done = true, this;
1746
- let y = fromCodePoint(e6), b = this.bufferStart + this.bufferPos;
1747
+ let b = fromCodePoint(e6), x = this.bufferStart + this.bufferPos;
1747
1748
  this.bufferPos += codePointSize(e6);
1748
- let x = this.normalize(y);
1749
- if (x.length) for (let e7 = 0, S = b; ; e7++) {
1750
- let C = x.charCodeAt(e7), w = this.match(C, S, this.bufferPos + this.bufferStart);
1751
- if (e7 == x.length - 1) {
1752
- if (w) return this.value = w, this;
1749
+ let S = this.normalize(b);
1750
+ if (S.length) for (let e7 = 0, C = x; ; e7++) {
1751
+ let w = S.charCodeAt(e7), T = this.match(w, C, this.bufferPos + this.bufferStart);
1752
+ if (e7 == S.length - 1) {
1753
+ if (T) return this.value = T, this;
1753
1754
  break;
1754
1755
  }
1755
- S == b && e7 < y.length && y.charCodeAt(e7) == C && S++;
1756
+ C == x && e7 < b.length && b.charCodeAt(e7) == w && C++;
1756
1757
  }
1757
1758
  }
1758
1759
  }
1759
- match(e6, y, b) {
1760
- let x = null;
1761
- for (let y2 = 0; y2 < this.matches.length; y2 += 2) {
1762
- let S = this.matches[y2], C = false;
1763
- this.query.charCodeAt(S) == e6 && (S == this.query.length - 1 ? x = {
1764
- from: this.matches[y2 + 1],
1765
- to: b
1766
- } : (this.matches[y2]++, C = true)), C || (this.matches.splice(y2, 2), y2 -= 2);
1760
+ match(e6, b, x) {
1761
+ let S = null;
1762
+ for (let b2 = 0; b2 < this.matches.length; b2 += 2) {
1763
+ let C = this.matches[b2], w = false;
1764
+ this.query.charCodeAt(C) == e6 && (C == this.query.length - 1 ? S = {
1765
+ from: this.matches[b2 + 1],
1766
+ to: x
1767
+ } : (this.matches[b2]++, w = true)), w || (this.matches.splice(b2, 2), b2 -= 2);
1767
1768
  }
1768
- return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ? x = {
1769
- from: y,
1770
- to: b
1771
- } : this.matches.push(1, y)), x && this.test && !this.test(x.from, x.to, this.buffer, this.bufferStart) && (x = null), x;
1769
+ return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ? S = {
1770
+ from: b,
1771
+ to: x
1772
+ } : this.matches.push(1, b)), S && this.test && !this.test(S.from, S.to, this.buffer, this.bufferStart) && (S = null), S;
1772
1773
  }
1773
1774
  };
1774
1775
  typeof Symbol < "u" && (SearchCursor.prototype[Symbol.iterator] = function() {
@@ -1779,9 +1780,9 @@ var empty = {
1779
1780
  to: -1,
1780
1781
  match: /* @__PURE__ */ /.*/.exec("")
1781
1782
  }, baseFlags = "gm" + (/x/.unicode == null ? "" : "u"), RegExpCursor = class {
1782
- constructor(e6, y, b, x = 0, S = e6.length) {
1783
- if (this.text = e6, this.to = S, this.curLine = "", this.done = false, this.value = empty, /\\[sWDnr]|\n|\r|\[\^/.test(y)) return new MultilineRegExpCursor(e6, y, b, x, S);
1784
- this.re = new RegExp(y, baseFlags + ((b == null ? void 0 : b.ignoreCase) ? "i" : "")), this.test = b == null ? void 0 : b.test, this.iter = e6.iter(), this.curLineStart = e6.lineAt(x).from, this.matchPos = toCharEnd(e6, x), this.getLine(this.curLineStart);
1783
+ constructor(e6, b, x, S = 0, C = e6.length) {
1784
+ if (this.text = e6, this.to = C, this.curLine = "", this.done = false, this.value = empty, /\\[sWDnr]|\n|\r|\[\^/.test(b)) return new MultilineRegExpCursor(e6, b, x, S, C);
1785
+ this.re = new RegExp(b, baseFlags + ((x == null ? void 0 : x.ignoreCase) ? "i" : "")), this.test = x == null ? void 0 : x.test, this.iter = e6.iter(), this.curLineStart = e6.lineAt(S).from, this.matchPos = toCharEnd(e6, S), this.getLine(this.curLineStart);
1785
1786
  }
1786
1787
  getLine(e6) {
1787
1788
  this.iter.next(e6), 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());
@@ -1792,13 +1793,13 @@ var empty = {
1792
1793
  next() {
1793
1794
  for (let e6 = this.matchPos - this.curLineStart; ; ) {
1794
1795
  this.re.lastIndex = e6;
1795
- let y = this.matchPos <= this.to && this.re.exec(this.curLine);
1796
- if (y) {
1797
- let b = this.curLineStart + y.index, x = b + y[0].length;
1798
- if (this.matchPos = toCharEnd(this.text, x + (b == x ? 1 : 0)), b == this.curLineStart + this.curLine.length && this.nextLine(), (b < x || b > this.value.to) && (!this.test || this.test(b, x, y))) return this.value = {
1799
- from: b,
1800
- to: x,
1801
- match: y
1796
+ let b = this.matchPos <= this.to && this.re.exec(this.curLine);
1797
+ if (b) {
1798
+ let x = this.curLineStart + b.index, S = x + b[0].length;
1799
+ if (this.matchPos = toCharEnd(this.text, S + (x == S ? 1 : 0)), x == this.curLineStart + this.curLine.length && this.nextLine(), (x < S || x > this.value.to) && (!this.test || this.test(x, S, b))) return this.value = {
1800
+ from: x,
1801
+ to: S,
1802
+ match: b
1802
1803
  }, this;
1803
1804
  e6 = this.matchPos - this.curLineStart;
1804
1805
  } else if (this.curLineStart + this.curLine.length < this.to) this.nextLine(), e6 = 0;
@@ -1806,39 +1807,39 @@ var empty = {
1806
1807
  }
1807
1808
  }
1808
1809
  }, flattened = /* @__PURE__ */ new WeakMap(), FlattenedDoc = class e5 {
1809
- constructor(e6, y) {
1810
- this.from = e6, this.text = y;
1810
+ constructor(e6, b) {
1811
+ this.from = e6, this.text = b;
1811
1812
  }
1812
1813
  get to() {
1813
1814
  return this.from + this.text.length;
1814
1815
  }
1815
- static get(y, b, x) {
1816
- let S = flattened.get(y);
1817
- if (!S || S.from >= x || S.to <= b) {
1818
- let S2 = new e5(b, y.sliceString(b, x));
1819
- return flattened.set(y, S2), S2;
1816
+ static get(b, x, S) {
1817
+ let C = flattened.get(b);
1818
+ if (!C || C.from >= S || C.to <= x) {
1819
+ let C2 = new e5(x, b.sliceString(x, S));
1820
+ return flattened.set(b, C2), C2;
1820
1821
  }
1821
- if (S.from == b && S.to == x) return S;
1822
- let { text: C, from: w } = S;
1823
- return w > b && (C = y.sliceString(b, w) + C, w = b), S.to < x && (C += y.sliceString(S.to, x)), flattened.set(y, new e5(w, C)), new e5(b, C.slice(b - w, x - w));
1822
+ if (C.from == x && C.to == S) return C;
1823
+ let { text: w, from: T } = C;
1824
+ return T > x && (w = b.sliceString(x, T) + w, T = x), C.to < S && (w += b.sliceString(C.to, S)), flattened.set(b, new e5(T, w)), new e5(x, w.slice(x - T, S - T));
1824
1825
  }
1825
1826
  }, MultilineRegExpCursor = class {
1826
- constructor(e6, y, b, x, S) {
1827
- this.text = e6, this.to = S, this.done = false, this.value = empty, this.matchPos = toCharEnd(e6, x), this.re = new RegExp(y, baseFlags + ((b == null ? void 0 : b.ignoreCase) ? "i" : "")), this.test = b == null ? void 0 : b.test, this.flat = FlattenedDoc.get(e6, x, this.chunkEnd(x + 5e3));
1827
+ constructor(e6, b, x, S, C) {
1828
+ this.text = e6, this.to = C, this.done = false, this.value = empty, this.matchPos = toCharEnd(e6, S), this.re = new RegExp(b, baseFlags + ((x == null ? void 0 : x.ignoreCase) ? "i" : "")), this.test = x == null ? void 0 : x.test, this.flat = FlattenedDoc.get(e6, S, this.chunkEnd(S + 5e3));
1828
1829
  }
1829
1830
  chunkEnd(e6) {
1830
1831
  return e6 >= this.to ? this.to : this.text.lineAt(e6).to;
1831
1832
  }
1832
1833
  next() {
1833
1834
  for (; ; ) {
1834
- let e6 = this.re.lastIndex = this.matchPos - this.flat.from, y = this.re.exec(this.flat.text);
1835
- if (y && !y[0] && y.index == e6 && (this.re.lastIndex = e6 + 1, y = this.re.exec(this.flat.text)), y) {
1836
- let e7 = this.flat.from + y.index, b = e7 + y[0].length;
1837
- if ((this.flat.to >= this.to || y.index + y[0].length <= this.flat.text.length - 10) && (!this.test || this.test(e7, b, y))) return this.value = {
1835
+ let e6 = this.re.lastIndex = this.matchPos - this.flat.from, b = this.re.exec(this.flat.text);
1836
+ if (b && !b[0] && b.index == e6 && (this.re.lastIndex = e6 + 1, b = this.re.exec(this.flat.text)), b) {
1837
+ let e7 = this.flat.from + b.index, x = e7 + b[0].length;
1838
+ if ((this.flat.to >= this.to || b.index + b[0].length <= this.flat.text.length - 10) && (!this.test || this.test(e7, x, b))) return this.value = {
1838
1839
  from: e7,
1839
- to: b,
1840
- match: y
1841
- }, this.matchPos = toCharEnd(this.text, b + (e7 == b ? 1 : 0)), this;
1840
+ to: x,
1841
+ match: b
1842
+ }, this.matchPos = toCharEnd(this.text, x + (e7 == x ? 1 : 0)), this;
1842
1843
  }
1843
1844
  if (this.flat.to == this.to) return this.done = true, this;
1844
1845
  this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
@@ -1855,104 +1856,62 @@ function validRegExp(e6) {
1855
1856
  return false;
1856
1857
  }
1857
1858
  }
1858
- function toCharEnd(e6, y) {
1859
- if (y >= e6.length) return y;
1860
- let b = e6.lineAt(y), x;
1861
- for (; y < b.to && (x = b.text.charCodeAt(y - b.from)) >= 56320 && x < 57344; ) y++;
1862
- return y;
1859
+ function toCharEnd(e6, b) {
1860
+ if (b >= e6.length) return b;
1861
+ let x = e6.lineAt(b), S;
1862
+ for (; b < x.to && (S = x.text.charCodeAt(b - x.from)) >= 56320 && S < 57344; ) b++;
1863
+ return b;
1863
1864
  }
1864
- function createLineDialog(e6) {
1865
- let y = crelt("input", {
1866
- class: "cm-textfield",
1867
- name: "line",
1868
- value: String(e6.state.doc.lineAt(e6.state.selection.main.head).number)
1869
- }), b = crelt("form", {
1870
- class: "cm-gotoLine",
1871
- onkeydown: (y2) => {
1872
- y2.keyCode == 27 ? (y2.preventDefault(), e6.dispatch({ effects: dialogEffect.of(false) }), e6.focus()) : y2.keyCode == 13 && (y2.preventDefault(), x());
1865
+ var gotoLine = (e6) => {
1866
+ let { state: b } = e6, x = String(b.doc.lineAt(e6.state.selection.main.head).number), { close: S, result: C } = showDialog(e6, {
1867
+ label: b.phrase("Go to line"),
1868
+ input: {
1869
+ type: "text",
1870
+ name: "line",
1871
+ value: x
1873
1872
  },
1874
- onsubmit: (e7) => {
1875
- e7.preventDefault(), x();
1873
+ focus: true,
1874
+ submitLabel: b.phrase("go")
1875
+ });
1876
+ return C.then((x2) => {
1877
+ let C2 = x2 && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(x2.elements.line.value);
1878
+ if (!C2) {
1879
+ e6.dispatch({ effects: S });
1880
+ return;
1876
1881
  }
1877
- }, crelt("label", e6.state.phrase("Go to line"), ": ", y), " ", crelt("button", {
1878
- class: "cm-button",
1879
- type: "submit"
1880
- }, e6.state.phrase("go")), crelt("button", {
1881
- name: "close",
1882
- onclick: () => {
1883
- e6.dispatch({ effects: dialogEffect.of(false) }), e6.focus();
1884
- },
1885
- "aria-label": e6.state.phrase("close"),
1886
- type: "button"
1887
- }, ["\xD7"]));
1888
- function x() {
1889
- let b2 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(y.value);
1890
- if (!b2) return;
1891
- let { state: x2 } = e6, S = x2.doc.lineAt(x2.selection.main.head), [, C, w, T, E] = b2, D = T ? +T.slice(1) : 0, O = w ? +w : S.number;
1892
- if (w && E) {
1893
- let e7 = O / 100;
1894
- C && (e7 = e7 * (C == "-" ? -1 : 1) + S.number / x2.doc.lines), O = Math.round(x2.doc.lines * e7);
1895
- } else w && C && (O = O * (C == "-" ? -1 : 1) + S.number);
1896
- let k = x2.doc.line(Math.max(1, Math.min(x2.doc.lines, O))), A = EditorSelection.cursor(k.from + Math.max(0, Math.min(D, k.length)));
1882
+ let w = b.doc.lineAt(b.selection.main.head), [, T, E, D, O] = C2, k = D ? +D.slice(1) : 0, A = E ? +E : w.number;
1883
+ if (E && O) {
1884
+ let e7 = A / 100;
1885
+ T && (e7 = e7 * (T == "-" ? -1 : 1) + w.number / b.doc.lines), A = Math.round(b.doc.lines * e7);
1886
+ } else E && T && (A = A * (T == "-" ? -1 : 1) + w.number);
1887
+ let j = b.doc.line(Math.max(1, Math.min(b.doc.lines, A))), M = EditorSelection.cursor(j.from + Math.max(0, Math.min(k, j.length)));
1897
1888
  e6.dispatch({
1898
- effects: [dialogEffect.of(false), EditorView.scrollIntoView(A.from, { y: "center" })],
1899
- selection: A
1900
- }), e6.focus();
1901
- }
1902
- return { dom: b };
1903
- }
1904
- var dialogEffect = /* @__PURE__ */ StateEffect.define(), dialogField = /* @__PURE__ */ StateField.define({
1905
- create() {
1906
- return true;
1907
- },
1908
- update(e6, y) {
1909
- for (let b of y.effects) b.is(dialogEffect) && (e6 = b.value);
1910
- return e6;
1911
- },
1912
- provide: (e6) => showPanel.from(e6, (e7) => e7 ? createLineDialog : null)
1913
- }), gotoLine = (e6) => {
1914
- let y = getPanel(e6, createLineDialog);
1915
- if (!y) {
1916
- let b = [dialogEffect.of(true)];
1917
- e6.state.field(dialogField, false) ?? b.push(StateEffect.appendConfig.of([dialogField, baseTheme$1])), e6.dispatch({ effects: b }), y = getPanel(e6, createLineDialog);
1918
- }
1919
- return y && y.dom.querySelector("input").select(), true;
1920
- }, baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({ ".cm-panel.cm-gotoLine": {
1921
- padding: "2px 6px 4px",
1922
- position: "relative",
1923
- "& label": { fontSize: "80%" },
1924
- "& [name=close]": {
1925
- position: "absolute",
1926
- top: "0",
1927
- bottom: "0",
1928
- right: "4px",
1929
- backgroundColor: "inherit",
1930
- border: "none",
1931
- font: "inherit",
1932
- padding: "0"
1933
- }
1934
- } }), defaultHighlightOptions = {
1889
+ effects: [S, EditorView.scrollIntoView(M.from, { y: "center" })],
1890
+ selection: M
1891
+ });
1892
+ }), true;
1893
+ }, defaultHighlightOptions = {
1935
1894
  highlightWordAroundCursor: false,
1936
1895
  minSelectionLength: 1,
1937
1896
  maxMatches: 100,
1938
1897
  wholeWords: false
1939
1898
  }, highlightConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
1940
1899
  return combineConfig(e6, defaultHighlightOptions, {
1941
- highlightWordAroundCursor: (e7, y) => e7 || y,
1900
+ highlightWordAroundCursor: (e7, b) => e7 || b,
1942
1901
  minSelectionLength: Math.min,
1943
1902
  maxMatches: Math.min
1944
1903
  });
1945
1904
  } });
1946
1905
  function highlightSelectionMatches(e6) {
1947
- let y = [defaultTheme, matchHighlighter];
1948
- return e6 && y.push(highlightConfig.of(e6)), y;
1906
+ let b = [defaultTheme, matchHighlighter];
1907
+ return e6 && b.push(highlightConfig.of(e6)), b;
1949
1908
  }
1950
1909
  var matchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch" }), mainMatchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
1951
- function insideWordBoundaries(e6, y, b, x) {
1952
- return (b == 0 || e6(y.sliceDoc(b - 1, b)) != CharCategory.Word) && (x == y.doc.length || e6(y.sliceDoc(x, x + 1)) != CharCategory.Word);
1910
+ function insideWordBoundaries(e6, b, x, S) {
1911
+ return (x == 0 || e6(b.sliceDoc(x - 1, x)) != CharCategory.Word) && (S == b.doc.length || e6(b.sliceDoc(S, S + 1)) != CharCategory.Word);
1953
1912
  }
1954
- function insideWord(e6, y, b, x) {
1955
- return e6(y.sliceDoc(b, b + 1)) == CharCategory.Word && e6(y.sliceDoc(x - 1, x)) == CharCategory.Word;
1913
+ function insideWord(e6, b, x, S) {
1914
+ return e6(b.sliceDoc(x, x + 1)) == CharCategory.Word && e6(b.sliceDoc(S - 1, S)) == CharCategory.Word;
1956
1915
  }
1957
1916
  var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
1958
1917
  constructor(e6) {
@@ -1962,64 +1921,64 @@ var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
1962
1921
  (e6.selectionSet || e6.docChanged || e6.viewportChanged) && (this.decorations = this.getDeco(e6.view));
1963
1922
  }
1964
1923
  getDeco(e6) {
1965
- let y = e6.state.facet(highlightConfig), { state: b } = e6, x = b.selection;
1966
- if (x.ranges.length > 1) return Decoration.none;
1967
- let S = x.main, C, w = null;
1968
- if (S.empty) {
1969
- if (!y.highlightWordAroundCursor) return Decoration.none;
1970
- let e7 = b.wordAt(S.head);
1924
+ let b = e6.state.facet(highlightConfig), { state: x } = e6, S = x.selection;
1925
+ if (S.ranges.length > 1) return Decoration.none;
1926
+ let C = S.main, w, T = null;
1927
+ if (C.empty) {
1928
+ if (!b.highlightWordAroundCursor) return Decoration.none;
1929
+ let e7 = x.wordAt(C.head);
1971
1930
  if (!e7) return Decoration.none;
1972
- w = b.charCategorizer(S.head), C = b.sliceDoc(e7.from, e7.to);
1931
+ T = x.charCategorizer(C.head), w = x.sliceDoc(e7.from, e7.to);
1973
1932
  } else {
1974
- let e7 = S.to - S.from;
1975
- if (e7 < y.minSelectionLength || e7 > 200) return Decoration.none;
1976
- if (y.wholeWords) {
1977
- if (C = b.sliceDoc(S.from, S.to), w = b.charCategorizer(S.head), !(insideWordBoundaries(w, b, S.from, S.to) && insideWord(w, b, S.from, S.to))) return Decoration.none;
1978
- } else if (C = b.sliceDoc(S.from, S.to), !C) return Decoration.none;
1933
+ let e7 = C.to - C.from;
1934
+ if (e7 < b.minSelectionLength || e7 > 200) return Decoration.none;
1935
+ if (b.wholeWords) {
1936
+ if (w = x.sliceDoc(C.from, C.to), T = x.charCategorizer(C.head), !(insideWordBoundaries(T, x, C.from, C.to) && insideWord(T, x, C.from, C.to))) return Decoration.none;
1937
+ } else if (w = x.sliceDoc(C.from, C.to), !w) return Decoration.none;
1979
1938
  }
1980
- let T = [];
1981
- for (let x2 of e6.visibleRanges) {
1982
- let e7 = new SearchCursor(b.doc, C, x2.from, x2.to);
1939
+ let E = [];
1940
+ for (let S2 of e6.visibleRanges) {
1941
+ let e7 = new SearchCursor(x.doc, w, S2.from, S2.to);
1983
1942
  for (; !e7.next().done; ) {
1984
- let { from: x3, to: C2 } = e7.value;
1985
- if ((!w || insideWordBoundaries(w, b, x3, C2)) && (S.empty && x3 <= S.from && C2 >= S.to ? T.push(mainMatchDeco.range(x3, C2)) : (x3 >= S.to || C2 <= S.from) && T.push(matchDeco.range(x3, C2)), T.length > y.maxMatches)) return Decoration.none;
1943
+ let { from: S3, to: w2 } = e7.value;
1944
+ if ((!T || insideWordBoundaries(T, x, S3, w2)) && (C.empty && S3 <= C.from && w2 >= C.to ? E.push(mainMatchDeco.range(S3, w2)) : (S3 >= C.to || w2 <= C.from) && E.push(matchDeco.range(S3, w2)), E.length > b.maxMatches)) return Decoration.none;
1986
1945
  }
1987
1946
  }
1988
- return Decoration.set(T);
1947
+ return Decoration.set(E);
1989
1948
  }
1990
1949
  }, { decorations: (e6) => e6.decorations }), defaultTheme = /* @__PURE__ */ EditorView.baseTheme({
1991
1950
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
1992
1951
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
1993
- }), selectWord = ({ state: e6, dispatch: y }) => {
1994
- let { selection: b } = e6, x = EditorSelection.create(b.ranges.map((y2) => e6.wordAt(y2.head) || EditorSelection.cursor(y2.head)), b.mainIndex);
1995
- return x.eq(b) ? false : (y(e6.update({ selection: x })), true);
1952
+ }), selectWord = ({ state: e6, dispatch: b }) => {
1953
+ let { selection: x } = e6, S = EditorSelection.create(x.ranges.map((b2) => e6.wordAt(b2.head) || EditorSelection.cursor(b2.head)), x.mainIndex);
1954
+ return S.eq(x) ? false : (b(e6.update({ selection: S })), true);
1996
1955
  };
1997
- function findNextOccurrence(e6, y) {
1998
- let { main: b, ranges: x } = e6.selection, S = e6.wordAt(b.head), C = S && S.from == b.from && S.to == b.to;
1999
- for (let b2 = false, S2 = new SearchCursor(e6.doc, y, x[x.length - 1].to); ; ) if (S2.next(), S2.done) {
2000
- if (b2) return null;
2001
- S2 = new SearchCursor(e6.doc, y, 0, Math.max(0, x[x.length - 1].from - 1)), b2 = true;
1956
+ function findNextOccurrence(e6, b) {
1957
+ let { main: x, ranges: S } = e6.selection, C = e6.wordAt(x.head), w = C && C.from == x.from && C.to == x.to;
1958
+ for (let x2 = false, C2 = new SearchCursor(e6.doc, b, S[S.length - 1].to); ; ) if (C2.next(), C2.done) {
1959
+ if (x2) return null;
1960
+ C2 = new SearchCursor(e6.doc, b, 0, Math.max(0, S[S.length - 1].from - 1)), x2 = true;
2002
1961
  } else {
2003
- if (b2 && x.some((e7) => e7.from == S2.value.from)) continue;
2004
- if (C) {
2005
- let y2 = e6.wordAt(S2.value.from);
2006
- if (!y2 || y2.from != S2.value.from || y2.to != S2.value.to) continue;
1962
+ if (x2 && S.some((e7) => e7.from == C2.value.from)) continue;
1963
+ if (w) {
1964
+ let b2 = e6.wordAt(C2.value.from);
1965
+ if (!b2 || b2.from != C2.value.from || b2.to != C2.value.to) continue;
2007
1966
  }
2008
- return S2.value;
1967
+ return C2.value;
2009
1968
  }
2010
1969
  }
2011
- var selectNextOccurrence = ({ state: e6, dispatch: y }) => {
2012
- let { ranges: b } = e6.selection;
2013
- if (b.some((e7) => e7.from === e7.to)) return selectWord({
1970
+ var selectNextOccurrence = ({ state: e6, dispatch: b }) => {
1971
+ let { ranges: x } = e6.selection;
1972
+ if (x.some((e7) => e7.from === e7.to)) return selectWord({
2014
1973
  state: e6,
2015
- dispatch: y
1974
+ dispatch: b
2016
1975
  });
2017
- let x = e6.sliceDoc(b[0].from, b[0].to);
2018
- if (e6.selection.ranges.some((y2) => e6.sliceDoc(y2.from, y2.to) != x)) return false;
2019
- let S = findNextOccurrence(e6, x);
2020
- return S ? (y(e6.update({
2021
- selection: e6.selection.addRange(EditorSelection.range(S.from, S.to), false),
2022
- effects: EditorView.scrollIntoView(S.to)
1976
+ let S = e6.sliceDoc(x[0].from, x[0].to);
1977
+ if (e6.selection.ranges.some((b2) => e6.sliceDoc(b2.from, b2.to) != S)) return false;
1978
+ let C = findNextOccurrence(e6, S);
1979
+ return C ? (b(e6.update({
1980
+ selection: e6.selection.addRange(EditorSelection.range(C.from, C.to), false),
1981
+ effects: EditorView.scrollIntoView(C.to)
2023
1982
  })), true) : false;
2024
1983
  }, searchConfigFacet = /* @__PURE__ */ Facet.define({ combine(e6) {
2025
1984
  return combineConfig(e6, {
@@ -2033,179 +1992,178 @@ var selectNextOccurrence = ({ state: e6, dispatch: y }) => {
2033
1992
  });
2034
1993
  } }), SearchQuery = class {
2035
1994
  constructor(e6) {
2036
- this.search = e6.search, this.caseSensitive = !!e6.caseSensitive, this.literal = !!e6.literal, this.regexp = !!e6.regexp, this.replace = e6.replace || "", this.valid = !!this.search && (!this.regexp || validRegExp(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e6.wholeWord;
1995
+ this.search = e6.search, this.caseSensitive = !!e6.caseSensitive, this.literal = !!e6.literal, this.regexp = !!e6.regexp, this.replace = e6.replace || "", this.valid = !!this.search && (!this.regexp || validRegExp(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e6.wholeWord, this.test = e6.test;
2037
1996
  }
2038
1997
  unquote(e6) {
2039
- return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7, y) => y == "n" ? "\n" : y == "r" ? "\r" : y == "t" ? " " : "\\");
1998
+ return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7, b) => b == "n" ? "\n" : b == "r" ? "\r" : b == "t" ? " " : "\\");
2040
1999
  }
2041
2000
  eq(e6) {
2042
- return this.search == e6.search && this.replace == e6.replace && this.caseSensitive == e6.caseSensitive && this.regexp == e6.regexp && this.wholeWord == e6.wholeWord;
2001
+ return this.search == e6.search && this.replace == e6.replace && this.caseSensitive == e6.caseSensitive && this.regexp == e6.regexp && this.wholeWord == e6.wholeWord && this.test == e6.test;
2043
2002
  }
2044
2003
  create() {
2045
2004
  return this.regexp ? new RegExpQuery(this) : new StringQuery(this);
2046
2005
  }
2047
- getCursor(e6, y = 0, b) {
2048
- let x = e6.doc ? e6 : EditorState.create({ doc: e6 });
2049
- return b ?? (b = x.doc.length), this.regexp ? regexpCursor(this, x, y, b) : stringCursor(this, x, y, b);
2006
+ getCursor(e6, b = 0, x) {
2007
+ let S = e6.doc ? e6 : EditorState.create({ doc: e6 });
2008
+ return x ?? (x = S.doc.length), this.regexp ? regexpCursor(this, S, b, x) : stringCursor(this, S, b, x);
2050
2009
  }
2051
2010
  }, QueryType = class {
2052
2011
  constructor(e6) {
2053
2012
  this.spec = e6;
2054
2013
  }
2055
2014
  };
2056
- function stringCursor(e6, y, b, x) {
2057
- return new SearchCursor(y.doc, e6.unquoted, b, x, e6.caseSensitive ? void 0 : (e7) => e7.toLowerCase(), e6.wholeWord ? stringWordTest(y.doc, y.charCategorizer(y.selection.main.head)) : void 0);
2015
+ function wrapStringTest(e6, b, x) {
2016
+ return (S, C, w, T) => x && !x(S, C, w, T) ? false : e6(S >= T && C <= T + w.length ? w.slice(S - T, C - T) : b.doc.sliceString(S, C), b, S, C);
2017
+ }
2018
+ function stringCursor(e6, b, x, S) {
2019
+ let C;
2020
+ return e6.wholeWord && (C = stringWordTest(b.doc, b.charCategorizer(b.selection.main.head))), e6.test && (C = wrapStringTest(e6.test, b, C)), new SearchCursor(b.doc, e6.unquoted, x, S, e6.caseSensitive ? void 0 : (e7) => e7.toLowerCase(), C);
2058
2021
  }
2059
- function stringWordTest(e6, y) {
2060
- return (b, x, S, C) => ((C > b || C + S.length < x) && (C = Math.max(0, b - 2), S = e6.sliceString(C, Math.min(e6.length, x + 2))), (y(charBefore(S, b - C)) != CharCategory.Word || y(charAfter(S, b - C)) != CharCategory.Word) && (y(charAfter(S, x - C)) != CharCategory.Word || y(charBefore(S, x - C)) != CharCategory.Word));
2022
+ function stringWordTest(e6, b) {
2023
+ return (x, S, C, w) => ((w > x || w + C.length < S) && (w = Math.max(0, x - 2), C = e6.sliceString(w, Math.min(e6.length, S + 2))), (b(charBefore(C, x - w)) != CharCategory.Word || b(charAfter(C, x - w)) != CharCategory.Word) && (b(charAfter(C, S - w)) != CharCategory.Word || b(charBefore(C, S - w)) != CharCategory.Word));
2061
2024
  }
2062
2025
  var StringQuery = class extends QueryType {
2063
2026
  constructor(e6) {
2064
2027
  super(e6);
2065
2028
  }
2066
- nextMatch(e6, y, b) {
2067
- let x = stringCursor(this.spec, e6, b, e6.doc.length).nextOverlapping();
2068
- if (x.done) {
2069
- let b2 = Math.min(e6.doc.length, y + this.spec.unquoted.length);
2070
- x = stringCursor(this.spec, e6, 0, b2).nextOverlapping();
2029
+ nextMatch(e6, b, x) {
2030
+ let S = stringCursor(this.spec, e6, x, e6.doc.length).nextOverlapping();
2031
+ if (S.done) {
2032
+ let x2 = Math.min(e6.doc.length, b + this.spec.unquoted.length);
2033
+ S = stringCursor(this.spec, e6, 0, x2).nextOverlapping();
2071
2034
  }
2072
- return x.done || x.value.from == y && x.value.to == b ? null : x.value;
2073
- }
2074
- prevMatchInRange(e6, y, b) {
2075
- for (let x = b; ; ) {
2076
- let b2 = Math.max(y, x - 1e4 - this.spec.unquoted.length), S = stringCursor(this.spec, e6, b2, x), C = null;
2077
- for (; !S.nextOverlapping().done; ) C = S.value;
2078
- if (C) return C;
2079
- if (b2 == y) return null;
2080
- x -= 1e4;
2035
+ return S.done || S.value.from == b && S.value.to == x ? null : S.value;
2036
+ }
2037
+ prevMatchInRange(e6, b, x) {
2038
+ for (let S = x; ; ) {
2039
+ let x2 = Math.max(b, S - 1e4 - this.spec.unquoted.length), C = stringCursor(this.spec, e6, x2, S), w = null;
2040
+ for (; !C.nextOverlapping().done; ) w = C.value;
2041
+ if (w) return w;
2042
+ if (x2 == b) return null;
2043
+ S -= 1e4;
2081
2044
  }
2082
2045
  }
2083
- prevMatch(e6, y, b) {
2084
- let x = this.prevMatchInRange(e6, 0, y);
2085
- return x || (x = this.prevMatchInRange(e6, Math.max(0, b - this.spec.unquoted.length), e6.doc.length)), x && (x.from != y || x.to != b) ? x : null;
2046
+ prevMatch(e6, b, x) {
2047
+ let S = this.prevMatchInRange(e6, 0, b);
2048
+ return S || (S = this.prevMatchInRange(e6, Math.max(0, x - this.spec.unquoted.length), e6.doc.length)), S && (S.from != b || S.to != x) ? S : null;
2086
2049
  }
2087
2050
  getReplacement(e6) {
2088
2051
  return this.spec.unquote(this.spec.replace);
2089
2052
  }
2090
- matchAll(e6, y) {
2091
- let b = stringCursor(this.spec, e6, 0, e6.doc.length), x = [];
2092
- for (; !b.next().done; ) {
2093
- if (x.length >= y) return null;
2094
- x.push(b.value);
2053
+ matchAll(e6, b) {
2054
+ let x = stringCursor(this.spec, e6, 0, e6.doc.length), S = [];
2055
+ for (; !x.next().done; ) {
2056
+ if (S.length >= b) return null;
2057
+ S.push(x.value);
2095
2058
  }
2096
- return x;
2059
+ return S;
2097
2060
  }
2098
- highlight(e6, y, b, x) {
2099
- let S = stringCursor(this.spec, e6, Math.max(0, y - this.spec.unquoted.length), Math.min(b + this.spec.unquoted.length, e6.doc.length));
2100
- for (; !S.next().done; ) x(S.value.from, S.value.to);
2061
+ highlight(e6, b, x, S) {
2062
+ let C = stringCursor(this.spec, e6, Math.max(0, b - this.spec.unquoted.length), Math.min(x + this.spec.unquoted.length, e6.doc.length));
2063
+ for (; !C.next().done; ) S(C.value.from, C.value.to);
2101
2064
  }
2102
2065
  };
2103
- function regexpCursor(e6, y, b, x) {
2104
- return new RegExpCursor(y.doc, e6.search, {
2066
+ function wrapRegexpTest(e6, b, x) {
2067
+ return (S, C, w) => (!x || x(S, C, w)) && e6(w[0], b, S, C);
2068
+ }
2069
+ function regexpCursor(e6, b, x, S) {
2070
+ let C;
2071
+ return e6.wholeWord && (C = regexpWordTest(b.charCategorizer(b.selection.main.head))), e6.test && (C = wrapRegexpTest(e6.test, b, C)), new RegExpCursor(b.doc, e6.search, {
2105
2072
  ignoreCase: !e6.caseSensitive,
2106
- test: e6.wholeWord ? regexpWordTest(y.charCategorizer(y.selection.main.head)) : void 0
2107
- }, b, x);
2073
+ test: C
2074
+ }, x, S);
2108
2075
  }
2109
- function charBefore(e6, y) {
2110
- return e6.slice(findClusterBreak(e6, y, false), y);
2076
+ function charBefore(e6, b) {
2077
+ return e6.slice(findClusterBreak(e6, b, false), b);
2111
2078
  }
2112
- function charAfter(e6, y) {
2113
- return e6.slice(y, findClusterBreak(e6, y));
2079
+ function charAfter(e6, b) {
2080
+ return e6.slice(b, findClusterBreak(e6, b));
2114
2081
  }
2115
2082
  function regexpWordTest(e6) {
2116
- return (y, b, x) => !x[0].length || (e6(charBefore(x.input, x.index)) != CharCategory.Word || e6(charAfter(x.input, x.index)) != CharCategory.Word) && (e6(charAfter(x.input, x.index + x[0].length)) != CharCategory.Word || e6(charBefore(x.input, x.index + x[0].length)) != CharCategory.Word);
2083
+ return (b, x, S) => !S[0].length || (e6(charBefore(S.input, S.index)) != CharCategory.Word || e6(charAfter(S.input, S.index)) != CharCategory.Word) && (e6(charAfter(S.input, S.index + S[0].length)) != CharCategory.Word || e6(charBefore(S.input, S.index + S[0].length)) != CharCategory.Word);
2117
2084
  }
2118
2085
  var RegExpQuery = class extends QueryType {
2119
- nextMatch(e6, y, b) {
2120
- let x = regexpCursor(this.spec, e6, b, e6.doc.length).next();
2121
- return x.done && (x = regexpCursor(this.spec, e6, 0, y).next()), x.done ? null : x.value;
2122
- }
2123
- prevMatchInRange(e6, y, b) {
2124
- for (let x = 1; ; x++) {
2125
- let S = Math.max(y, b - x * 1e4), C = regexpCursor(this.spec, e6, S, b), w = null;
2126
- for (; !C.next().done; ) w = C.value;
2127
- if (w && (S == y || w.from > S + 10)) return w;
2128
- if (S == y) return null;
2086
+ nextMatch(e6, b, x) {
2087
+ let S = regexpCursor(this.spec, e6, x, e6.doc.length).next();
2088
+ return S.done && (S = regexpCursor(this.spec, e6, 0, b).next()), S.done ? null : S.value;
2089
+ }
2090
+ prevMatchInRange(e6, b, x) {
2091
+ for (let S = 1; ; S++) {
2092
+ let C = Math.max(b, x - S * 1e4), w = regexpCursor(this.spec, e6, C, x), T = null;
2093
+ for (; !w.next().done; ) T = w.value;
2094
+ if (T && (C == b || T.from > C + 10)) return T;
2095
+ if (C == b) return null;
2129
2096
  }
2130
2097
  }
2131
- prevMatch(e6, y, b) {
2132
- return this.prevMatchInRange(e6, 0, y) || this.prevMatchInRange(e6, b, e6.doc.length);
2098
+ prevMatch(e6, b, x) {
2099
+ return this.prevMatchInRange(e6, 0, b) || this.prevMatchInRange(e6, x, e6.doc.length);
2133
2100
  }
2134
2101
  getReplacement(e6) {
2135
- return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (y, b) => {
2136
- if (b == "&") return e6.match[0];
2137
- if (b == "$") return "$";
2138
- for (let y2 = b.length; y2 > 0; y2--) {
2139
- let x = +b.slice(0, y2);
2140
- if (x > 0 && x < e6.match.length) return e6.match[x] + b.slice(y2);
2102
+ return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (b, x) => {
2103
+ if (x == "&") return e6.match[0];
2104
+ if (x == "$") return "$";
2105
+ for (let b2 = x.length; b2 > 0; b2--) {
2106
+ let S = +x.slice(0, b2);
2107
+ if (S > 0 && S < e6.match.length) return e6.match[S] + x.slice(b2);
2141
2108
  }
2142
- return y;
2109
+ return b;
2143
2110
  });
2144
2111
  }
2145
- matchAll(e6, y) {
2146
- let b = regexpCursor(this.spec, e6, 0, e6.doc.length), x = [];
2147
- for (; !b.next().done; ) {
2148
- if (x.length >= y) return null;
2149
- x.push(b.value);
2112
+ matchAll(e6, b) {
2113
+ let x = regexpCursor(this.spec, e6, 0, e6.doc.length), S = [];
2114
+ for (; !x.next().done; ) {
2115
+ if (S.length >= b) return null;
2116
+ S.push(x.value);
2150
2117
  }
2151
- return x;
2118
+ return S;
2152
2119
  }
2153
- highlight(e6, y, b, x) {
2154
- let S = regexpCursor(this.spec, e6, Math.max(0, y - 250), Math.min(b + 250, e6.doc.length));
2155
- for (; !S.next().done; ) x(S.value.from, S.value.to);
2120
+ highlight(e6, b, x, S) {
2121
+ let C = regexpCursor(this.spec, e6, Math.max(0, b - 250), Math.min(x + 250, e6.doc.length));
2122
+ for (; !C.next().done; ) S(C.value.from, C.value.to);
2156
2123
  }
2157
2124
  }, setSearchQuery = /* @__PURE__ */ StateEffect.define(), togglePanel = /* @__PURE__ */ StateEffect.define(), searchState = /* @__PURE__ */ StateField.define({
2158
2125
  create(e6) {
2159
2126
  return new SearchState(defaultQuery(e6).create(), null);
2160
2127
  },
2161
- update(e6, y) {
2162
- for (let b of y.effects) b.is(setSearchQuery) ? e6 = new SearchState(b.value.create(), e6.panel) : b.is(togglePanel) && (e6 = new SearchState(e6.query, b.value ? createSearchPanel : null));
2128
+ update(e6, b) {
2129
+ for (let x of b.effects) x.is(setSearchQuery) ? e6 = new SearchState(x.value.create(), e6.panel) : x.is(togglePanel) && (e6 = new SearchState(e6.query, x.value ? createSearchPanel : null));
2163
2130
  return e6;
2164
2131
  },
2165
2132
  provide: (e6) => showPanel.from(e6, (e7) => e7.panel)
2166
2133
  }), SearchState = class {
2167
- constructor(e6, y) {
2168
- this.query = e6, this.panel = y;
2134
+ constructor(e6, b) {
2135
+ this.query = e6, this.panel = b;
2169
2136
  }
2170
2137
  }, matchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch" }), selectedMatchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
2171
2138
  constructor(e6) {
2172
2139
  this.view = e6, this.decorations = this.highlight(e6.state.field(searchState));
2173
2140
  }
2174
2141
  update(e6) {
2175
- let y = e6.state.field(searchState);
2176
- (y != e6.startState.field(searchState) || e6.docChanged || e6.selectionSet || e6.viewportChanged) && (this.decorations = this.highlight(y));
2177
- }
2178
- highlight({ query: e6, panel: y }) {
2179
- if (!y || !e6.spec.valid) return Decoration.none;
2180
- let { view: b } = this, x = new RangeSetBuilder();
2181
- for (let y2 = 0, S = b.visibleRanges, C = S.length; y2 < C; y2++) {
2182
- let { from: w, to: T } = S[y2];
2183
- for (; y2 < C - 1 && T > S[y2 + 1].from - 500; ) T = S[++y2].to;
2184
- e6.highlight(b.state, w, T, (e7, y3) => {
2185
- let S2 = b.state.selection.ranges.some((b2) => b2.from == e7 && b2.to == y3);
2186
- x.add(e7, y3, S2 ? selectedMatchMark : matchMark);
2142
+ let b = e6.state.field(searchState);
2143
+ (b != e6.startState.field(searchState) || e6.docChanged || e6.selectionSet || e6.viewportChanged) && (this.decorations = this.highlight(b));
2144
+ }
2145
+ highlight({ query: e6, panel: b }) {
2146
+ if (!b || !e6.spec.valid) return Decoration.none;
2147
+ let { view: x } = this, S = new RangeSetBuilder();
2148
+ for (let b2 = 0, C = x.visibleRanges, w = C.length; b2 < w; b2++) {
2149
+ let { from: T, to: E } = C[b2];
2150
+ for (; b2 < w - 1 && E > C[b2 + 1].from - 500; ) E = C[++b2].to;
2151
+ e6.highlight(x.state, T, E, (e7, b3) => {
2152
+ let C2 = x.state.selection.ranges.some((x2) => x2.from == e7 && x2.to == b3);
2153
+ S.add(e7, b3, C2 ? selectedMatchMark : matchMark);
2187
2154
  });
2188
2155
  }
2189
- return x.finish();
2156
+ return S.finish();
2190
2157
  }
2191
2158
  }, { decorations: (e6) => e6.decorations });
2192
2159
  function searchCommand(e6) {
2193
- return (y) => {
2194
- let b = y.state.field(searchState, false);
2195
- return b && b.query.spec.valid ? e6(y, b) : openSearchPanel(y);
2160
+ return (b) => {
2161
+ let x = b.state.field(searchState, false);
2162
+ return x && x.query.spec.valid ? e6(b, x) : openSearchPanel(b);
2196
2163
  };
2197
2164
  }
2198
- var findNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2199
- let { to: b } = e6.state.selection.main, x = y.nextMatch(e6.state, b, b);
2200
- if (!x) return false;
2201
- let S = EditorSelection.single(x.from, x.to), C = e6.state.facet(searchConfigFacet);
2202
- return e6.dispatch({
2203
- selection: S,
2204
- effects: [announceMatch(e6, x), C.scrollToMatch(S.main, e6)],
2205
- userEvent: "select.search"
2206
- }), selectSearchInput(e6), true;
2207
- }), findPrevious = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2208
- let { state: b } = e6, { from: x } = b.selection.main, S = y.prevMatch(b, x, x);
2165
+ var findNext = /* @__PURE__ */ searchCommand((e6, { query: b }) => {
2166
+ let { to: x } = e6.state.selection.main, S = b.nextMatch(e6.state, x, x);
2209
2167
  if (!S) return false;
2210
2168
  let C = EditorSelection.single(S.from, S.to), w = e6.state.facet(searchConfigFacet);
2211
2169
  return e6.dispatch({
@@ -2213,98 +2171,107 @@ var findNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2213
2171
  effects: [announceMatch(e6, S), w.scrollToMatch(C.main, e6)],
2214
2172
  userEvent: "select.search"
2215
2173
  }), selectSearchInput(e6), true;
2216
- }), selectMatches = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2217
- let b = y.matchAll(e6.state, 1e3);
2218
- return !b || !b.length ? false : (e6.dispatch({
2219
- selection: EditorSelection.create(b.map((e7) => EditorSelection.range(e7.from, e7.to))),
2174
+ }), findPrevious = /* @__PURE__ */ searchCommand((e6, { query: b }) => {
2175
+ let { state: x } = e6, { from: S } = x.selection.main, C = b.prevMatch(x, S, S);
2176
+ if (!C) return false;
2177
+ let w = EditorSelection.single(C.from, C.to), T = e6.state.facet(searchConfigFacet);
2178
+ return e6.dispatch({
2179
+ selection: w,
2180
+ effects: [announceMatch(e6, C), T.scrollToMatch(w.main, e6)],
2181
+ userEvent: "select.search"
2182
+ }), selectSearchInput(e6), true;
2183
+ }), selectMatches = /* @__PURE__ */ searchCommand((e6, { query: b }) => {
2184
+ let x = b.matchAll(e6.state, 1e3);
2185
+ return !x || !x.length ? false : (e6.dispatch({
2186
+ selection: EditorSelection.create(x.map((e7) => EditorSelection.range(e7.from, e7.to))),
2220
2187
  userEvent: "select.search.matches"
2221
2188
  }), true);
2222
- }), selectSelectionMatches = ({ state: e6, dispatch: y }) => {
2223
- let b = e6.selection;
2224
- if (b.ranges.length > 1 || b.main.empty) return false;
2225
- let { from: x, to: S } = b.main, C = [], w = 0;
2226
- for (let y2 = new SearchCursor(e6.doc, e6.sliceDoc(x, S)); !y2.next().done; ) {
2227
- if (C.length > 1e3) return false;
2228
- y2.value.from == x && (w = C.length), C.push(EditorSelection.range(y2.value.from, y2.value.to));
2229
- }
2230
- return y(e6.update({
2231
- selection: EditorSelection.create(C, w),
2189
+ }), selectSelectionMatches = ({ state: e6, dispatch: b }) => {
2190
+ let x = e6.selection;
2191
+ if (x.ranges.length > 1 || x.main.empty) return false;
2192
+ let { from: S, to: C } = x.main, w = [], T = 0;
2193
+ for (let b2 = new SearchCursor(e6.doc, e6.sliceDoc(S, C)); !b2.next().done; ) {
2194
+ if (w.length > 1e3) return false;
2195
+ b2.value.from == S && (T = w.length), w.push(EditorSelection.range(b2.value.from, b2.value.to));
2196
+ }
2197
+ return b(e6.update({
2198
+ selection: EditorSelection.create(w, T),
2232
2199
  userEvent: "select.search.matches"
2233
2200
  })), true;
2234
- }, replaceNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2235
- let { state: b } = e6, { from: x, to: S } = b.selection.main;
2236
- if (b.readOnly) return false;
2237
- let C = y.nextMatch(b, x, x);
2238
- if (!C) return false;
2239
- let w = C, T = [], E, D, O = [];
2240
- w.from == x && w.to == S && (D = b.toText(y.getReplacement(w)), T.push({
2241
- from: w.from,
2242
- to: w.to,
2243
- insert: D
2244
- }), w = y.nextMatch(b, w.from, w.to), O.push(EditorView.announce.of(b.phrase("replaced match on line $", b.doc.lineAt(x).number) + ".")));
2245
- let k = e6.state.changes(T);
2246
- return w && (E = EditorSelection.single(w.from, w.to).map(k), O.push(announceMatch(e6, w)), O.push(b.facet(searchConfigFacet).scrollToMatch(E.main, e6))), e6.dispatch({
2247
- changes: k,
2248
- selection: E,
2249
- effects: O,
2201
+ }, replaceNext = /* @__PURE__ */ searchCommand((e6, { query: b }) => {
2202
+ let { state: x } = e6, { from: S, to: C } = x.selection.main;
2203
+ if (x.readOnly) return false;
2204
+ let w = b.nextMatch(x, S, S);
2205
+ if (!w) return false;
2206
+ let T = w, E = [], D, O, k = [];
2207
+ T.from == S && T.to == C && (O = x.toText(b.getReplacement(T)), E.push({
2208
+ from: T.from,
2209
+ to: T.to,
2210
+ insert: O
2211
+ }), T = b.nextMatch(x, T.from, T.to), k.push(EditorView.announce.of(x.phrase("replaced match on line $", x.doc.lineAt(S).number) + ".")));
2212
+ let A = e6.state.changes(E);
2213
+ return T && (D = EditorSelection.single(T.from, T.to).map(A), k.push(announceMatch(e6, T)), k.push(x.facet(searchConfigFacet).scrollToMatch(D.main, e6))), e6.dispatch({
2214
+ changes: A,
2215
+ selection: D,
2216
+ effects: k,
2250
2217
  userEvent: "input.replace"
2251
2218
  }), true;
2252
- }), replaceAll = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
2219
+ }), replaceAll = /* @__PURE__ */ searchCommand((e6, { query: b }) => {
2253
2220
  if (e6.state.readOnly) return false;
2254
- let b = y.matchAll(e6.state, 1e9).map((e7) => {
2255
- let { from: b2, to: x2 } = e7;
2221
+ let x = b.matchAll(e6.state, 1e9).map((e7) => {
2222
+ let { from: x2, to: S2 } = e7;
2256
2223
  return {
2257
- from: b2,
2258
- to: x2,
2259
- insert: y.getReplacement(e7)
2224
+ from: x2,
2225
+ to: S2,
2226
+ insert: b.getReplacement(e7)
2260
2227
  };
2261
2228
  });
2262
- if (!b.length) return false;
2263
- let x = e6.state.phrase("replaced $ matches", b.length) + ".";
2229
+ if (!x.length) return false;
2230
+ let S = e6.state.phrase("replaced $ matches", x.length) + ".";
2264
2231
  return e6.dispatch({
2265
- changes: b,
2266
- effects: EditorView.announce.of(x),
2232
+ changes: x,
2233
+ effects: EditorView.announce.of(S),
2267
2234
  userEvent: "input.replace.all"
2268
2235
  }), true;
2269
2236
  });
2270
2237
  function createSearchPanel(e6) {
2271
2238
  return e6.state.facet(searchConfigFacet).createPanel(e6);
2272
2239
  }
2273
- function defaultQuery(e6, y) {
2274
- let b = e6.selection.main, x = b.empty || b.to > b.from + 100 ? "" : e6.sliceDoc(b.from, b.to);
2275
- if (y && !x) return y;
2276
- let S = e6.facet(searchConfigFacet);
2240
+ function defaultQuery(e6, b) {
2241
+ let x = e6.selection.main, S = x.empty || x.to > x.from + 100 ? "" : e6.sliceDoc(x.from, x.to);
2242
+ if (b && !S) return b;
2243
+ let C = e6.facet(searchConfigFacet);
2277
2244
  return new SearchQuery({
2278
- search: (y == null ? void 0 : y.literal) ?? S.literal ? x : x.replace(/\n/g, "\\n"),
2279
- caseSensitive: (y == null ? void 0 : y.caseSensitive) ?? S.caseSensitive,
2280
- literal: (y == null ? void 0 : y.literal) ?? S.literal,
2281
- regexp: (y == null ? void 0 : y.regexp) ?? S.regexp,
2282
- wholeWord: (y == null ? void 0 : y.wholeWord) ?? S.wholeWord
2245
+ search: (b == null ? void 0 : b.literal) ?? C.literal ? S : S.replace(/\n/g, "\\n"),
2246
+ caseSensitive: (b == null ? void 0 : b.caseSensitive) ?? C.caseSensitive,
2247
+ literal: (b == null ? void 0 : b.literal) ?? C.literal,
2248
+ regexp: (b == null ? void 0 : b.regexp) ?? C.regexp,
2249
+ wholeWord: (b == null ? void 0 : b.wholeWord) ?? C.wholeWord
2283
2250
  });
2284
2251
  }
2285
2252
  function getSearchInput(e6) {
2286
- let y = getPanel(e6, createSearchPanel);
2287
- return y && y.dom.querySelector("[main-field]");
2253
+ let b = getPanel(e6, createSearchPanel);
2254
+ return b && b.dom.querySelector("[main-field]");
2288
2255
  }
2289
2256
  function selectSearchInput(e6) {
2290
- let y = getSearchInput(e6);
2291
- y && y == e6.root.activeElement && y.select();
2257
+ let b = getSearchInput(e6);
2258
+ b && b == e6.root.activeElement && b.select();
2292
2259
  }
2293
2260
  var openSearchPanel = (e6) => {
2294
- let y = e6.state.field(searchState, false);
2295
- if (y && y.panel) {
2296
- let b = getSearchInput(e6);
2297
- if (b && b != e6.root.activeElement) {
2298
- let x = defaultQuery(e6.state, y.query.spec);
2299
- x.valid && e6.dispatch({ effects: setSearchQuery.of(x) }), b.focus(), b.select();
2261
+ let b = e6.state.field(searchState, false);
2262
+ if (b && b.panel) {
2263
+ let x = getSearchInput(e6);
2264
+ if (x && x != e6.root.activeElement) {
2265
+ let S = defaultQuery(e6.state, b.query.spec);
2266
+ S.valid && e6.dispatch({ effects: setSearchQuery.of(S) }), x.focus(), x.select();
2300
2267
  }
2301
- } else e6.dispatch({ effects: [togglePanel.of(true), y ? setSearchQuery.of(defaultQuery(e6.state, y.query.spec)) : StateEffect.appendConfig.of(searchExtensions)] });
2268
+ } else e6.dispatch({ effects: [togglePanel.of(true), b ? setSearchQuery.of(defaultQuery(e6.state, b.query.spec)) : StateEffect.appendConfig.of(searchExtensions)] });
2302
2269
  return true;
2303
2270
  }, closeSearchPanel = (e6) => {
2304
- let y = e6.state.field(searchState, false);
2305
- if (!y || !y.panel) return false;
2306
- let b = getPanel(e6, createSearchPanel);
2307
- return b && b.dom.contains(e6.root.activeElement) && e6.focus(), e6.dispatch({ effects: togglePanel.of(false) }), true;
2271
+ let b = e6.state.field(searchState, false);
2272
+ if (!b || !b.panel) return false;
2273
+ let x = getPanel(e6, createSearchPanel);
2274
+ return x && x.dom.contains(e6.root.activeElement) && e6.focus(), e6.dispatch({ effects: togglePanel.of(false) }), true;
2308
2275
  }, searchKeymap = [
2309
2276
  {
2310
2277
  key: "Mod-f",
@@ -2346,9 +2313,9 @@ var openSearchPanel = (e6) => {
2346
2313
  ], SearchPanel = class {
2347
2314
  constructor(e6) {
2348
2315
  this.view = e6;
2349
- let y = this.query = e6.state.field(searchState).query.spec;
2316
+ let b = this.query = e6.state.field(searchState).query.spec;
2350
2317
  this.commit = this.commit.bind(this), this.searchField = crelt("input", {
2351
- value: y.search,
2318
+ value: b.search,
2352
2319
  placeholder: phrase(e6, "Find"),
2353
2320
  "aria-label": phrase(e6, "Find"),
2354
2321
  class: "cm-textfield",
@@ -2358,7 +2325,7 @@ var openSearchPanel = (e6) => {
2358
2325
  onchange: this.commit,
2359
2326
  onkeyup: this.commit
2360
2327
  }), this.replaceField = crelt("input", {
2361
- value: y.replace,
2328
+ value: b.replace,
2362
2329
  placeholder: phrase(e6, "Replace"),
2363
2330
  "aria-label": phrase(e6, "Replace"),
2364
2331
  class: "cm-textfield",
@@ -2370,45 +2337,45 @@ var openSearchPanel = (e6) => {
2370
2337
  type: "checkbox",
2371
2338
  name: "case",
2372
2339
  form: "",
2373
- checked: y.caseSensitive,
2340
+ checked: b.caseSensitive,
2374
2341
  onchange: this.commit
2375
2342
  }), this.reField = crelt("input", {
2376
2343
  type: "checkbox",
2377
2344
  name: "re",
2378
2345
  form: "",
2379
- checked: y.regexp,
2346
+ checked: b.regexp,
2380
2347
  onchange: this.commit
2381
2348
  }), this.wordField = crelt("input", {
2382
2349
  type: "checkbox",
2383
2350
  name: "word",
2384
2351
  form: "",
2385
- checked: y.wholeWord,
2352
+ checked: b.wholeWord,
2386
2353
  onchange: this.commit
2387
2354
  });
2388
- function b(e7, y2, b2) {
2355
+ function x(e7, b2, x2) {
2389
2356
  return crelt("button", {
2390
2357
  class: "cm-button",
2391
2358
  name: e7,
2392
- onclick: y2,
2359
+ onclick: b2,
2393
2360
  type: "button"
2394
- }, b2);
2361
+ }, x2);
2395
2362
  }
2396
2363
  this.dom = crelt("div", {
2397
2364
  onkeydown: (e7) => this.keydown(e7),
2398
2365
  class: "cm-search"
2399
2366
  }, [
2400
2367
  this.searchField,
2401
- b("next", () => findNext(e6), [phrase(e6, "next")]),
2402
- b("prev", () => findPrevious(e6), [phrase(e6, "previous")]),
2403
- b("select", () => selectMatches(e6), [phrase(e6, "all")]),
2368
+ x("next", () => findNext(e6), [phrase(e6, "next")]),
2369
+ x("prev", () => findPrevious(e6), [phrase(e6, "previous")]),
2370
+ x("select", () => selectMatches(e6), [phrase(e6, "all")]),
2404
2371
  crelt("label", null, [this.caseField, phrase(e6, "match case")]),
2405
2372
  crelt("label", null, [this.reField, phrase(e6, "regexp")]),
2406
2373
  crelt("label", null, [this.wordField, phrase(e6, "by word")]),
2407
2374
  ...e6.state.readOnly ? [] : [
2408
2375
  crelt("br"),
2409
2376
  this.replaceField,
2410
- b("replace", () => replaceNext(e6), [phrase(e6, "replace")]),
2411
- b("replaceAll", () => replaceAll(e6), [phrase(e6, "replace all")])
2377
+ x("replace", () => replaceNext(e6), [phrase(e6, "replace")]),
2378
+ x("replaceAll", () => replaceAll(e6), [phrase(e6, "replace all")])
2412
2379
  ],
2413
2380
  crelt("button", {
2414
2381
  name: "close",
@@ -2432,7 +2399,7 @@ var openSearchPanel = (e6) => {
2432
2399
  runScopeHandlers(this.view, e6, "search-panel") ? e6.preventDefault() : e6.keyCode == 13 && e6.target == this.searchField ? (e6.preventDefault(), (e6.shiftKey ? findPrevious : findNext)(this.view)) : e6.keyCode == 13 && e6.target == this.replaceField && (e6.preventDefault(), replaceNext(this.view));
2433
2400
  }
2434
2401
  update(e6) {
2435
- for (let y of e6.transactions) for (let e7 of y.effects) e7.is(setSearchQuery) && !e7.value.eq(this.query) && this.setQuery(e7.value);
2402
+ for (let b of e6.transactions) for (let e7 of b.effects) e7.is(setSearchQuery) && !e7.value.eq(this.query) && this.setQuery(e7.value);
2436
2403
  }
2437
2404
  setQuery(e6) {
2438
2405
  this.query = e6, this.searchField.value = e6.search, this.replaceField.value = e6.replace, this.caseField.checked = e6.caseSensitive, this.reField.checked = e6.regexp, this.wordField.checked = e6.wholeWord;
@@ -2447,25 +2414,25 @@ var openSearchPanel = (e6) => {
2447
2414
  return this.view.state.facet(searchConfigFacet).top;
2448
2415
  }
2449
2416
  };
2450
- function phrase(e6, y) {
2451
- return e6.state.phrase(y);
2417
+ function phrase(e6, b) {
2418
+ return e6.state.phrase(b);
2452
2419
  }
2453
2420
  var AnnounceMargin = 30, Break = /[\s\.,:;?!]/;
2454
- function announceMatch(e6, { from: y, to: b }) {
2455
- let x = e6.state.doc.lineAt(y), S = e6.state.doc.lineAt(b).to, C = Math.max(x.from, y - AnnounceMargin), w = Math.min(S, b + AnnounceMargin), T = e6.state.sliceDoc(C, w);
2456
- if (C != x.from) {
2457
- for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(T[e7 + 1]) && Break.test(T[e7])) {
2458
- T = T.slice(e7);
2421
+ function announceMatch(e6, { from: b, to: x }) {
2422
+ let S = e6.state.doc.lineAt(b), C = e6.state.doc.lineAt(x).to, w = Math.max(S.from, b - AnnounceMargin), T = Math.min(C, x + AnnounceMargin), E = e6.state.sliceDoc(w, T);
2423
+ if (w != S.from) {
2424
+ for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(E[e7 + 1]) && Break.test(E[e7])) {
2425
+ E = E.slice(e7);
2459
2426
  break;
2460
2427
  }
2461
2428
  }
2462
- if (w != S) {
2463
- for (let e7 = T.length - 1; e7 > T.length - AnnounceMargin; e7--) if (!Break.test(T[e7 - 1]) && Break.test(T[e7])) {
2464
- T = T.slice(0, e7);
2429
+ if (T != C) {
2430
+ for (let e7 = E.length - 1; e7 > E.length - AnnounceMargin; e7--) if (!Break.test(E[e7 - 1]) && Break.test(E[e7])) {
2431
+ E = E.slice(0, e7);
2465
2432
  break;
2466
2433
  }
2467
2434
  }
2468
- return EditorView.announce.of(`${e6.state.phrase("current match")}. ${T} ${e6.state.phrase("on line")} ${x.number}.`);
2435
+ return EditorView.announce.of(`${e6.state.phrase("current match")}. ${E} ${e6.state.phrase("on line")} ${S.number}.`);
2469
2436
  }
2470
2437
  var baseTheme = /* @__PURE__ */ EditorView.baseTheme({
2471
2438
  ".cm-panel.cm-search": {
@@ -2499,34 +2466,34 @@ var baseTheme = /* @__PURE__ */ EditorView.baseTheme({
2499
2466
  ];
2500
2467
  function _extends() {
2501
2468
  return _extends = Object.assign ? Object.assign.bind() : function(e6) {
2502
- for (var y = 1; y < arguments.length; y++) {
2503
- var b = arguments[y];
2504
- for (var x in b) ({}).hasOwnProperty.call(b, x) && (e6[x] = b[x]);
2469
+ for (var b = 1; b < arguments.length; b++) {
2470
+ var x = arguments[b];
2471
+ for (var S in x) ({}).hasOwnProperty.call(x, S) && (e6[S] = x[S]);
2505
2472
  }
2506
2473
  return e6;
2507
2474
  }, _extends.apply(null, arguments);
2508
2475
  }
2509
- function _objectWithoutPropertiesLoose(e6, y) {
2476
+ function _objectWithoutPropertiesLoose(e6, b) {
2510
2477
  if (e6 == null) return {};
2511
- var b = {};
2512
- for (var x in e6) if ({}.hasOwnProperty.call(e6, x)) {
2513
- if (y.indexOf(x) !== -1) continue;
2514
- b[x] = e6[x];
2478
+ var x = {};
2479
+ for (var S in e6) if ({}.hasOwnProperty.call(e6, S)) {
2480
+ if (b.indexOf(S) !== -1) continue;
2481
+ x[S] = e6[S];
2515
2482
  }
2516
- return b;
2483
+ return x;
2517
2484
  }
2518
2485
  var basicSetup = function(e6) {
2519
2486
  e6 === void 0 && (e6 = {});
2520
- var { crosshairCursor: y = false } = e6, b = [];
2521
- e6.closeBracketsKeymap !== false && (b = b.concat(closeBracketsKeymap)), e6.defaultKeymap !== false && (b = b.concat(defaultKeymap)), e6.searchKeymap !== false && (b = b.concat(searchKeymap)), e6.historyKeymap !== false && (b = b.concat(historyKeymap)), e6.foldKeymap !== false && (b = b.concat(foldKeymap)), e6.completionKeymap !== false && (b = b.concat(completionKeymap)), e6.lintKeymap !== false && (b = b.concat(lintKeymap));
2522
- var x = [];
2523
- return e6.lineNumbers !== false && x.push(lineNumbers()), e6.highlightActiveLineGutter !== false && x.push(highlightActiveLineGutter()), e6.highlightSpecialChars !== false && x.push(highlightSpecialChars()), e6.history !== false && x.push(history()), e6.foldGutter !== false && x.push(foldGutter()), e6.drawSelection !== false && x.push(drawSelection()), e6.dropCursor !== false && x.push(dropCursor()), e6.allowMultipleSelections !== false && x.push(EditorState.allowMultipleSelections.of(true)), e6.indentOnInput !== false && x.push(indentOnInput()), e6.syntaxHighlighting !== false && x.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), e6.bracketMatching !== false && x.push(bracketMatching()), e6.closeBrackets !== false && x.push(closeBrackets()), e6.autocompletion !== false && x.push(autocompletion()), e6.rectangularSelection !== false && x.push(rectangularSelection()), y !== false && x.push(crosshairCursor()), e6.highlightActiveLine !== false && x.push(highlightActiveLine()), e6.highlightSelectionMatches !== false && x.push(highlightSelectionMatches()), e6.tabSize && typeof e6.tabSize == "number" && x.push(indentUnit.of(" ".repeat(e6.tabSize))), x.concat([keymap.of(b.flat())]).filter(Boolean);
2487
+ var { crosshairCursor: b = false } = e6, x = [];
2488
+ e6.closeBracketsKeymap !== false && (x = x.concat(closeBracketsKeymap)), e6.defaultKeymap !== false && (x = x.concat(defaultKeymap)), e6.searchKeymap !== false && (x = x.concat(searchKeymap)), e6.historyKeymap !== false && (x = x.concat(historyKeymap)), e6.foldKeymap !== false && (x = x.concat(foldKeymap)), e6.completionKeymap !== false && (x = x.concat(completionKeymap)), e6.lintKeymap !== false && (x = x.concat(lintKeymap));
2489
+ var S = [];
2490
+ return e6.lineNumbers !== false && S.push(lineNumbers()), e6.highlightActiveLineGutter !== false && S.push(highlightActiveLineGutter()), e6.highlightSpecialChars !== false && S.push(highlightSpecialChars()), e6.history !== false && S.push(history()), e6.foldGutter !== false && S.push(foldGutter()), e6.drawSelection !== false && S.push(drawSelection()), e6.dropCursor !== false && S.push(dropCursor()), e6.allowMultipleSelections !== false && S.push(EditorState.allowMultipleSelections.of(true)), e6.indentOnInput !== false && S.push(indentOnInput()), e6.syntaxHighlighting !== false && S.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), e6.bracketMatching !== false && S.push(bracketMatching()), e6.closeBrackets !== false && S.push(closeBrackets()), e6.autocompletion !== false && S.push(autocompletion()), e6.rectangularSelection !== false && S.push(rectangularSelection()), b !== false && S.push(crosshairCursor()), e6.highlightActiveLine !== false && S.push(highlightActiveLine()), e6.highlightSelectionMatches !== false && S.push(highlightSelectionMatches()), e6.tabSize && typeof e6.tabSize == "number" && S.push(indentUnit.of(" ".repeat(e6.tabSize))), S.concat([keymap.of(x.flat())]).filter(Boolean);
2524
2491
  }, minimalSetup = function(e6) {
2525
2492
  e6 === void 0 && (e6 = {});
2526
- var y = [];
2527
- e6.defaultKeymap !== false && (y = y.concat(defaultKeymap)), e6.historyKeymap !== false && (y = y.concat(historyKeymap));
2528
2493
  var b = [];
2529
- return e6.highlightSpecialChars !== false && b.push(highlightSpecialChars()), e6.history !== false && b.push(history()), e6.drawSelection !== false && b.push(drawSelection()), e6.syntaxHighlighting !== false && b.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), b.concat([keymap.of(y.flat())]).filter(Boolean);
2494
+ e6.defaultKeymap !== false && (b = b.concat(defaultKeymap)), e6.historyKeymap !== false && (b = b.concat(historyKeymap));
2495
+ var x = [];
2496
+ return e6.highlightSpecialChars !== false && x.push(highlightSpecialChars()), e6.history !== false && x.push(history()), e6.drawSelection !== false && x.push(drawSelection()), e6.syntaxHighlighting !== false && x.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), x.concat([keymap.of(b.flat())]).filter(Boolean);
2530
2497
  }, chalky = "#e5c07b", coral = "#e06c75", cyan = "#56b6c2", invalid = "#ffffff", ivory = "#abb2bf", stone = "#7d8799", malibu = "#61afef", sage = "#98c379", whiskey = "#d19a66", violet = "#c678dd", darkBackground = "#21252b", highlightBackground = "#2c313a", background = "#282c34", tooltipBackground = "#353a42", selection = "#3E4451", cursor = "#528bff", oneDark = [/* @__PURE__ */ EditorView.theme({
2531
2498
  "&": {
2532
2499
  color: ivory,
@@ -2680,21 +2647,21 @@ var basicSetup = function(e6) {
2680
2647
  }
2681
2648
  ]))], defaultLightThemeOption = EditorView.theme({ "&": { backgroundColor: "#fff" } }, { dark: false }), getDefaultExtensions = function(e6) {
2682
2649
  e6 === void 0 && (e6 = {});
2683
- var { indentWithTab: y = true, editable: b = true, readOnly: x = false, theme: S = "light", placeholder: C = "", basicSetup: w = true } = e6, T = [];
2684
- switch (y && T.unshift(keymap.of([indentWithTab])), w && (typeof w == "boolean" ? T.unshift(basicSetup()) : T.unshift(basicSetup(w))), C && T.unshift(placeholder(C)), S) {
2650
+ var { indentWithTab: b = true, editable: x = true, readOnly: S = false, theme: C = "light", placeholder: w = "", basicSetup: T = true } = e6, E = [];
2651
+ switch (b && E.unshift(keymap.of([indentWithTab])), T && (typeof T == "boolean" ? E.unshift(basicSetup()) : E.unshift(basicSetup(T))), w && E.unshift(placeholder(w)), C) {
2685
2652
  case "light":
2686
- T.push(defaultLightThemeOption);
2653
+ E.push(defaultLightThemeOption);
2687
2654
  break;
2688
2655
  case "dark":
2689
- T.push(oneDark);
2656
+ E.push(oneDark);
2690
2657
  break;
2691
2658
  case "none":
2692
2659
  break;
2693
2660
  default:
2694
- T.push(S);
2661
+ E.push(C);
2695
2662
  break;
2696
2663
  }
2697
- return b === false && T.push(EditorView.editable.of(false)), x && T.push(EditorState.readOnly.of(true)), [...T];
2664
+ return x === false && E.push(EditorView.editable.of(false)), S && E.push(EditorState.readOnly.of(true)), [...E];
2698
2665
  }, getStatistics = (e6) => ({
2699
2666
  line: e6.state.doc.lineAt(e6.state.selection.main.from),
2700
2667
  lineCount: e6.state.doc.lines,
@@ -2706,11 +2673,11 @@ var basicSetup = function(e6) {
2706
2673
  selectionAsSingle: e6.state.selection.asSingle().main,
2707
2674
  ranges: e6.state.selection.ranges,
2708
2675
  selectionCode: e6.state.sliceDoc(e6.state.selection.main.from, e6.state.selection.main.to),
2709
- selections: e6.state.selection.ranges.map((y) => e6.state.sliceDoc(y.from, y.to)),
2676
+ selections: e6.state.selection.ranges.map((b) => e6.state.sliceDoc(b.from, b.to)),
2710
2677
  selectedText: e6.state.selection.ranges.some((e7) => !e7.empty)
2711
2678
  }), TimeoutLatch = class {
2712
- constructor(e6, y) {
2713
- this.timeLeftMS = void 0, this.timeoutMS = void 0, this.isCancelled = false, this.isTimeExhausted = false, this.callbacks = [], this.timeLeftMS = y, this.timeoutMS = y, this.callbacks.push(e6);
2679
+ constructor(e6, b) {
2680
+ this.timeLeftMS = void 0, this.timeoutMS = void 0, this.isCancelled = false, this.isTimeExhausted = false, this.callbacks = [], this.timeLeftMS = b, this.timeoutMS = b, this.callbacks.push(e6);
2714
2681
  }
2715
2682
  tick() {
2716
2683
  if (!this.isCancelled && !this.isTimeExhausted && (this.timeLeftMS--, this.timeLeftMS <= 0)) {
@@ -2756,67 +2723,66 @@ var basicSetup = function(e6) {
2756
2723
  }
2757
2724
  }, globalScheduler = null, getScheduler = () => typeof window > "u" ? new Scheduler() : (globalScheduler || (globalScheduler = new Scheduler()), globalScheduler), ExternalChange = Annotation.define(), TYPING_TIMOUT = 200, emptyExtensions = [];
2758
2725
  function useCodeMirror(e6) {
2759
- var { value: y, selection: b, onChange: x, onStatistics: S, onCreateEditor: C, onUpdate: w, extensions: T = emptyExtensions, autoFocus: E, theme: D = "light", height: O = null, minHeight: k = null, maxHeight: A = null, width: j = null, minWidth: M = null, maxWidth: N = null, placeholder: P = "", editable: F = true, readOnly: I = false, indentWithTab: L = true, basicSetup: R = true, root: B, initialState: V } = e6, [H, U] = (0, import_react.useState)(), [W, G] = (0, import_react.useState)(), [K, J] = (0, import_react.useState)(), Y = (0, import_react.useState)(() => ({ current: null }))[0], Z = (0, import_react.useState)(() => ({ current: null }))[0], Q = EditorView.theme({
2726
+ var { value: b, selection: x, onChange: S, onStatistics: C, onCreateEditor: w, onUpdate: T, extensions: E = emptyExtensions, autoFocus: D, theme: O = "light", height: k = null, minHeight: A = null, maxHeight: j = null, width: M = null, minWidth: N = null, maxWidth: P = null, placeholder: F = "", editable: I = true, readOnly: L = false, indentWithTab: z = true, basicSetup: B = true, root: V, initialState: H } = e6, [U, W] = (0, import_react.useState)(), [G, K] = (0, import_react.useState)(), [J, Y] = (0, import_react.useState)(), X = (0, import_react.useState)(() => ({ current: null }))[0], Z = (0, import_react.useState)(() => ({ current: null }))[0], Q = EditorView.theme({
2760
2727
  "&": {
2761
- height: O,
2762
- minHeight: k,
2763
- maxHeight: A,
2764
- width: j,
2765
- minWidth: M,
2766
- maxWidth: N
2728
+ height: k,
2729
+ minHeight: A,
2730
+ maxHeight: j,
2731
+ width: M,
2732
+ minWidth: N,
2733
+ maxWidth: P
2767
2734
  },
2768
2735
  "& .cm-scroller": { height: "100% !important" }
2769
2736
  }), $ = [
2770
2737
  EditorView.updateListener.of((e7) => {
2771
- e7.docChanged && typeof x == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange)) && (Y.current ? Y.current.reset() : (Y.current = new TimeoutLatch(() => {
2738
+ e7.docChanged && typeof S == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange)) && (X.current ? X.current.reset() : (X.current = new TimeoutLatch(() => {
2772
2739
  if (Z.current) {
2773
2740
  var e8 = Z.current;
2774
2741
  Z.current = null, e8();
2775
2742
  }
2776
- Y.current = null;
2777
- }, TYPING_TIMOUT), getScheduler().add(Y.current)), x(e7.state.doc.toString(), e7)), S && S(getStatistics(e7));
2743
+ X.current = null;
2744
+ }, TYPING_TIMOUT), getScheduler().add(X.current)), S(e7.state.doc.toString(), e7)), C && C(getStatistics(e7));
2778
2745
  }),
2779
2746
  Q,
2780
2747
  ...getDefaultExtensions({
2781
- theme: D,
2782
- editable: F,
2783
- readOnly: I,
2784
- placeholder: P,
2785
- indentWithTab: L,
2786
- basicSetup: R
2748
+ theme: O,
2749
+ editable: I,
2750
+ readOnly: L,
2751
+ placeholder: F,
2752
+ indentWithTab: z,
2753
+ basicSetup: B
2787
2754
  })
2788
2755
  ];
2789
- return w && typeof w == "function" && $.push(EditorView.updateListener.of(w)), $ = $.concat(T), (0, import_react.useLayoutEffect)(() => {
2790
- if (H && !K) {
2756
+ return T && typeof T == "function" && $.push(EditorView.updateListener.of(T)), $ = $.concat(E), (0, import_react.useLayoutEffect)(() => {
2757
+ if (U && !J) {
2791
2758
  var e7 = {
2792
- doc: y,
2793
- selection: b,
2759
+ doc: b,
2760
+ selection: x,
2794
2761
  extensions: $
2795
- }, x2 = V ? EditorState.fromJSON(V.json, e7, V.fields) : EditorState.create(e7);
2796
- if (J(x2), !W) {
2797
- var S2 = new EditorView({
2798
- state: x2,
2799
- parent: H,
2800
- root: B
2762
+ }, S2 = H ? EditorState.fromJSON(H.json, e7, H.fields) : EditorState.create(e7);
2763
+ if (Y(S2), !G) {
2764
+ var C2 = new EditorView({
2765
+ state: S2,
2766
+ parent: U,
2767
+ root: V
2801
2768
  });
2802
- G(S2), C && C(S2, x2);
2769
+ K(C2), w && w(C2, S2);
2803
2770
  }
2804
2771
  }
2805
2772
  return () => {
2806
- W && (J(void 0), G(void 0));
2773
+ G && (Y(void 0), K(void 0));
2807
2774
  };
2808
- }, [H, K]), (0, import_react.useEffect)(() => {
2809
- e6.container && U(e6.container);
2775
+ }, [U, J]), (0, import_react.useEffect)(() => {
2776
+ e6.container && W(e6.container);
2810
2777
  }, [e6.container]), (0, import_react.useEffect)(() => () => {
2811
- W && (W.destroy(), G(void 0)), Y.current && (Y.current = (Y.current.cancel(), null));
2812
- }, [W]), (0, import_react.useEffect)(() => {
2813
- E && W && W.focus();
2814
- }, [E, W]), (0, import_react.useEffect)(() => {
2815
- W && W.dispatch({ effects: StateEffect.reconfigure.of($) });
2778
+ G && (G.destroy(), K(void 0)), X.current && (X.current = (X.current.cancel(), null));
2779
+ }, [G]), (0, import_react.useEffect)(() => {
2780
+ D && G && G.focus();
2781
+ }, [D, G]), (0, import_react.useEffect)(() => {
2782
+ G && G.dispatch({ effects: StateEffect.reconfigure.of($) });
2816
2783
  }, [
2817
- D,
2818
- T,
2819
2784
  O,
2785
+ E,
2820
2786
  k,
2821
2787
  A,
2822
2788
  j,
@@ -2826,33 +2792,34 @@ function useCodeMirror(e6) {
2826
2792
  F,
2827
2793
  I,
2828
2794
  L,
2829
- R,
2830
- x,
2831
- w
2795
+ z,
2796
+ B,
2797
+ S,
2798
+ T
2832
2799
  ]), (0, import_react.useEffect)(() => {
2833
- if (y !== void 0) {
2834
- var e7 = W ? W.state.doc.toString() : "";
2835
- if (W && y !== e7) {
2836
- var b2 = Y.current && !Y.current.isDone, x2 = () => {
2837
- W && y !== W.state.doc.toString() && W.dispatch({
2800
+ if (b !== void 0) {
2801
+ var e7 = G ? G.state.doc.toString() : "";
2802
+ if (G && b !== e7) {
2803
+ var x2 = X.current && !X.current.isDone, S2 = () => {
2804
+ G && b !== G.state.doc.toString() && G.dispatch({
2838
2805
  changes: {
2839
2806
  from: 0,
2840
- to: W.state.doc.toString().length,
2841
- insert: y || ""
2807
+ to: G.state.doc.toString().length,
2808
+ insert: b || ""
2842
2809
  },
2843
2810
  annotations: [ExternalChange.of(true)]
2844
2811
  });
2845
2812
  };
2846
- b2 ? Z.current = x2 : x2();
2813
+ x2 ? Z.current = S2 : S2();
2847
2814
  }
2848
2815
  }
2849
- }, [y, W]), {
2850
- state: K,
2851
- setState: J,
2852
- view: W,
2853
- setView: G,
2854
- container: H,
2855
- setContainer: U
2816
+ }, [b, G]), {
2817
+ state: J,
2818
+ setState: Y,
2819
+ view: G,
2820
+ setView: K,
2821
+ container: U,
2822
+ setContainer: W
2856
2823
  };
2857
2824
  }
2858
2825
  var _excluded = [
@@ -2879,80 +2846,80 @@ var _excluded = [
2879
2846
  "readOnly",
2880
2847
  "root",
2881
2848
  "initialState"
2882
- ], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6, y) => {
2883
- var { className: b, value: x = "", selection: S, extensions: C = [], onChange: w, onStatistics: T, onCreateEditor: E, onUpdate: D, autoFocus: O, theme: k = "light", height: A, minHeight: j, maxHeight: M, width: N, minWidth: P, maxWidth: F, basicSetup: I, placeholder: L, indentWithTab: R, editable: z, readOnly: B, root: V, initialState: H } = e6, U = _objectWithoutPropertiesLoose(e6, _excluded), W = (0, import_react.useRef)(null), { state: G, view: K, container: J, setContainer: Y } = useCodeMirror({
2884
- root: V,
2885
- value: x,
2886
- autoFocus: O,
2887
- theme: k,
2888
- height: A,
2889
- minHeight: j,
2890
- maxHeight: M,
2891
- width: N,
2892
- minWidth: P,
2893
- maxWidth: F,
2894
- basicSetup: I,
2895
- placeholder: L,
2896
- indentWithTab: R,
2897
- editable: z,
2898
- readOnly: B,
2899
- selection: S,
2900
- onChange: w,
2901
- onStatistics: T,
2902
- onCreateEditor: E,
2903
- onUpdate: D,
2904
- extensions: C,
2905
- initialState: H
2849
+ ], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6, b) => {
2850
+ var { className: x, value: S = "", selection: C, extensions: w = [], onChange: T, onStatistics: E, onCreateEditor: D, onUpdate: O, autoFocus: k, theme: A = "light", height: j, minHeight: M, maxHeight: N, width: P, minWidth: F, maxWidth: I, basicSetup: L, placeholder: R, indentWithTab: z, editable: B, readOnly: V, root: H, initialState: U } = e6, W = _objectWithoutPropertiesLoose(e6, _excluded), G = (0, import_react.useRef)(null), { state: K, view: J, container: Y, setContainer: X } = useCodeMirror({
2851
+ root: H,
2852
+ value: S,
2853
+ autoFocus: k,
2854
+ theme: A,
2855
+ height: j,
2856
+ minHeight: M,
2857
+ maxHeight: N,
2858
+ width: P,
2859
+ minWidth: F,
2860
+ maxWidth: I,
2861
+ basicSetup: L,
2862
+ placeholder: R,
2863
+ indentWithTab: z,
2864
+ editable: B,
2865
+ readOnly: V,
2866
+ selection: C,
2867
+ onChange: T,
2868
+ onStatistics: E,
2869
+ onCreateEditor: D,
2870
+ onUpdate: O,
2871
+ extensions: w,
2872
+ initialState: U
2906
2873
  });
2907
- (0, import_react.useImperativeHandle)(y, () => ({
2908
- editor: W.current,
2909
- state: G,
2910
- view: K
2874
+ (0, import_react.useImperativeHandle)(b, () => ({
2875
+ editor: G.current,
2876
+ state: K,
2877
+ view: J
2911
2878
  }), [
2912
- W,
2913
- J,
2914
2879
  G,
2915
- K
2880
+ Y,
2881
+ K,
2882
+ J
2916
2883
  ]);
2917
- var X = (0, import_react.useCallback)((e7) => {
2918
- W.current = e7, Y(e7);
2919
- }, [Y]);
2920
- if (typeof x != "string") throw Error("value must be typeof string but got " + typeof x);
2884
+ var Z = (0, import_react.useCallback)((e7) => {
2885
+ G.current = e7, X(e7);
2886
+ }, [X]);
2887
+ if (typeof S != "string") throw Error("value must be typeof string but got " + typeof S);
2921
2888
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", _extends({
2922
- ref: X,
2923
- className: (typeof k == "string" ? "cm-theme-" + k : "cm-theme") + (b ? " " + b : "")
2924
- }, U));
2889
+ ref: Z,
2890
+ className: (typeof A == "string" ? "cm-theme-" + A : "cm-theme") + (x ? " " + x : "")
2891
+ }, W));
2925
2892
  });
2926
2893
  ReactCodeMirror.displayName = "CodeMirror";
2927
2894
  var esm_default = ReactCodeMirror, strContent = 63, strDollarBrace = 64, strEnd = 65, escapeSequence = 66, indStrContent = 67, indStrDollarBrace = 68, indStrEnd = 69, indEscapeSequence = 70, quote = 34, backslack = 92, braceL = 123, dollar = 36, apostrophe = 39, scanString = /* @__PURE__ */ new ExternalTokenizer((e6) => {
2928
- for (let y = false, b = 0; ; b++) {
2929
- let { next: x } = e6;
2930
- if (x < 0) {
2931
- b > 0 && e6.acceptToken(strContent);
2895
+ for (let b = false, x = 0; ; x++) {
2896
+ let { next: S } = e6;
2897
+ if (S < 0) {
2898
+ x > 0 && e6.acceptToken(strContent);
2932
2899
  break;
2933
- } else if (x === quote) {
2934
- b > 0 ? e6.acceptToken(strContent) : e6.acceptToken(strEnd, 1);
2900
+ } else if (S === quote) {
2901
+ x > 0 ? e6.acceptToken(strContent) : e6.acceptToken(strEnd, 1);
2935
2902
  break;
2936
- } else if (x === braceL && y) {
2937
- b == 1 ? e6.acceptToken(strDollarBrace, 1) : e6.acceptToken(strContent, -1);
2903
+ } else if (S === braceL && b) {
2904
+ x == 1 ? e6.acceptToken(strDollarBrace, 1) : e6.acceptToken(strContent, -1);
2938
2905
  break;
2939
- } else x === backslack && (e6.advance(), e6.acceptToken(escapeSequence, 1));
2940
- y = x === dollar, e6.advance();
2906
+ } else S === backslack && (e6.advance(), e6.acceptToken(escapeSequence, 1));
2907
+ b = S === dollar, e6.advance();
2941
2908
  }
2942
2909
  }), scanIndString = /* @__PURE__ */ new ExternalTokenizer((e6) => {
2943
- for (let y = false, b = false, x = 0; ; x++) {
2944
- let { next: S } = e6;
2945
- if (S < 0) {
2946
- x > 0 && e6.acceptToken(indStrContent);
2910
+ for (let b = false, x = false, S = 0; ; S++) {
2911
+ let { next: C } = e6;
2912
+ if (C < 0) {
2913
+ S > 0 && e6.acceptToken(indStrContent);
2947
2914
  break;
2948
- } else if (S === apostrophe && b) {
2949
- x > 1 ? e6.acceptToken(indStrContent, -1) : e6.acceptToken(indStrEnd, 1);
2915
+ } else if (C === apostrophe && x) {
2916
+ S > 1 ? e6.acceptToken(indStrContent, -1) : e6.acceptToken(indStrEnd, 1);
2950
2917
  break;
2951
- } else if (S === braceL && y) {
2952
- x == 1 ? e6.acceptToken(indStrDollarBrace, 1) : e6.acceptToken(indStrContent, -1);
2918
+ } else if (C === braceL && b) {
2919
+ S == 1 ? e6.acceptToken(indStrDollarBrace, 1) : e6.acceptToken(indStrContent, -1);
2953
2920
  break;
2954
- } else S === backslack && (e6.advance(), e6.acceptToken(indEscapeSequence, 1));
2955
- y = S === dollar, b = S === apostrophe, e6.advance();
2921
+ } else C === backslack && (e6.advance(), e6.acceptToken(indEscapeSequence, 1));
2922
+ b = C === dollar, x = C === apostrophe, e6.advance();
2956
2923
  }
2957
2924
  }), spec_Identifier = {
2958
2925
  __proto__: null,
@@ -3027,10 +2994,10 @@ var esm_default = ReactCodeMirror, strContent = 63, strDollarBrace = 64, strEnd
3027
2994
  AttrSet: foldInside,
3028
2995
  List: foldInside,
3029
2996
  Let(e6) {
3030
- let y = e6.getChild("let"), b = e6.getChild("in");
3031
- return !y || !b ? null : {
3032
- from: y.to,
3033
- to: b.from
2997
+ let b = e6.getChild("let"), x = e6.getChild("in");
2998
+ return !b || !x ? null : {
2999
+ from: b.to,
3000
+ to: x.from
3034
3001
  };
3035
3002
  }
3036
3003
  }),
@@ -3198,19 +3165,19 @@ function isSpace(e6) {
3198
3165
  return e6 == 9 || e6 == 10 || e6 == 13 || e6 == 32;
3199
3166
  }
3200
3167
  var cachedName = null, cachedInput = null, cachedPos = 0;
3201
- function tagNameAfter(e6, y) {
3202
- let b = e6.pos + y;
3203
- if (cachedPos == b && cachedInput == e6) return cachedName;
3204
- let x = e6.peek(y);
3205
- for (; isSpace(x); ) x = e6.peek(++y);
3206
- let S = "";
3207
- for (; nameChar(x); ) S += String.fromCharCode(x), x = e6.peek(++y);
3208
- return cachedInput = e6, cachedPos = b, cachedName = S ? S.toLowerCase() : x == question || x == bang ? void 0 : null;
3168
+ function tagNameAfter(e6, b) {
3169
+ let x = e6.pos + b;
3170
+ if (cachedPos == x && cachedInput == e6) return cachedName;
3171
+ let S = e6.peek(b);
3172
+ for (; isSpace(S); ) S = e6.peek(++b);
3173
+ let C = "";
3174
+ for (; nameChar(S); ) C += String.fromCharCode(S), S = e6.peek(++b);
3175
+ return cachedInput = e6, cachedPos = x, cachedName = C ? C.toLowerCase() : S == question || S == bang ? void 0 : null;
3209
3176
  }
3210
3177
  var lessThan = 60, greaterThan$1 = 62, slash$1 = 47, question = 63, bang = 33;
3211
- function ElementContext(e6, y) {
3212
- this.name = e6, this.parent = y, this.hash = y ? y.hash : 0;
3213
- for (let y2 = 0; y2 < e6.length; y2++) this.hash += (this.hash << 4) + e6.charCodeAt(y2) + (e6.charCodeAt(y2) << 8);
3178
+ function ElementContext(e6, b) {
3179
+ this.name = e6, this.parent = b, this.hash = b ? b.hash : 0;
3180
+ for (let b2 = 0; b2 < e6.length; b2++) this.hash += (this.hash << 4) + e6.charCodeAt(b2) + (e6.charCodeAt(b2) << 8);
3214
3181
  }
3215
3182
  var startTagTerms = [
3216
3183
  StartTag,
@@ -3220,63 +3187,63 @@ var startTagTerms = [
3220
3187
  StartTextareaTag
3221
3188
  ], elementContext = /* @__PURE__ */ new ContextTracker({
3222
3189
  start: null,
3223
- shift(e6, y, b, x) {
3224
- return startTagTerms.indexOf(y) > -1 ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
3190
+ shift(e6, b, x, S) {
3191
+ return startTagTerms.indexOf(b) > -1 ? new ElementContext(tagNameAfter(S, 1) || "", e6) : e6;
3225
3192
  },
3226
- reduce(e6, y) {
3227
- return y == Element && e6 ? e6.parent : e6;
3193
+ reduce(e6, b) {
3194
+ return b == Element && e6 ? e6.parent : e6;
3228
3195
  },
3229
- reuse(e6, y, b, x) {
3230
- let S = y.type.id;
3231
- return S == StartTag || S == OpenTag ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
3196
+ reuse(e6, b, x, S) {
3197
+ let C = b.type.id;
3198
+ return C == StartTag || C == OpenTag ? new ElementContext(tagNameAfter(S, 1) || "", e6) : e6;
3232
3199
  },
3233
3200
  hash(e6) {
3234
3201
  return e6 ? e6.hash : 0;
3235
3202
  },
3236
3203
  strict: false
3237
- }), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6, y) => {
3204
+ }), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6, b) => {
3238
3205
  if (e6.next != lessThan) {
3239
- e6.next < 0 && y.context && e6.acceptToken(missingCloseTag);
3206
+ e6.next < 0 && b.context && e6.acceptToken(missingCloseTag);
3240
3207
  return;
3241
3208
  }
3242
3209
  e6.advance();
3243
- let b = e6.next == slash$1;
3244
- b && e6.advance();
3245
- let x = tagNameAfter(e6, 0);
3246
- if (x === void 0) return;
3247
- if (!x) return e6.acceptToken(b ? IncompleteCloseTag : StartTag);
3248
- let S = y.context ? y.context.name : null;
3249
- if (b) {
3250
- if (x == S) return e6.acceptToken(StartCloseTag);
3251
- if (S && implicitlyClosed[S]) return e6.acceptToken(missingCloseTag, -2);
3252
- for (let e7 = y.context; e7; e7 = e7.parent) if (e7.name == x) return;
3210
+ let x = e6.next == slash$1;
3211
+ x && e6.advance();
3212
+ let S = tagNameAfter(e6, 0);
3213
+ if (S === void 0) return;
3214
+ if (!S) return e6.acceptToken(x ? IncompleteCloseTag : StartTag);
3215
+ let C = b.context ? b.context.name : null;
3216
+ if (x) {
3217
+ if (S == C) return e6.acceptToken(StartCloseTag);
3218
+ if (C && implicitlyClosed[C]) return e6.acceptToken(missingCloseTag, -2);
3219
+ for (let e7 = b.context; e7; e7 = e7.parent) if (e7.name == S) return;
3253
3220
  e6.acceptToken(MismatchedStartCloseTag);
3254
3221
  } else {
3255
- if (x == "script") return e6.acceptToken(StartScriptTag);
3256
- if (x == "style") return e6.acceptToken(StartStyleTag);
3257
- if (x == "textarea") return e6.acceptToken(StartTextareaTag);
3258
- if (selfClosers.hasOwnProperty(x)) return e6.acceptToken(StartSelfClosingTag);
3259
- S && closeOnOpen[S] && closeOnOpen[S][x] ? e6.acceptToken(missingCloseTag, -1) : e6.acceptToken(StartTag);
3222
+ if (S == "script") return e6.acceptToken(StartScriptTag);
3223
+ if (S == "style") return e6.acceptToken(StartStyleTag);
3224
+ if (S == "textarea") return e6.acceptToken(StartTextareaTag);
3225
+ if (selfClosers.hasOwnProperty(S)) return e6.acceptToken(StartSelfClosingTag);
3226
+ C && closeOnOpen[C] && closeOnOpen[C][S] ? e6.acceptToken(missingCloseTag, -1) : e6.acceptToken(StartTag);
3260
3227
  }
3261
3228
  }, { contextual: true });
3262
- function contentTokenizer(e6, y, b) {
3263
- let x = 2 + e6.length;
3264
- return new ExternalTokenizer((S) => {
3265
- for (let C = 0, w = 0, T = 0; ; T++) {
3266
- if (S.next < 0) {
3267
- T && S.acceptToken(y);
3229
+ function contentTokenizer(e6, b, x) {
3230
+ let S = 2 + e6.length;
3231
+ return new ExternalTokenizer((C) => {
3232
+ for (let w = 0, T = 0, E = 0; ; E++) {
3233
+ if (C.next < 0) {
3234
+ E && C.acceptToken(b);
3268
3235
  break;
3269
3236
  }
3270
- if (C == 0 && S.next == lessThan || C == 1 && S.next == slash$1 || C >= 2 && C < x && S.next == e6.charCodeAt(C - 2)) C++, w++;
3271
- else if ((C == 2 || C == x) && isSpace(S.next)) w++;
3272
- else if (C == x && S.next == greaterThan$1) {
3273
- T > w ? S.acceptToken(y, -w) : S.acceptToken(b, -(w - 2));
3237
+ if (w == 0 && C.next == lessThan || w == 1 && C.next == slash$1 || w >= 2 && w < S && C.next == e6.charCodeAt(w - 2)) w++, T++;
3238
+ else if ((w == 2 || w == S) && isSpace(C.next)) T++;
3239
+ else if (w == S && C.next == greaterThan$1) {
3240
+ E > T ? C.acceptToken(b, -T) : C.acceptToken(x, -(T - 2));
3274
3241
  break;
3275
- } else if ((S.next == 10 || S.next == 13) && T) {
3276
- S.acceptToken(y, 1);
3242
+ } else if ((C.next == 10 || C.next == 13) && E) {
3243
+ C.acceptToken(b, 1);
3277
3244
  break;
3278
- } else C = w = 0;
3279
- S.advance();
3245
+ } else w = T = 0;
3246
+ C.advance();
3280
3247
  }
3281
3248
  });
3282
3249
  }
@@ -3312,108 +3279,108 @@ var scriptTokens = /* @__PURE__ */ contentTokenizer("script", scriptText, StartC
3312
3279
  at,
3313
3280
  slash
3314
3281
  ], commentContent = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3315
- for (let y = 0, b = 0; ; b++) {
3282
+ for (let b = 0, x = 0; ; x++) {
3316
3283
  if (e6.next < 0) {
3317
- b && e6.acceptToken(commentContent$1);
3284
+ x && e6.acceptToken(commentContent$1);
3318
3285
  break;
3319
3286
  }
3320
- if (e6.next == dash) y++;
3321
- else if (e6.next == greaterThan && y >= 2) {
3322
- b > 3 && e6.acceptToken(commentContent$1, -2);
3287
+ if (e6.next == dash) b++;
3288
+ else if (e6.next == greaterThan && b >= 2) {
3289
+ x > 3 && e6.acceptToken(commentContent$1, -2);
3323
3290
  break;
3324
- } else y = 0;
3291
+ } else b = 0;
3325
3292
  e6.advance();
3326
3293
  }
3327
3294
  });
3328
3295
  function createStringHandler(e6) {
3329
- let y = false, b = null, x = false;
3330
- return () => y ? x ? (x = false, true) : e6.next === backslash ? (x = true, true) : b === "double" && e6.next === quoteDouble || b === "single" && e6.next === quoteSingle || b === "template" && e6.next === tick ? (y = false, b = null, true) : true : e6.next === quoteDouble ? (y = true, b = "double", true) : e6.next === quoteSingle ? (y = true, b = "single", true) : e6.next === tick ? (y = true, b = "template", true) : false;
3296
+ let b = false, x = null, S = false;
3297
+ return () => b ? S ? (S = false, true) : e6.next === backslash ? (S = true, true) : x === "double" && e6.next === quoteDouble || x === "single" && e6.next === quoteSingle || x === "template" && e6.next === tick ? (b = false, x = null, true) : true : e6.next === quoteDouble ? (b = true, x = "double", true) : e6.next === quoteSingle ? (b = true, x = "single", true) : e6.next === tick ? (b = true, x = "template", true) : false;
3331
3298
  }
3332
3299
  function createCommentHandler(e6) {
3333
- let y = false, b = false;
3334
- return () => y ? (e6.next === newline && (y = false), true) : b ? (e6.next === asterisk && e6.peek(1) === slash && (b = false), true) : e6.next === slash && e6.peek(1) === slash ? (y = true, true) : e6.next === slash && e6.peek(1) === asterisk ? (b = true, true) : false;
3300
+ let b = false, x = false;
3301
+ return () => b ? (e6.next === newline && (b = false), true) : x ? (e6.next === asterisk && e6.peek(1) === slash && (x = false), true) : e6.next === slash && e6.peek(1) === slash ? (b = true, true) : e6.next === slash && e6.peek(1) === asterisk ? (x = true, true) : false;
3335
3302
  }
3336
3303
  var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3337
3304
  if (prefixes.includes(e6.next)) return;
3338
- let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
3339
- let y2 = x.lastIndexOf(e7);
3340
- if (y2 !== -1) for (; x.length > y2; ) x.pop();
3305
+ let b = createCommentHandler(e6), x = createStringHandler(e6), S = [], C = (e7) => {
3306
+ let b2 = S.lastIndexOf(e7);
3307
+ if (b2 !== -1) for (; S.length > b2; ) S.pop();
3341
3308
  };
3342
- for (let C = 0; ; C++) {
3309
+ for (let w = 0; ; w++) {
3343
3310
  if (e6.next < 0) {
3344
- C > 0 && e6.acceptToken(LongExpression);
3311
+ w > 0 && e6.acceptToken(LongExpression);
3345
3312
  break;
3346
3313
  }
3347
- if (y() || b()) {
3314
+ if (b() || x()) {
3348
3315
  e6.advance();
3349
3316
  continue;
3350
3317
  }
3351
- if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose)) {
3318
+ if (S.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose)) {
3352
3319
  e6.acceptToken(LongExpression);
3353
3320
  break;
3354
3321
  }
3355
3322
  switch (e6.next) {
3356
3323
  case parenOpen:
3357
- x.push("(");
3324
+ S.push("(");
3358
3325
  break;
3359
3326
  case parenClose:
3360
- S("(");
3327
+ C("(");
3361
3328
  break;
3362
3329
  case squareOpen:
3363
- x.push("[");
3330
+ S.push("[");
3364
3331
  break;
3365
3332
  case squareClose:
3366
- S("[");
3333
+ C("[");
3367
3334
  break;
3368
3335
  case curlyOpen:
3369
- x.push("{");
3336
+ S.push("{");
3370
3337
  break;
3371
3338
  case curlyClose:
3372
- S("{");
3339
+ C("{");
3373
3340
  break;
3374
3341
  }
3375
3342
  e6.advance();
3376
3343
  }
3377
3344
  }), shortExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3378
3345
  if (prefixes.includes(e6.peek(0))) return;
3379
- let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
3380
- let y2 = x.lastIndexOf(e7);
3381
- if (y2 !== -1) for (; x.length > y2; ) x.pop();
3346
+ let b = createCommentHandler(e6), x = createStringHandler(e6), S = [], C = (e7) => {
3347
+ let b2 = S.lastIndexOf(e7);
3348
+ if (b2 !== -1) for (; S.length > b2; ) S.pop();
3382
3349
  };
3383
- for (let C = 0; ; C++) {
3350
+ for (let w = 0; ; w++) {
3384
3351
  if (e6.next < 0) {
3385
- C > 0 && e6.acceptToken(ShortExpression);
3352
+ w > 0 && e6.acceptToken(ShortExpression);
3386
3353
  break;
3387
3354
  }
3388
- if (y() || b()) {
3355
+ if (b() || x()) {
3389
3356
  e6.advance();
3390
3357
  continue;
3391
3358
  }
3392
- if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose || e6.next === comma)) {
3359
+ if (S.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose || e6.next === comma)) {
3393
3360
  e6.acceptToken(ShortExpression);
3394
3361
  break;
3395
3362
  }
3396
3363
  switch (e6.next) {
3397
3364
  case parenOpen:
3398
- x.push("(");
3365
+ S.push("(");
3399
3366
  break;
3400
3367
  case parenClose:
3401
- S("(");
3368
+ C("(");
3402
3369
  break;
3403
3370
  case squareOpen:
3404
- x.push("[");
3371
+ S.push("[");
3405
3372
  break;
3406
3373
  case squareClose:
3407
- S("[");
3374
+ C("[");
3408
3375
  break;
3409
3376
  case curlyOpen:
3410
- x.push("{");
3377
+ S.push("{");
3411
3378
  break;
3412
3379
  case curlyClose:
3413
- S("{");
3380
+ C("{");
3414
3381
  break;
3415
3382
  }
3416
- if (C !== 0 && x.length === 0 && space.includes(e6.next)) {
3383
+ if (w !== 0 && S.length === 0 && space.includes(e6.next)) {
3417
3384
  e6.acceptToken(ShortExpression);
3418
3385
  break;
3419
3386
  }
@@ -3689,30 +3656,30 @@ var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3689
3656
  ],
3690
3657
  tokenPrec: 1571
3691
3658
  });
3692
- function getAttrs(e6, y) {
3693
- let b = /* @__PURE__ */ Object.create(null);
3694
- for (let x of e6.firstChild.getChildren("Attribute")) {
3695
- let e7 = x.getChild("AttributeName"), S = x.getChild("AttributeValue") || x.getChild("UnquotedAttributeValue");
3696
- e7 && (b[y.read(e7.from, e7.to)] = S ? S.name == "AttributeValue" ? y.read(S.from + 1, S.to - 1) : y.read(S.from, S.to) : "");
3659
+ function getAttrs(e6, b) {
3660
+ let x = /* @__PURE__ */ Object.create(null);
3661
+ for (let S of e6.firstChild.getChildren("Attribute")) {
3662
+ let e7 = S.getChild("AttributeName"), C = S.getChild("AttributeValue") || S.getChild("UnquotedAttributeValue");
3663
+ e7 && (x[b.read(e7.from, e7.to)] = C ? C.name == "AttributeValue" ? b.read(C.from + 1, C.to - 1) : b.read(C.from, C.to) : "");
3697
3664
  }
3698
- return b;
3665
+ return x;
3699
3666
  }
3700
- function maybeNest(e6, y, b) {
3701
- let x;
3702
- for (let S of b) if (!S.attrs || S.attrs(x || (x = getAttrs(e6.node.parent, y)))) return { parser: S.parser };
3667
+ function maybeNest(e6, b, x) {
3668
+ let S;
3669
+ for (let C of x) if (!C.attrs || C.attrs(S || (S = getAttrs(e6.node.parent, b)))) return { parser: C.parser };
3703
3670
  return null;
3704
3671
  }
3705
3672
  var expressionParser = /* @__PURE__ */ parser$1.configure({ top: "SingleExpression" });
3706
3673
  function configureNesting(e6) {
3707
- let y = [], b = [], x = [];
3708
- for (let S of e6) {
3709
- let e7 = S.tag == "script" ? y : S.tag == "style" ? b : S.tag == "textarea" ? x : null;
3674
+ let b = [], x = [], S = [];
3675
+ for (let C of e6) {
3676
+ let e7 = C.tag == "script" ? b : C.tag == "style" ? x : C.tag == "textarea" ? S : null;
3710
3677
  if (!e7) throw RangeError("Only script, style, and textarea tags can host nested parsers");
3711
- e7.push(S);
3678
+ e7.push(C);
3712
3679
  }
3713
- return parseMixed((e7, S) => {
3714
- let C = e7.type.id;
3715
- return C === LongExpression || C === ShortExpression ? { parser: expressionParser } : C === ScriptText ? maybeNest(e7, S, y) : C === StyleText ? maybeNest(e7, S, b) : C === TextareaText ? maybeNest(e7, S, x) : null;
3680
+ return parseMixed((e7, C) => {
3681
+ let w = e7.type.id;
3682
+ return w === LongExpression || w === ShortExpression ? { parser: expressionParser } : w === ScriptText ? maybeNest(e7, C, b) : w === StyleText ? maybeNest(e7, C, x) : w === TextareaText ? maybeNest(e7, C, S) : null;
3716
3683
  });
3717
3684
  }
3718
3685
  var defaultNesting = [
@@ -3740,46 +3707,46 @@ var defaultNesting = [
3740
3707
  wrap: /* @__PURE__ */ configureNesting(defaultNesting),
3741
3708
  props: [/* @__PURE__ */ indentNodeProp.add({
3742
3709
  Element: (e6) => {
3743
- let y = /^(\s*)(<\/)?/.exec(e6.textAfter);
3744
- return e6.node.to <= e6.pos + y[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (y[2] ? 0 : e6.unit);
3710
+ let b = /^(\s*)(<\/)?/.exec(e6.textAfter);
3711
+ return e6.node.to <= e6.pos + b[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (b[2] ? 0 : e6.unit);
3745
3712
  },
3746
3713
  Block: (e6) => {
3747
- let y = e6.node, b = e6.textAfter.trim();
3748
- if (b.startsWith("{/")) {
3749
- let x2 = y.name;
3750
- return x2 === "IfBlock" && b.startsWith("{/if") || x2 === "EachBlock" && b.startsWith("{/each") || x2 === "AwaitBlock" && b.startsWith("{/await") || x2 === "KeyBlock" && b.startsWith("{/key") ? e6.lineIndent(e6.node.from) : null;
3714
+ let b = e6.node, x = e6.textAfter.trim();
3715
+ if (x.startsWith("{/")) {
3716
+ let S2 = b.name;
3717
+ return S2 === "IfBlock" && x.startsWith("{/if") || S2 === "EachBlock" && x.startsWith("{/each") || S2 === "AwaitBlock" && x.startsWith("{/await") || S2 === "KeyBlock" && x.startsWith("{/key") ? e6.lineIndent(e6.node.from) : null;
3751
3718
  }
3752
- if (y.name === "IfBlock" || y.name === "EachBlock") {
3753
- if (b.startsWith("{:else")) return e6.lineIndent(y.from);
3754
- } else if (y.name === "AwaitBlock" && (b.startsWith("{:then") || b.startsWith("{:catch"))) return e6.lineIndent(y.from);
3755
- let x = /^(\s*)(<\/)?/.exec(e6.textAfter);
3756
- return e6.node.to <= e6.pos + x[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (x[2] ? 0 : e6.unit);
3719
+ if (b.name === "IfBlock" || b.name === "EachBlock") {
3720
+ if (x.startsWith("{:else")) return e6.lineIndent(b.from);
3721
+ } else if (b.name === "AwaitBlock" && (x.startsWith("{:then") || x.startsWith("{:catch"))) return e6.lineIndent(b.from);
3722
+ let S = /^(\s*)(<\/)?/.exec(e6.textAfter);
3723
+ return e6.node.to <= e6.pos + S[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (S[2] ? 0 : e6.unit);
3757
3724
  },
3758
3725
  "BlockOpen BlockClose BlockInline": (e6) => e6.column(e6.node.from) + e6.unit,
3759
3726
  "OpenTag CloseTag SelfClosingTag": (e6) => e6.column(e6.node.from) + e6.unit,
3760
3727
  Document: (e6) => {
3761
3728
  if (e6.pos + /\s*/.exec(e6.textAfter)[0].length < e6.node.to) return e6.continue();
3762
- let y = null, b;
3763
- for (let b2 = e6.node; ; ) {
3764
- let e7 = b2.lastChild;
3765
- if (!e7 || e7.name != "Element" || e7.to != b2.to) break;
3766
- y = b2 = e7;
3729
+ let b = null, x;
3730
+ for (let x2 = e6.node; ; ) {
3731
+ let e7 = x2.lastChild;
3732
+ if (!e7 || e7.name != "Element" || e7.to != x2.to) break;
3733
+ b = x2 = e7;
3767
3734
  }
3768
- return y && !((b = y.lastChild) && (b.name === "CloseTag" || b.name === "SelfClosingTag")) ? e6.lineIndent(y.from) + e6.unit : null;
3735
+ return b && !((x = b.lastChild) && (x.name === "CloseTag" || x.name === "SelfClosingTag")) ? e6.lineIndent(b.from) + e6.unit : null;
3769
3736
  }
3770
3737
  }), /* @__PURE__ */ foldNodeProp.add({
3771
3738
  Block: (e6) => {
3772
- let y = `${e6.name}Open`, b = `${e6.name}Close`, x = e6.firstChild, S = e6.lastChild;
3773
- return !x || x.name !== y ? null : {
3774
- from: x.to,
3775
- to: (S == null ? void 0 : S.name) === b ? S.from : e6.to
3739
+ let b = `${e6.name}Open`, x = `${e6.name}Close`, S = e6.firstChild, C = e6.lastChild;
3740
+ return !S || S.name !== b ? null : {
3741
+ from: S.to,
3742
+ to: (C == null ? void 0 : C.name) === x ? C.from : e6.to
3776
3743
  };
3777
3744
  },
3778
3745
  Element: (e6) => {
3779
- let y = e6.firstChild, b = e6.lastChild;
3780
- return !y || y.name != "OpenTag" ? null : {
3781
- from: y.to,
3782
- to: b.name === "CloseTag" ? b.from : e6.to
3746
+ let b = e6.firstChild, x = e6.lastChild;
3747
+ return !b || b.name != "OpenTag" ? null : {
3748
+ from: b.to,
3749
+ to: x.name === "CloseTag" ? x.from : e6.to
3783
3750
  };
3784
3751
  }
3785
3752
  })]
@@ -3801,43 +3768,43 @@ function svelte() {
3801
3768
  autoCloseTags
3802
3769
  ]);
3803
3770
  }
3804
- function elementName(e6, y, b = e6.length) {
3805
- if (!y) return "";
3806
- let x = y.firstChild, S = x && (x.getChild("TagName") || x.getChild("ComponentName") || x.getChild("SvelteElementName"));
3807
- return S ? e6.sliceString(S.from, Math.min(S.to, b)) : "";
3771
+ function elementName(e6, b, x = e6.length) {
3772
+ if (!b) return "";
3773
+ let S = b.firstChild, C = S && (S.getChild("TagName") || S.getChild("ComponentName") || S.getChild("SvelteElementName"));
3774
+ return C ? e6.sliceString(C.from, Math.min(C.to, x)) : "";
3808
3775
  }
3809
- var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, y, b, x) => {
3810
- if (e6.composing || e6.state.readOnly || y != b || x != ">" && x != "/" || !svelteLanguage.isActiveAt(e6.state, y, -1)) return false;
3811
- let { state: S } = e6, C = S.changeByRange((y2) => {
3776
+ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, b, x, S) => {
3777
+ if (e6.composing || e6.state.readOnly || b != x || S != ">" && S != "/" || !svelteLanguage.isActiveAt(e6.state, b, -1)) return false;
3778
+ let { state: C } = e6, w = C.changeByRange((b2) => {
3812
3779
  var _a, _b, _c;
3813
- let { head: b2 } = y2, C2 = syntaxTree(S).resolveInner(b2, -1), w;
3814
- if ((C2.name === "TagName" || C2.name === "ComponentName" || C2.name === "SvelteElementName" || C2.name === "StartTag") && (C2 = C2.parent), x === ">" && C2.name === "OpenTag") {
3815
- if (((_b = (_a = C2.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (w = elementName(S.doc, C2.parent, b2))) {
3816
- let y3 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x2 = `${y3 ? "" : ">"}</${w}>`;
3780
+ let { head: x2 } = b2, w2 = syntaxTree(C).resolveInner(x2, -1), T;
3781
+ if ((w2.name === "TagName" || w2.name === "ComponentName" || w2.name === "SvelteElementName" || w2.name === "StartTag") && (w2 = w2.parent), S === ">" && w2.name === "OpenTag") {
3782
+ if (((_b = (_a = w2.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (T = elementName(C.doc, w2.parent, x2))) {
3783
+ let b3 = e6.state.doc.sliceString(x2, x2 + 1) === ">", S2 = `${b3 ? "" : ">"}</${T}>`;
3817
3784
  return {
3818
- range: EditorSelection.cursor(b2 + 1),
3785
+ range: EditorSelection.cursor(x2 + 1),
3819
3786
  changes: {
3820
- from: b2 + (y3 ? 1 : 0),
3821
- insert: x2
3787
+ from: x2 + (b3 ? 1 : 0),
3788
+ insert: S2
3822
3789
  }
3823
3790
  };
3824
3791
  }
3825
- } else if (x === "/" && C2.name === "OpenTag") {
3826
- let y3 = C2.parent, x2 = y3 == null ? void 0 : y3.parent;
3827
- if (y3.from == b2 - 1 && ((_c = x2.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (w = elementName(S.doc, x2, b2))) {
3828
- let y4 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x3 = `/${w}${y4 ? "" : ">"}`, S2 = b2 + x3.length + (y4 ? 1 : 0);
3792
+ } else if (S === "/" && w2.name === "OpenTag") {
3793
+ let b3 = w2.parent, S2 = b3 == null ? void 0 : b3.parent;
3794
+ if (b3.from == x2 - 1 && ((_c = S2.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (T = elementName(C.doc, S2, x2))) {
3795
+ let b4 = e6.state.doc.sliceString(x2, x2 + 1) === ">", S3 = `/${T}${b4 ? "" : ">"}`, C2 = x2 + S3.length + (b4 ? 1 : 0);
3829
3796
  return {
3830
- range: EditorSelection.cursor(S2),
3797
+ range: EditorSelection.cursor(C2),
3831
3798
  changes: {
3832
- from: b2,
3833
- insert: x3
3799
+ from: x2,
3800
+ insert: S3
3834
3801
  }
3835
3802
  };
3836
3803
  }
3837
3804
  }
3838
- return { range: y2 };
3805
+ return { range: b2 };
3839
3806
  });
3840
- return C.changes.empty ? false : (e6.dispatch(C, {
3807
+ return w.changes.empty ? false : (e6.dispatch(w, {
3841
3808
  userEvent: "input.type",
3842
3809
  scrollIntoView: true
3843
3810
  }), true);
@@ -4005,123 +3972,123 @@ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, y, b, x) =>
4005
3972
  true: true,
4006
3973
  false: true
4007
3974
  }, isOperatorChar = /[+\-*&^%:=<>!|/~]/, isNegativeChar = /[-]/, curPunc;
4008
- function tokenBase(e6, y) {
4009
- let b = e6.next();
4010
- if (b === '"' || b === "'" || b === "`") return y.tokenize = tokenString(b), y.tokenize(e6, y);
4011
- if (isVersion(e6, y)) return "version";
4012
- if (b === "." && keywordsMembersOfAddressType.some(function(y2) {
4013
- return e6.match(`${y2}`);
3975
+ function tokenBase(e6, b) {
3976
+ let x = e6.next();
3977
+ if (x === '"' || x === "'" || x === "`") return b.tokenize = tokenString(x), b.tokenize(e6, b);
3978
+ if (isVersion(e6, b)) return "version";
3979
+ if (x === "." && keywordsMembersOfAddressType.some(function(b2) {
3980
+ return e6.match(`${b2}`);
4014
3981
  })) return "addressFunction";
4015
- if (typeof b == "string" && isNumber(b, e6)) return "number";
4016
- if (typeof b == "string" && /[[\]{}(),;:.]/.test(b)) return updateGarmmer(b, y);
4017
- if (b === "/") {
4018
- if (e6.eat("*")) return y.tokenize = tokenComment, tokenComment(e6, y);
3982
+ if (typeof x == "string" && isNumber(x, e6)) return "number";
3983
+ if (typeof x == "string" && /[[\]{}(),;:.]/.test(x)) return updateGarmmer(x, b);
3984
+ if (x === "/") {
3985
+ if (e6.eat("*")) return b.tokenize = tokenComment, tokenComment(e6, b);
4019
3986
  if (e6.match(/\/{2}/)) {
4020
- for (b = e6.next(); b; ) {
4021
- if (b === "@") {
4022
- e6.backUp(1), y.grammar = "doc";
3987
+ for (x = e6.next(); x; ) {
3988
+ if (x === "@") {
3989
+ e6.backUp(1), b.grammar = "doc";
4023
3990
  break;
4024
3991
  }
4025
- b = e6.next();
3992
+ x = e6.next();
4026
3993
  }
4027
3994
  return "doc";
4028
3995
  }
4029
3996
  if (e6.eat("/")) return e6.skipToEnd(), "comment";
4030
3997
  }
4031
- if (typeof b == "string" && isNegativeChar.test(b)) {
4032
- let y2 = e6.peek();
4033
- return typeof y2 == "string" && isNumber(y2, e6) ? "number" : "operator";
3998
+ if (typeof x == "string" && isNegativeChar.test(x)) {
3999
+ let b2 = e6.peek();
4000
+ return typeof b2 == "string" && isNumber(b2, e6) ? "number" : "operator";
4034
4001
  }
4035
- if (typeof b == "string" && isOperatorChar.test(b)) return e6.eatWhile(isOperatorChar), "operator";
4002
+ if (typeof x == "string" && isOperatorChar.test(x)) return e6.eatWhile(isOperatorChar), "operator";
4036
4003
  e6.eatWhile(/[\w$_\xa1-\uffff]/);
4037
- let x = e6.current();
4038
- return y.grammar === "doc" ? natSpecTags.some(function(e7) {
4039
- return x === `@${e7}`;
4040
- }) ? "docReserve" : "doc" : (x === "solidity" && y.lastToken === "pragma" && (y.lastToken = y.lastToken + " " + x), Object.prototype.propertyIsEnumerable.call(keywords, x) ? ((x === "case" || x === "default") && (curPunc = "case"), Object.prototype.propertyIsEnumerable.call(keywordsSpecial, x) && (y.lastToken = x), "keyword") : Object.prototype.propertyIsEnumerable.call(keywordsEtherUnit, x) ? "etherUnit" : Object.prototype.propertyIsEnumerable.call(keywordsContractRelated, x) ? "contractRelated" : Object.prototype.propertyIsEnumerable.call(keywordsControlStructures, x) || Object.prototype.propertyIsEnumerable.call(keywordsTypeInformation, x) || Object.prototype.propertyIsEnumerable.call(keywordsV0505NewReserve, x) ? "keyword" : Object.prototype.propertyIsEnumerable.call(keywordsValueTypes, x) || Object.prototype.propertyIsEnumerable.call(keywordsTimeUnit, x) || isValidInteger(x) || isValidBytes(x) || isValidFixed(x) ? (y.lastToken += "variable", "keyword") : Object.prototype.propertyIsEnumerable.call(atoms, x) ? "atom" : Object.prototype.propertyIsEnumerable.call(keywordsErrorHandling, x) ? "errorHandling" : Object.prototype.propertyIsEnumerable.call(keywordsMathematicalAndCryptographicFuctions, x) ? "mathematicalAndCryptographic" : Object.prototype.propertyIsEnumerable.call(keywordsMoreBlockAndTransactionProperties, x) || Object.prototype.propertyIsEnumerable.call(keywordsBlockAndTransactionProperties, x) && keywordsBlockAndTransactionProperties[x].some(function(y2) {
4041
- return e6.match(`.${y2}`);
4042
- }) ? "variable-2" : x === "abi" && keywordsAbiEncodeDecodeFunctions[x].some(function(y2) {
4043
- return e6.match(`.${y2}`);
4044
- }) ? "abi" : updateHexLiterals(x, e6) ?? ((y.lastToken === "functionName(" || y.lastToken === "returns(") && Object.prototype.propertyIsEnumerable.call(keywordsContractList, x) ? (y.lastToken += "variable", "variable") : y.lastToken === "function" ? (y.lastToken = "functionName", y.para ?? (y.para = (y.grammar = "function", "")), y.para += "functionName", "functionName") : y.lastToken === "functionName(variable" ? (y.lastToken = "functionName(", "parameterValue") : y.lastToken === "returns(variable" ? (y.lastToken = "returns(", "parameterValue") : (y.lastToken === "address" && x === "payable" && (y.lastToken = "address payable"), (y.lastToken === "contract" || y.lastToken === "struct") && (keywordsContractList[x] = true, y.lastToken = null), y.grammar === "function" ? "parameterValue" : "variable")));
4004
+ let S = e6.current();
4005
+ return b.grammar === "doc" ? natSpecTags.some(function(e7) {
4006
+ return S === `@${e7}`;
4007
+ }) ? "docReserve" : "doc" : (S === "solidity" && b.lastToken === "pragma" && (b.lastToken = b.lastToken + " " + S), Object.prototype.propertyIsEnumerable.call(keywords, S) ? ((S === "case" || S === "default") && (curPunc = "case"), Object.prototype.propertyIsEnumerable.call(keywordsSpecial, S) && (b.lastToken = S), "keyword") : Object.prototype.propertyIsEnumerable.call(keywordsEtherUnit, S) ? "etherUnit" : Object.prototype.propertyIsEnumerable.call(keywordsContractRelated, S) ? "contractRelated" : Object.prototype.propertyIsEnumerable.call(keywordsControlStructures, S) || Object.prototype.propertyIsEnumerable.call(keywordsTypeInformation, S) || Object.prototype.propertyIsEnumerable.call(keywordsV0505NewReserve, S) ? "keyword" : Object.prototype.propertyIsEnumerable.call(keywordsValueTypes, S) || Object.prototype.propertyIsEnumerable.call(keywordsTimeUnit, S) || isValidInteger(S) || isValidBytes(S) || isValidFixed(S) ? (b.lastToken += "variable", "keyword") : Object.prototype.propertyIsEnumerable.call(atoms, S) ? "atom" : Object.prototype.propertyIsEnumerable.call(keywordsErrorHandling, S) ? "errorHandling" : Object.prototype.propertyIsEnumerable.call(keywordsMathematicalAndCryptographicFuctions, S) ? "mathematicalAndCryptographic" : Object.prototype.propertyIsEnumerable.call(keywordsMoreBlockAndTransactionProperties, S) || Object.prototype.propertyIsEnumerable.call(keywordsBlockAndTransactionProperties, S) && keywordsBlockAndTransactionProperties[S].some(function(b2) {
4008
+ return e6.match(`.${b2}`);
4009
+ }) ? "variable-2" : S === "abi" && keywordsAbiEncodeDecodeFunctions[S].some(function(b2) {
4010
+ return e6.match(`.${b2}`);
4011
+ }) ? "abi" : updateHexLiterals(S, e6) ?? ((b.lastToken === "functionName(" || b.lastToken === "returns(") && Object.prototype.propertyIsEnumerable.call(keywordsContractList, S) ? (b.lastToken += "variable", "variable") : b.lastToken === "function" ? (b.lastToken = "functionName", b.para ?? (b.para = (b.grammar = "function", "")), b.para += "functionName", "functionName") : b.lastToken === "functionName(variable" ? (b.lastToken = "functionName(", "parameterValue") : b.lastToken === "returns(variable" ? (b.lastToken = "returns(", "parameterValue") : (b.lastToken === "address" && S === "payable" && (b.lastToken = "address payable"), (b.lastToken === "contract" || b.lastToken === "struct") && (keywordsContractList[S] = true, b.lastToken = null), b.grammar === "function" ? "parameterValue" : "variable")));
4045
4012
  }
4046
4013
  function tokenString(e6) {
4047
- return function(y, b) {
4048
- let x = false, S, C = false;
4049
- for (S = y.next(); S != null; ) {
4050
- if (S === e6 && !x) {
4051
- C = true;
4014
+ return function(b, x) {
4015
+ let S = false, C, w = false;
4016
+ for (C = b.next(); C != null; ) {
4017
+ if (C === e6 && !S) {
4018
+ w = true;
4052
4019
  break;
4053
4020
  }
4054
- x = !x && e6 !== "`" && S === "\\", S = y.next();
4021
+ S = !S && e6 !== "`" && C === "\\", C = b.next();
4055
4022
  }
4056
- return (C || !(x || e6 === "`")) && (b.tokenize = tokenBase), "string";
4023
+ return (w || !(S || e6 === "`")) && (x.tokenize = tokenBase), "string";
4057
4024
  };
4058
4025
  }
4059
- function tokenComment(e6, y) {
4060
- let b = false, x = e6.next();
4061
- for (; x; ) {
4062
- if (x === "/" && b) {
4063
- y.tokenize = tokenBase;
4026
+ function tokenComment(e6, b) {
4027
+ let x = false, S = e6.next();
4028
+ for (; S; ) {
4029
+ if (S === "/" && x) {
4030
+ b.tokenize = tokenBase;
4064
4031
  break;
4065
4032
  }
4066
- b = x === "*", x = e6.next();
4033
+ x = S === "*", S = e6.next();
4067
4034
  }
4068
4035
  return "comment";
4069
4036
  }
4070
- function isVersion(e6, y) {
4071
- if (y.lastToken === "pragma solidity") return y.lastToken = null, !y.startOfLine && (e6.match(/[\^{0}][0-9.]+/) || e6.match(/[>=]+?[\s]*[0-9.]+[\s]*[<]?[\s]*[0-9.]+/));
4037
+ function isVersion(e6, b) {
4038
+ if (b.lastToken === "pragma solidity") return b.lastToken = null, !b.startOfLine && (e6.match(/[\^{0}][0-9.]+/) || e6.match(/[>=]+?[\s]*[0-9.]+[\s]*[<]?[\s]*[0-9.]+/));
4072
4039
  }
4073
- function isNumber(e6, y) {
4074
- if (/[\d.]/.test(e6)) return e6 === "." ? y.match(/^[0-9]+([eE][-+]?[0-9]+)?/) : e6 === "0" ? y.match(/^[xX][0-9a-fA-F]+/) || y.match(/^0[0-7]+/) : y.match(/^[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?/), true;
4040
+ function isNumber(e6, b) {
4041
+ if (/[\d.]/.test(e6)) return e6 === "." ? b.match(/^[0-9]+([eE][-+]?[0-9]+)?/) : e6 === "0" ? b.match(/^[xX][0-9a-fA-F]+/) || b.match(/^0[0-7]+/) : b.match(/^[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?/), true;
4075
4042
  }
4076
4043
  function isValidInteger(e6) {
4077
4044
  if (e6.match(/^[u]?int/)) {
4078
4045
  if (e6.indexOf("t") + 1 === e6.length) return true;
4079
- let y = Number(e6.substr(e6.indexOf("t") + 1, e6.length));
4080
- return y % 8 == 0 && y <= 256;
4046
+ let b = Number(e6.substr(e6.indexOf("t") + 1, e6.length));
4047
+ return b % 8 == 0 && b <= 256;
4081
4048
  }
4082
4049
  }
4083
4050
  function isValidBytes(e6) {
4084
4051
  if (e6.match(/^bytes/)) {
4085
4052
  if (e6.indexOf("s") + 1 === e6.length) return true;
4086
- let y = e6.substr(e6.indexOf("s") + 1, e6.length);
4087
- return Number(y) <= 32;
4053
+ let b = e6.substr(e6.indexOf("s") + 1, e6.length);
4054
+ return Number(b) <= 32;
4088
4055
  }
4089
4056
  }
4090
4057
  function isValidFixed(e6) {
4091
4058
  if (e6.match(/^[u]?fixed([0-9]+x[0-9]+)?/)) {
4092
4059
  if (e6.indexOf("d") + 1 === e6.length) return true;
4093
- let y = e6.substr(e6.indexOf("d") + 1, e6.length).split("x").map(Number);
4094
- return y[0] % 8 == 0 && y[0] <= 256 && y[1] <= 80;
4060
+ let b = e6.substr(e6.indexOf("d") + 1, e6.length).split("x").map(Number);
4061
+ return b[0] % 8 == 0 && b[0] <= 256 && b[1] <= 80;
4095
4062
  }
4096
4063
  }
4097
- function updateHexLiterals(e6, y) {
4098
- if (e6.match(/^hex/) && y.peek() === '"') {
4099
- let e7 = false, b, x = "", S = "";
4100
- for (b = y.next(); b; ) {
4101
- if (S += b, b === '"' && e7) {
4102
- if (x = S.substring(1, S.length - 1), x.match(/^[0-9a-fA-F]+$/)) return "number";
4103
- y.backUp(S.length);
4064
+ function updateHexLiterals(e6, b) {
4065
+ if (e6.match(/^hex/) && b.peek() === '"') {
4066
+ let e7 = false, x, S = "", C = "";
4067
+ for (x = b.next(); x; ) {
4068
+ if (C += x, x === '"' && e7) {
4069
+ if (S = C.substring(1, C.length - 1), S.match(/^[0-9a-fA-F]+$/)) return "number";
4070
+ b.backUp(C.length);
4104
4071
  break;
4105
4072
  }
4106
- e7 || (e7 = b === '"'), b = y.next();
4073
+ e7 || (e7 = x === '"'), x = b.next();
4107
4074
  }
4108
4075
  }
4109
4076
  }
4110
- function updateGarmmer(e6, y) {
4111
- return e6 === "," && y.para === "functionName(variable" && (y.para = "functionName("), y.para != null && y.para.startsWith("functionName") && (e6 === ")" ? y.para.endsWith("(") && (y.para = y.para.substr(0, y.para.length - 1), y.para === "functionName" && (y.grammar = "")) : e6 === "(" && (y.para += e6)), e6 === "(" && y.lastToken === "functionName" ? y.lastToken += e6 : e6 === ")" && y.lastToken === "functionName(" ? y.lastToken = null : e6 === "(" && y.lastToken === "returns" ? y.lastToken += e6 : e6 === ")" && (y.lastToken === "returns(" || y.lastToken === "returns(variable") && (y.lastToken = null), e6 === "(" && y.lastToken === "address" && (y.lastToken += e6), curPunc = e6, null;
4077
+ function updateGarmmer(e6, b) {
4078
+ return e6 === "," && b.para === "functionName(variable" && (b.para = "functionName("), b.para != null && b.para.startsWith("functionName") && (e6 === ")" ? b.para.endsWith("(") && (b.para = b.para.substr(0, b.para.length - 1), b.para === "functionName" && (b.grammar = "")) : e6 === "(" && (b.para += e6)), e6 === "(" && b.lastToken === "functionName" ? b.lastToken += e6 : e6 === ")" && b.lastToken === "functionName(" ? b.lastToken = null : e6 === "(" && b.lastToken === "returns" ? b.lastToken += e6 : e6 === ")" && (b.lastToken === "returns(" || b.lastToken === "returns(variable") && (b.lastToken = null), e6 === "(" && b.lastToken === "address" && (b.lastToken += e6), curPunc = e6, null;
4112
4079
  }
4113
4080
  var Context = class {
4114
- constructor(e6, y, b, x, S) {
4115
- this.indented = e6, this.column = y, this.type = b, this.align = x, this.prev = S;
4081
+ constructor(e6, b, x, S, C) {
4082
+ this.indented = e6, this.column = b, this.type = x, this.align = S, this.prev = C;
4116
4083
  }
4117
4084
  };
4118
- function pushContext(e6, y, b) {
4119
- return e6.context = new Context(e6.indented, y, b, null, e6.context), e6.context;
4085
+ function pushContext(e6, b, x) {
4086
+ return e6.context = new Context(e6.indented, b, x, null, e6.context), e6.context;
4120
4087
  }
4121
4088
  function popContext(e6) {
4122
4089
  if (!e6.context.prev) return;
4123
- let y = e6.context.type;
4124
- return (y === ")" || y === "]" || y === "}") && (e6.indented = e6.context.indented), e6.context = e6.context.prev;
4090
+ let b = e6.context.type;
4091
+ return (b === ")" || b === "]" || b === "}") && (e6.indented = e6.context.indented), e6.context = e6.context.prev;
4125
4092
  }
4126
4093
  var parser = {
4127
4094
  startState(e6) {
@@ -4135,19 +4102,19 @@ var parser = {
4135
4102
  para: null
4136
4103
  };
4137
4104
  },
4138
- token(e6, y) {
4139
- let b = y.context;
4140
- if (e6.sol() && (b.align ?? (b.align = false), y.indented = e6.indentation(), y.startOfLine = true, b.type === "case" && (b.type = "}"), y.grammar === "doc" && (y.grammar = null)), e6.eatSpace()) return null;
4105
+ token(e6, b) {
4106
+ let x = b.context;
4107
+ if (e6.sol() && (x.align ?? (x.align = false), b.indented = e6.indentation(), b.startOfLine = true, x.type === "case" && (x.type = "}"), b.grammar === "doc" && (b.grammar = null)), e6.eatSpace()) return null;
4141
4108
  curPunc = null;
4142
- let x = (y.tokenize || tokenBase)(e6, y);
4143
- return x === "comment" ? x : (b.align ?? (b.align = true), curPunc === "{" ? pushContext(y, e6.column(), "}") : curPunc === "[" ? pushContext(y, e6.column(), "]") : curPunc === "(" ? pushContext(y, e6.column(), ")") : curPunc === "case" ? b.type = "case" : (curPunc === "}" && b.type === "}" || curPunc === b.type) && popContext(y), y.startOfLine = false, x);
4109
+ let S = (b.tokenize || tokenBase)(e6, b);
4110
+ return S === "comment" ? S : (x.align ?? (x.align = true), curPunc === "{" ? pushContext(b, e6.column(), "}") : curPunc === "[" ? pushContext(b, e6.column(), "]") : curPunc === "(" ? pushContext(b, e6.column(), ")") : curPunc === "case" ? x.type = "case" : (curPunc === "}" && x.type === "}" || curPunc === x.type) && popContext(b), b.startOfLine = false, S);
4144
4111
  },
4145
- indent(e6, y, b) {
4112
+ indent(e6, b, x) {
4146
4113
  if (e6.tokenize !== tokenBase && e6.tokenize != null) return null;
4147
- let x = e6.context, S = y && y.charAt(0);
4148
- if (x.type === "case" && /^(?:case|default)\b/.test(y)) return e6.context.type = "}", x.indented;
4149
- let C = S === x.type;
4150
- return x.align ? x.column + (C ? 0 : 1) : x.indented + (C ? 0 : b.unit);
4114
+ let S = e6.context, C = b && b.charAt(0);
4115
+ if (S.type === "case" && /^(?:case|default)\b/.test(b)) return e6.context.type = "}", S.indented;
4116
+ let w = C === S.type;
4117
+ return S.align ? S.column + (w ? 0 : 1) : S.indented + (w ? 0 : x.unit);
4151
4118
  },
4152
4119
  electricChars: "{}):",
4153
4120
  closeBrackets: "()[]{}''\"\"``",