@marimo-team/islands 0.16.4 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CCjhPKMy.js → ConnectedDataExplorerComponent-DJEUH6Bb.js} +78 -100
  2. package/dist/{_baseIsEqual-oN7pRNcM.js → _baseIsEqual-CN4oFUZ4.js} +20 -20
  3. package/dist/{_basePickBy-CYvzhRjy.js → _basePickBy-CzSvE_-f.js} +3 -3
  4. package/dist/{_baseProperty-DGUdIBuu.js → _baseProperty-DbbUiyUD.js} +5 -5
  5. package/dist/{_baseUniq-B5gfSl8S.js → _baseUniq-DwoC-LVO.js} +4 -4
  6. package/dist/any-language-editor-CEXn1vFs.js +156 -0
  7. package/dist/apl-DuVfHsPc.js +4 -0
  8. package/dist/architecture-O4VJ6CD3-lp-opOaL.js +21 -0
  9. package/dist/{architectureDiagram-W76B3OCA-DkEhipkW.js → architectureDiagram-W76B3OCA-CoBORy6u.js} +34 -34
  10. package/dist/asciiarmor-qIVWsi4F.js +4 -0
  11. package/dist/asn1-BjPqARr7.js +4 -0
  12. package/dist/assets/__vite-browser-external-lX-sn9m2.js +1 -0
  13. package/dist/assets/worker-vPn7gxWj.js +54 -0
  14. package/dist/{blockDiagram-QIGZ2CNN-DZOqLMYa.js → blockDiagram-QIGZ2CNN-0yzoLIar.js} +75 -86
  15. package/dist/brainfuck-DPGTVfkE.js +4 -0
  16. package/dist/{button-CEcjneWG.js → button-DcnBVpVa.js} +11 -14
  17. package/dist/{c4Diagram-FPNF74CW-DVaR7c9q.js → c4Diagram-FPNF74CW-CKsIA_DD.js} +27 -51
  18. package/dist/{channel-Uh0KpgGW.js → channel-3LVvQZcD.js} +1 -1
  19. package/dist/{check-BK9zDfQk.js → check-D7ifz5op.js} +1 -1
  20. package/dist/{chunk-3AY6CYHV-Dk2R2-S1.js → chunk-3AY6CYHV-B2C-aVc3.js} +35 -35
  21. package/dist/{chunk-4BX2VUAB-CqO6zUIz.js → chunk-4BX2VUAB-DEd4VI9L.js} +1 -1
  22. package/dist/{chunk-4KMFLZZN-CloTfTwP.js → chunk-4KMFLZZN-DnvP3O4K.js} +216 -325
  23. package/dist/{chunk-55IACEB6-I0rmqTua.js → chunk-55IACEB6-BcCzwOOl.js} +1 -1
  24. package/dist/{chunk-6OXUPJBA-BuROSTmo.js → chunk-6OXUPJBA-eNAAfJ3Q.js} +7 -7
  25. package/dist/{chunk-7GE3RBXV-B1-tsIPP.js → chunk-7GE3RBXV-CSAeQvLz.js} +1 -1
  26. package/dist/{chunk-ABZYJK2D-CLlso8tj.js → chunk-ABZYJK2D-CZcb_1iM.js} +16 -20
  27. package/dist/{chunk-BN7GFLIU-Db2-FjLn.js → chunk-BN7GFLIU-pBc5O5Rh.js} +1 -1
  28. package/dist/{chunk-CVBHYZKI-BONeiloK.js → chunk-CVBHYZKI-CivHZg9P.js} +3 -3
  29. package/dist/{chunk-CXMOBAN2-U9GJSP1d.js → chunk-CXMOBAN2-Dd0E6qb0.js} +46 -54
  30. package/dist/chunk-EXTU4WIE-GQ2ZWfJo.js +10 -0
  31. package/dist/{chunk-FMBD7UC4-DyV3BR_I.js → chunk-FMBD7UC4-C6YcisV6.js} +1 -1
  32. package/dist/{chunk-JA3XYJ7Z-C9A1076P.js → chunk-JA3XYJ7Z-DYeQaT57.js} +21 -25
  33. package/dist/{chunk-JEIROHC2-BGnFkSVq.js → chunk-JEIROHC2-B-EZMP4V.js} +1 -1
  34. package/dist/{chunk-K7UQS3LO-033LOsjK.js → chunk-K7UQS3LO-DENzlS-M.js} +7 -7
  35. package/dist/{chunk-KMC2YHZD-DT4Sq4Ld.js → chunk-KMC2YHZD-SckhHdEh.js} +1 -1
  36. package/dist/{chunk-QN33PNHL-gs44MZla.js → chunk-QN33PNHL-Cjq5b604.js} +2 -2
  37. package/dist/{chunk-QYVHNE3D-B8BO1AnT.js → chunk-QYVHNE3D-CNUuivie.js} +3 -4
  38. package/dist/{chunk-QZHKN3VN-CeN_GkU6.js → chunk-QZHKN3VN-DugEU_bA.js} +1 -1
  39. package/dist/chunk-S3R3BYOJ-itCT6Vif.js +380 -0
  40. package/dist/{chunk-T44TD3VJ-BwzD6YE0.js → chunk-T44TD3VJ-BLdfTX8J.js} +1 -1
  41. package/dist/{chunk-TVAH2DTR-Bi6jpQJQ.js → chunk-TVAH2DTR-BOnwF9d8.js} +7 -8
  42. package/dist/{chunk-TZMSLE5B-D8klz2H_.js → chunk-TZMSLE5B-DGs66AlL.js} +4 -5
  43. package/dist/{chunk-WFRQ32O7-CzSwSlN0.js → chunk-WFRQ32O7-CPsipkmJ.js} +1 -1
  44. package/dist/{chunk-WFWHJNB7-DN_cavM6.js → chunk-WFWHJNB7-Cmed18Pk.js} +1 -1
  45. package/dist/{chunk-XRWGC2XP-Bb5eGNM2.js → chunk-XRWGC2XP-DH5GDaY8.js} +1 -1
  46. package/dist/{chunk-ZPAFE4SF-S5UYNb0V.js → chunk-ZPAFE4SF-DPDwaqZm.js} +22 -22
  47. package/dist/classDiagram-KNZD7YFC-azuS_99k.js +39 -0
  48. package/dist/classDiagram-v2-RKCZMP56-CQpyQQOR.js +39 -0
  49. package/dist/{click-outside-container-DE4e7p1p.js → click-outside-container-CL_FkgGY.js} +7 -12
  50. package/dist/{clike-CxAz4p9E.js → clike-DYfRWWXk.js} +1 -1
  51. package/dist/{clike-Cg_DBrJ0.js → clike-bzZTreP4.js} +1 -1
  52. package/dist/clojure-ATksAecl.js +4 -0
  53. package/dist/{clone-Dk4FkKH0.js → clone-Msbhmn2a.js} +1 -1
  54. package/dist/cmake-CWylaz2C.js +4 -0
  55. package/dist/cobol-BiLLCZIQ.js +4 -0
  56. package/dist/coffeescript-Ca4jipi8.js +4 -0
  57. package/dist/commonlisp-BwFjyEC7.js +4 -0
  58. package/dist/{constants-Cjd_3kwd.js → constants-BCOEQoEQ.js} +3 -3
  59. package/dist/{copy-C5RFg7ok.js → copy-BkZ8PkBM.js} +6 -2
  60. package/dist/{cose-bilkent-S5V4N54A-B3iOTGu5.js → cose-bilkent-S5V4N54A-BZnbwyVD.js} +20 -20
  61. package/dist/crystal-BhUsQHbh.js +4 -0
  62. package/dist/css-Cf4wlIyV.js +5 -0
  63. package/dist/cypher-Dj8Hzgxa.js +4 -0
  64. package/dist/{cytoscape.esm-DTDV0Nbj.js → cytoscape.esm-BTpRoPd2.js} +586 -661
  65. package/dist/d-DZI7tbTy.js +4 -0
  66. package/dist/{dagre-5GWH7T2D-KM4Z11yT.js → dagre-5GWH7T2D-BGaiSZZO.js} +32 -37
  67. package/dist/{dagre-B0u1urxE.js → dagre-pyfDIOWJ.js} +57 -76
  68. package/dist/data-grid-overlay-editor-867aBz0Y.js +133 -0
  69. package/dist/{diagram-N5W7TBWH-CtO7az4G.js → diagram-N5W7TBWH-CzLE0jZB.js} +35 -51
  70. package/dist/diagram-QEK2KX5R-AGS60xEZ.js +245 -0
  71. package/dist/{diagram-S2PKOQOG-CiXElLNQ.js → diagram-S2PKOQOG-BxRoG6yW.js} +28 -28
  72. package/dist/diff-WQISUHG5.js +4 -0
  73. package/dist/{dist-CdE2C2In.js → dist-2Ne-33Xy.js} +15 -20
  74. package/dist/{dist-DKFaZRVk.js → dist-B0YD1aXi.js} +2 -2
  75. package/dist/{dist-DBhzmFyH.js → dist-B1Dv8Sdk.js} +3 -3
  76. package/dist/{dist-CGIZPq3J.js → dist-BFkr6kAQ.js} +2 -2
  77. package/dist/{dist-DL_ci7Yc.js → dist-BL2DSY0P.js} +1 -1
  78. package/dist/dist-BawZu0ix.js +10 -0
  79. package/dist/{dist-Bar1QnNM.js → dist-BhVFggab.js} +3 -3
  80. package/dist/{textile-Cy55fYGC.js → dist-BiOF7987.js} +4 -2
  81. package/dist/{dist-BQmQQqFH.js → dist-BpzZrRd6.js} +1 -1
  82. package/dist/{dist-CxD5E6Sh.js → dist-C7zhQ7K0.js} +24 -22
  83. package/dist/{dist-BqgkUnEN.js → dist-CBhnQKQ4.js} +3 -3
  84. package/dist/{dist-Dzk1C8l5.js → dist-CId4IPXu.js} +10 -13
  85. package/dist/{dist-CUnh_3Ii.js → dist-CYhQCVru.js} +2 -2
  86. package/dist/{dist-BBlFk9ki.js → dist-CZq5-ZyD.js} +1 -1
  87. package/dist/{dist-elblfNXO.js → dist-Cacac5HV.js} +2 -2
  88. package/dist/{dist-CChOkSUg.js → dist-CfQHSIQC.js} +3 -3
  89. package/dist/{dist-JCAky9ND.js → dist-CkvGMBAS.js} +17 -22
  90. package/dist/dist-Cs3McXEj.js +6 -0
  91. package/dist/{dist-o7fhJC7U.js → dist-CvyfRaIr.js} +3 -3
  92. package/dist/{dist-CZfRM7pE.js → dist-D-3fICwh.js} +2 -2
  93. package/dist/dist-D3aaithT.js +6 -0
  94. package/dist/{dist-CutXTm8t.js → dist-DBhEu3-F.js} +1 -1
  95. package/dist/dist-DELcMSpJ.js +6 -0
  96. package/dist/{dist-C7ASiFxI.js → dist-DMxl6Qbu.js} +273 -263
  97. package/dist/{dist-CLvpViod.js → dist-DS6nuHYK.js} +2 -3
  98. package/dist/dist-Dgts3WXd.js +6 -0
  99. package/dist/{dist--I6Htnlv.js → dist-DlHkZUnY.js} +5 -5
  100. package/dist/dist-Doiq_KIP.js +15 -0
  101. package/dist/dist-DtpUiDG_.js +6 -0
  102. package/dist/{dist-DzOpMdwb.js → dist-NUdHX0XE.js} +4 -4
  103. package/dist/{dist-C3WYsf4K.js → dist-PGgOcwbF.js} +4 -10
  104. package/dist/{dist-DNnYAdRE.js → dist-RdxOJbBw.js} +2 -2
  105. package/dist/{dist-BEvIw5Nh.js → dist-RwqAqkpG.js} +1 -1
  106. package/dist/dist-ZjnJq_jD.js +10 -0
  107. package/dist/{dist-CbRkrKrP.js → dist-biZ846D9.js} +5 -5
  108. package/dist/{dist-DW9er3Zq.js → dist-d5NxvX2s.js} +44 -23
  109. package/dist/{dist-C3QUag__.js → dist-ivwkJchV.js} +3 -3
  110. package/dist/dist-mof3iuBu.js +12 -0
  111. package/dist/{dist-Cib4sGDA.js → dist-reo2kYlN.js} +2 -2
  112. package/dist/{dist-BZBitvuL.js → dist-wHVprCkn.js} +1 -1
  113. package/dist/{dist-C5zMs_n5.js → dist-y8uoXYaE.js} +3 -3
  114. package/dist/{dist-DPF5TTUg.js → dist-z_iuDES7.js} +126 -115
  115. package/dist/{dockerfile-Dum_1b-5.js → dockerfile-sZMPcXVY.js} +1 -1
  116. package/dist/dtd-B2M8dhfC.js +4 -0
  117. package/dist/dylan-CU3Vt8SC.js +4 -0
  118. package/dist/ecl-B8ESAVq4.js +4 -0
  119. package/dist/eiffel-DDfMIKeA.js +4 -0
  120. package/dist/elm-Bj6rj8jf.js +4 -0
  121. package/dist/{erDiagram-AWTI2OKA-ZTIl9iQO.js → erDiagram-AWTI2OKA-CTxzb-U8.js} +20 -20
  122. package/dist/erlang-BxyshZUq.js +4 -0
  123. package/dist/{error-banner-OQIGTqFR.js → error-banner-npbEfanI.js} +13 -13
  124. package/dist/{esm-DxFkg7a6.js → esm-BdiY4QsX.js} +1528 -1492
  125. package/dist/{esm-d0g2RsOH.js → esm-CAWW9sum.js} +6 -8
  126. package/dist/{esm-1_Mp6VD2.js → esm-YY5zh7KV.js} +324 -395
  127. package/dist/{esm-BO9n_s6u.js → esm-svAVli9f.js} +5 -5
  128. package/dist/{factor-CdgiDGiu.js → factor-CRFTmP_a.js} +1 -1
  129. package/dist/factor-CYk6XT8r.js +5 -0
  130. package/dist/{flowDiagram-PVAE7QVJ-DsbofOzu.js → flowDiagram-PVAE7QVJ-Dck2hiJe.js} +22 -22
  131. package/dist/{formats-D5C6JAJf.js → formats-BnqXUb1V.js} +13 -17
  132. package/dist/forth-fcoJkd-f.js +4 -0
  133. package/dist/fortran-IxZHu4wc.js +4 -0
  134. package/dist/{fullscreen-D1yTiBlu.js → fullscreen-blsKUrtN.js} +741 -744
  135. package/dist/{ganttDiagram-OWAHRB6G-FnCH1Yj3.js → ganttDiagram-OWAHRB6G-AWzfzpup.js} +9 -9
  136. package/dist/gas-B8rmKcim.js +4 -0
  137. package/dist/gherkin-BTm-jIdJ.js +4 -0
  138. package/dist/gitGraph-ZV4HHKMB-DFg_OLQb.js +21 -0
  139. package/dist/{gitGraphDiagram-NY62KEGX-B0wvMNqU.js → gitGraphDiagram-NY62KEGX-GyNboWSV.js} +31 -34
  140. package/dist/{glide-data-editor-CYfKmSNp.js → glide-data-editor-DHuN8kQ8.js} +1701 -1771
  141. package/dist/{graphlib-BGmr7CYF.js → graphlib-hb3zmtVD.js} +5 -5
  142. package/dist/groovy-01kRHFMD.js +4 -0
  143. package/dist/haskell-B3PhE05w.js +4 -0
  144. package/dist/haxe-DEoAm8oA.js +5 -0
  145. package/dist/{hotkeys-yFrUwyJK.js → hotkeys-Ct2T3e9O.js} +4 -7
  146. package/dist/idl-DsDJU9cV.js +4 -0
  147. package/dist/info-63CPKGFF-D3DZmDBa.js +21 -0
  148. package/dist/infoDiagram-STP46IZ2-ec08vi_U.js +44 -0
  149. package/dist/{isArrayLikeObject-DiDsNamC.js → isArrayLikeObject-BlvK28do.js} +3 -5
  150. package/dist/{isEmpty-BBG-u1GM.js → isEmpty--odfYjh1.js} +2 -2
  151. package/dist/{isSymbol-BxF-_8BA.js → isSymbol-Cb1f2HgO.js} +1 -1
  152. package/dist/{javascript-Dfq1qI35.js → javascript-BfCTmOnk.js} +2 -2
  153. package/dist/javascript-gwczVhuU.js +5 -0
  154. package/dist/jinja2-AkZRdFk3.js +4 -0
  155. package/dist/{journeyDiagram-BIP6EPQ6-B3PotfAW.js → journeyDiagram-BIP6EPQ6-TmXYCUbT.js} +23 -24
  156. package/dist/julia-_s6qe3bf.js +4 -0
  157. package/dist/{kanban-definition-6OIFK2YF-BTrQZ3LN.js → kanban-definition-6OIFK2YF-B6ozleHo.js} +15 -15
  158. package/dist/{katex-dN__NFdn.js → katex-mPzRsXEy.js} +1 -1
  159. package/dist/{katex-BE4xflfm.js → katex-mkWmhPUh.js} +149 -173
  160. package/dist/{label-BinTsX-u.js → label-VVRKZmrP.js} +21 -24
  161. package/dist/{linear-DyTdUIqX.js → linear-iebAbJVD.js} +1 -1
  162. package/dist/livescript-CwPHQdv5.js +4 -0
  163. package/dist/{loader-Dijti3y4.js → loader-CM0VALo9.js} +19 -26
  164. package/dist/lua-s7nRxkCP.js +4 -0
  165. package/dist/main.js +8234 -8633
  166. package/dist/{marked.esm-3RjvXPoO.js → marked.esm-DJM8la36.js} +5 -5
  167. package/dist/mathematica-Ci36yd1q.js +4 -0
  168. package/dist/mbox-DbOYMNCO.js +4 -0
  169. package/dist/{memoize-Dq87l1O_.js → memoize-DYoRBSLn.js} +1 -1
  170. package/dist/{merge-BPDCIm8P.js → merge-BjuR6j_w.js} +1 -1
  171. package/dist/{mermaid-BlJDcO4M.js → mermaid-YPPMBmhk.js} +58 -76
  172. package/dist/{mermaid-parser.core-CSFx6MQ7.js → mermaid-parser.core-BLkyTSZj.js} +8 -8
  173. package/dist/{mhchem-DZ68WS0G.js → mhchem-Dw7wvXtr.js} +1 -1
  174. package/dist/{min-BzhKOmZo.js → min-B_i2ahn4.js} +7 -7
  175. package/dist/{mindmap-definition-Q6HEUPPD-9hhnrO1k.js → mindmap-definition-Q6HEUPPD-F6-JnXwq.js} +17 -17
  176. package/dist/mirc-VmNe8AwF.js +4 -0
  177. package/dist/mllike-BdD7SJEa.js +6 -0
  178. package/dist/modelica-BA4VqzC3.js +4 -0
  179. package/dist/mscgen-DF-5WHJm.js +6 -0
  180. package/dist/mumps-c_Uia_QN.js +4 -0
  181. package/dist/{node-sql-parser-13oju30e.js → node-sql-parser-BqKV-TpL.js} +14343 -14351
  182. package/dist/{now-DVBcRCoE.js → now-CwRqw0nS.js} +1 -1
  183. package/dist/nsis-BAANGODV.js +5 -0
  184. package/dist/{nsis-BW6_XagK.js → nsis-BWJEeUyS.js} +1 -1
  185. package/dist/ntriples-Bslqh2Ki.js +4 -0
  186. package/dist/{number-overlay-editor-D1YdiOrm.js → number-overlay-editor-CeyruAX4.js} +17 -23
  187. package/dist/octave-DYn5ltia.js +4 -0
  188. package/dist/oz-B_N-StZq.js +4 -0
  189. package/dist/packet-HUATNLJX-CkqjFdAv.js +21 -0
  190. package/dist/pascal-DU4CtAUu.js +4 -0
  191. package/dist/perl-Bae6k32u.js +4 -0
  192. package/dist/pie-WTHONI2E-D0rWwX5P.js +21 -0
  193. package/dist/{pieDiagram-ADFJNKIX-CSBC0ZgF.js → pieDiagram-ADFJNKIX-C5dSQVCn.js} +28 -28
  194. package/dist/pig-DSIxUEgX.js +4 -0
  195. package/dist/powershell-31lcPgIF.js +4 -0
  196. package/dist/powershell-BZx53Ujw.js +236 -0
  197. package/dist/properties-lmYbntDG.js +4 -0
  198. package/dist/protobuf-BTYoCEpV.js +4 -0
  199. package/dist/pug-DMFM7zzO.js +5 -0
  200. package/dist/{pug-Bmups_z0.js → pug-PJh82u1M.js} +1 -1
  201. package/dist/puppet-B0ub07d-.js +4 -0
  202. package/dist/python-C4jT87Nt.js +5 -0
  203. package/dist/{q-BzWcnVri.js → q-CMoUHJ5Q.js} +3 -2
  204. package/dist/q-YbPYlqRI.js +4 -0
  205. package/dist/{quadrantDiagram-LMRXKWRM-h7nHf8xG.js → quadrantDiagram-LMRXKWRM-DlahxNiy.js} +7 -7
  206. package/dist/r-OfNu6HAI.js +4 -0
  207. package/dist/radar-NJJJXTRR-Bxqv4O5a.js +21 -0
  208. package/dist/{range-CgK0-PEw.js → range-DxfkexCE.js} +3 -3
  209. package/dist/{react-plotly-BZakcxdv.js → react-plotly-D_IAfR8f.js} +4364 -4705
  210. package/dist/{requirementDiagram-4UW4RH46-BGEurQYq.js → requirementDiagram-4UW4RH46-DTkinyvU.js} +17 -17
  211. package/dist/rpm-D_3b5peD.js +5 -0
  212. package/dist/ruby-CehsJy_T.js +4 -0
  213. package/dist/{sankeyDiagram-GR3RE2ED-CxeJ_jfl.js → sankeyDiagram-GR3RE2ED-CsLnEnnq.js} +3 -3
  214. package/dist/sas-DwQHzPoF.js +4 -0
  215. package/dist/scheme-B6ArxiQu.js +4 -0
  216. package/dist/{sequenceDiagram-C3RYC4MD-CbFxwyr_.js → sequenceDiagram-C3RYC4MD-BdEOR6SC.js} +20 -30
  217. package/dist/shell-AHmQgDfc.js +4 -0
  218. package/dist/sieve-CgodKOcx.js +4 -0
  219. package/dist/{simple-mode-Cgyya8F-.js → simple-mode-BP3Jd4vf.js} +1 -1
  220. package/dist/{slides-component-BEyG25AH.js → slides-component-2bbal1YJ.js} +24 -46
  221. package/dist/smalltalk-BeFzDkbo.js +4 -0
  222. package/dist/sparql-BWxq-Lnx.js +4 -0
  223. package/dist/{src-BNNJRxz3.js → src-DZkaBUmt.js} +6 -6
  224. package/dist/{stateDiagram-KXAO66HF-A61bMf29.js → stateDiagram-KXAO66HF-DQLH2jhP.js} +39 -41
  225. package/dist/stateDiagram-v2-UMBNRL4Z-D9v8fKjF.js +38 -0
  226. package/dist/stex-Dvaq0qsm.js +5 -0
  227. package/dist/style.css +1 -1
  228. package/dist/stylus-Ge0ofWlZ.js +4 -0
  229. package/dist/swift-CjQfbVxV.js +4 -0
  230. package/dist/tcl-CAGDF11K.js +4 -0
  231. package/dist/textile-CrXreJtf.js +4 -0
  232. package/dist/{time-D3tzCqJ6.js → time-CFkXkVrt.js} +1 -1
  233. package/dist/{timeline-definition-XQNQX7LJ-BwdsB7CR.js → timeline-definition-XQNQX7LJ-bToVq14i.js} +4 -5
  234. package/dist/{timer-D3Zlu9ow.js → timer-CzOhIJuk.js} +2 -2
  235. package/dist/{toNumber-efKT08hh.js → toNumber-EFF1Z9T1.js} +2 -2
  236. package/dist/{toString-BvCd3yJc.js → toString-C2mCkasT.js} +2 -2
  237. package/dist/toml-AdLXKwEi.js +4 -0
  238. package/dist/{toml-CIUkU1CP.js → toml-eSl4PUAH.js} +6 -2
  239. package/dist/treemap-75Q7IDZK-Da9Jv6a_.js +21 -0
  240. package/dist/troff-C-LaM2ex.js +4 -0
  241. package/dist/ttcn-DTclUi6T.js +4 -0
  242. package/dist/ttcn-cfg-BtBPbmLX.js +4 -0
  243. package/dist/turtle-BODDDg5O.js +4 -0
  244. package/dist/{types-Dcb1hf55.js → types-CRXV0KD5.js} +385 -252
  245. package/dist/{useAsyncData-DAtPzJzP.js → useAsyncData-uMVTsDI9.js} +1 -1
  246. package/dist/{useDateFormatter-CiUlIu7v.js → useDateFormatter-Dcz7jstn.js} +6 -6
  247. package/dist/{useTheme-CmsvrO5o.js → useTheme-NbEx-ZNV.js} +14 -10
  248. package/dist/vb-Cb1HQHii.js +4 -0
  249. package/dist/vbscript-CpXOP4wZ.js +4 -0
  250. package/dist/{vega-component-B3LA6qbm.js → vega-component-hegVmfuS.js} +21 -21
  251. package/dist/{vega-loader.browser.module-Bi3ttvdj.js → vega-loader.browser.module-DcW8jnKp.js} +1 -2
  252. package/dist/velocity-Dz0rBQIk.js +4 -0
  253. package/dist/verilog-6Di9aLKw.js +4 -0
  254. package/dist/vhdl-BRNesXYc.js +4 -0
  255. package/dist/webidl-BpRNYIYn.js +4 -0
  256. package/dist/xquery-DXWcJ7b6.js +4 -0
  257. package/dist/{xychartDiagram-6GGTOJPD-BJRRi5HC.js → xychartDiagram-6GGTOJPD-C7Bhm_yt.js} +12 -13
  258. package/dist/yacas-DbSARPz4.js +4 -0
  259. package/dist/z80-DzslPj_l.js +4 -0
  260. package/dist/{zod-UPQf9SGn.js → zod-ChY6miG5.js} +71 -81
  261. package/package.json +12 -12
  262. package/src/__mocks__/requests.ts +2 -0
  263. package/src/__tests__/chat-history.test.ts +123 -0
  264. package/src/components/app-config/ai-config.tsx +23 -0
  265. package/src/components/app-config/mcp-config.tsx +42 -2
  266. package/src/components/app-config/user-config-form.tsx +29 -49
  267. package/src/components/chat/acp/__tests__/context-utils.test.ts +1 -1
  268. package/src/components/chat/acp/agent-panel.tsx +1 -1
  269. package/src/components/chat/acp/blocks.tsx +46 -53
  270. package/src/components/chat/acp/common.tsx +1 -1
  271. package/src/components/chat/acp/context-utils.ts +1 -1
  272. package/src/components/chat/acp/session-tabs.tsx +1 -1
  273. package/src/components/chat/chat-history-popover.tsx +125 -0
  274. package/src/components/chat/chat-history-utils.ts +69 -0
  275. package/src/components/chat/chat-panel.tsx +9 -57
  276. package/src/components/chat/chat-utils.ts +11 -4
  277. package/src/components/data-table/__tests__/header-items.test.tsx +117 -0
  278. package/src/components/data-table/column-header.tsx +4 -2
  279. package/src/components/data-table/columns.tsx +2 -1
  280. package/src/components/data-table/data-table.tsx +7 -2
  281. package/src/components/data-table/header-items.tsx +63 -10
  282. package/src/components/dependency-graph/custom-node.tsx +11 -11
  283. package/src/components/dependency-graph/elements.ts +9 -4
  284. package/src/components/dependency-graph/panels.tsx +6 -4
  285. package/src/components/editor/Output.tsx +6 -1
  286. package/src/components/editor/__tests__/data-attributes.test.tsx +1 -1
  287. package/src/components/editor/actions/useNotebookActions.tsx +2 -4
  288. package/src/components/editor/ai/__tests__/completion-utils.test.ts +23 -31
  289. package/src/components/editor/ai/ai-completion-editor.tsx +135 -5
  290. package/src/components/editor/ai/completion-handlers.tsx +106 -22
  291. package/src/components/editor/cell/CreateCellButton.tsx +14 -2
  292. package/src/components/editor/cell/code/cell-editor.tsx +6 -0
  293. package/src/components/editor/chrome/panels/cache-panel.tsx +216 -0
  294. package/src/components/editor/chrome/panels/empty-state.tsx +3 -1
  295. package/src/components/editor/chrome/types.ts +66 -22
  296. package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
  297. package/src/components/editor/database/schemas.ts +2 -10
  298. package/src/components/editor/errors/auto-fix.tsx +138 -32
  299. package/src/components/editor/errors/fix-mode.ts +15 -0
  300. package/src/components/editor/navigation/__tests__/clipboard.test.ts +0 -5
  301. package/src/components/editor/navigation/clipboard.ts +2 -1
  302. package/src/components/editor/{Cell.tsx → notebook-cell.tsx} +25 -8
  303. package/src/components/editor/output/ConsoleOutput.tsx +27 -33
  304. package/src/components/editor/output/JsonOutput.tsx +9 -0
  305. package/src/components/editor/output/MarimoErrorOutput.tsx +4 -34
  306. package/src/components/editor/output/MarimoTracebackOutput.tsx +10 -7
  307. package/src/components/editor/output/__tests__/json-output.test.ts +43 -0
  308. package/src/components/editor/package-alert.tsx +3 -0
  309. package/src/components/editor/renderers/{CellArray.tsx → cell-array.tsx} +1 -1
  310. package/src/components/forms/__tests__/form-utils.test.ts +6 -4
  311. package/src/components/icons/copy-icon.tsx +11 -5
  312. package/src/components/mcp/hooks.ts +48 -0
  313. package/src/components/mcp/mcp-status-indicator.tsx +144 -0
  314. package/src/components/shortcuts/renderShortcut.tsx +3 -1
  315. package/src/components/ui/button.tsx +2 -0
  316. package/src/components/ui/confirmation-button.tsx +85 -0
  317. package/src/components/ui/number-field.tsx +4 -1
  318. package/src/components/ui/switch.tsx +2 -0
  319. package/src/core/ai/context/providers/__tests__/__snapshots__/tables.test.ts.snap +13 -19
  320. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +0 -1
  321. package/src/core/ai/context/providers/__tests__/datasource.test.ts +14 -7
  322. package/src/core/ai/context/providers/__tests__/error.test.ts +24 -15
  323. package/src/core/ai/context/providers/cell-output.ts +5 -5
  324. package/src/core/ai/context/providers/common.ts +13 -4
  325. package/src/core/ai/context/providers/datasource.ts +56 -21
  326. package/src/core/ai/context/providers/error.ts +3 -4
  327. package/src/core/ai/context/providers/file.ts +2 -2
  328. package/src/core/ai/context/providers/tables.ts +36 -8
  329. package/src/core/ai/context/providers/variable.ts +2 -3
  330. package/src/core/ai/state.ts +6 -3
  331. package/src/core/ai/tools/__tests__/registry.test.ts +33 -8
  332. package/src/core/ai/tools/base.ts +81 -1
  333. package/src/core/ai/tools/registry.ts +36 -10
  334. package/src/core/ai/tools/sample-tool.ts +44 -8
  335. package/src/core/cache/requests.ts +5 -0
  336. package/src/core/cells/__tests__/cells.test.ts +6 -6
  337. package/src/core/cells/cells.ts +13 -14
  338. package/src/core/cells/scrollCellIntoView.ts +1 -1
  339. package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +2 -0
  340. package/src/core/codemirror/__tests__/replace-editor-content.test.ts +336 -0
  341. package/src/core/codemirror/__tests__/setup.test.ts +1 -0
  342. package/src/core/codemirror/cm.ts +3 -2
  343. package/src/core/codemirror/find-replace/navigate.ts +2 -2
  344. package/src/core/codemirror/format.ts +2 -9
  345. package/src/core/codemirror/language/__tests__/sql.test.ts +24 -6
  346. package/src/core/codemirror/language/languages/python.ts +1 -3
  347. package/src/core/codemirror/language/languages/sql/sql.ts +23 -13
  348. package/src/core/codemirror/language/panel/panel.tsx +1 -6
  349. package/src/core/codemirror/language/utils.ts +3 -8
  350. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +21 -14
  351. package/src/core/codemirror/lsp/federated-lsp.ts +20 -9
  352. package/src/core/codemirror/lsp/notebook-lsp.ts +35 -29
  353. package/src/core/codemirror/lsp/types.ts +0 -13
  354. package/src/core/codemirror/replace-editor-content.ts +87 -0
  355. package/src/core/config/__tests__/config-schema.test.ts +5 -0
  356. package/src/core/config/config-schema.ts +10 -0
  357. package/src/core/config/feature-flag.tsx +2 -6
  358. package/src/core/edit-app.tsx +1 -1
  359. package/src/core/errors/__tests__/errors.test.ts +1 -0
  360. package/src/core/errors/errors.ts +20 -6
  361. package/src/core/islands/bridge.ts +2 -0
  362. package/src/core/islands/main.ts +4 -0
  363. package/src/core/kernel/messages.ts +1 -0
  364. package/src/core/network/CachingRequestRegistry.ts +2 -2
  365. package/src/core/network/requests-network.ts +14 -0
  366. package/src/core/network/requests-static.ts +2 -0
  367. package/src/core/network/requests-toasting.ts +2 -0
  368. package/src/core/network/types.ts +5 -0
  369. package/src/core/saving/save-component.tsx +43 -36
  370. package/src/core/wasm/bridge.ts +2 -0
  371. package/src/core/websocket/useMarimoWebSocket.tsx +8 -0
  372. package/src/css/app/codemirror-completions.css +1 -1
  373. package/src/custom.d.ts +2 -0
  374. package/src/plugins/core/registerReactComponent.tsx +5 -1
  375. package/src/plugins/impl/DataTablePlugin.tsx +19 -19
  376. package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +32 -0
  377. package/src/plugins/impl/chat/ChatPlugin.tsx +1 -1
  378. package/src/plugins/impl/chat/chat-ui.tsx +17 -2
  379. package/src/plugins/impl/chat/types.ts +1 -1
  380. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +7 -2
  381. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +17 -0
  382. package/src/plugins/impl/plotly/parse-from-template.ts +2 -1
  383. package/src/stories/cell.stories.tsx +1 -1
  384. package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
  385. package/src/utils/__tests__/formatting.test.ts +107 -0
  386. package/src/utils/__tests__/json-parser.test.ts +13 -0
  387. package/src/utils/copy.ts +6 -0
  388. package/src/utils/formatting.ts +51 -0
  389. package/src/utils/json/json-parser.ts +28 -3
  390. package/src/utils/numbers.ts +24 -1
  391. package/dist/any-language-editor-CVFQlioK.js +0 -156
  392. package/dist/apl-ChlaBfxB.js +0 -4
  393. package/dist/architecture-O4VJ6CD3-BVeaxUcM.js +0 -21
  394. package/dist/asciiarmor-CcJmm3l_.js +0 -4
  395. package/dist/asn1-ThRYxoBE.js +0 -4
  396. package/dist/assets/__vite-browser-external-BeNtI_tJ.js +0 -1
  397. package/dist/assets/worker-DnuXpGWN.js +0 -54
  398. package/dist/brainfuck-CEM0JgDn.js +0 -4
  399. package/dist/chunk-EXTU4WIE-DECT9AAK.js +0 -14
  400. package/dist/chunk-S3R3BYOJ-DMQ1yeyq.js +0 -386
  401. package/dist/classDiagram-KNZD7YFC-BG53O6Jt.js +0 -39
  402. package/dist/classDiagram-v2-RKCZMP56-BmKILsGU.js +0 -39
  403. package/dist/clojure-B7RHyE9t.js +0 -4
  404. package/dist/cmake-TeTMP4I5.js +0 -4
  405. package/dist/cobol-DI-mxUER.js +0 -4
  406. package/dist/coffeescript-DHUFLqWp.js +0 -4
  407. package/dist/commonlisp-SLiUrh1m.js +0 -4
  408. package/dist/crystal-B4fY1ZfJ.js +0 -4
  409. package/dist/css-Bdoq3TzK.js +0 -5
  410. package/dist/cypher-CBU182fp.js +0 -4
  411. package/dist/d-D8myDZeH.js +0 -4
  412. package/dist/data-grid-overlay-editor-qNmJk2x0.js +0 -135
  413. package/dist/diagram-QEK2KX5R-fu8Noi3H.js +0 -245
  414. package/dist/diff-DJF_UB7H.js +0 -4
  415. package/dist/dist-52-_pKoy.js +0 -6
  416. package/dist/dist-6DOMStFn.js +0 -6
  417. package/dist/dist-B334aW7p.js +0 -10
  418. package/dist/dist-BOI9lUz-.js +0 -12
  419. package/dist/dist-C06uhBzF.js +0 -6
  420. package/dist/dist-CGkpguCB.js +0 -6
  421. package/dist/dist-CrApzUED.js +0 -6
  422. package/dist/dist-Dp2GLdCl.js +0 -14
  423. package/dist/dist-WHFsbMDr.js +0 -6
  424. package/dist/dist-hyKcTPG9.js +0 -10
  425. package/dist/dtd-DY8q65lC.js +0 -4
  426. package/dist/dylan-CBLcjWCi.js +0 -4
  427. package/dist/ecl-BSXPNfOw.js +0 -4
  428. package/dist/eiffel-BJf0PQX-.js +0 -4
  429. package/dist/elm-DWQwPCZS.js +0 -4
  430. package/dist/erlang-BWBaGZ5e.js +0 -4
  431. package/dist/factor-DT1-MBPl.js +0 -5
  432. package/dist/forth-D9GDt3FB.js +0 -4
  433. package/dist/fortran-DHkRhDWw.js +0 -4
  434. package/dist/gas-7lQEOM0H.js +0 -4
  435. package/dist/gherkin-BLLyroYi.js +0 -4
  436. package/dist/gitGraph-ZV4HHKMB-z2v_cInC.js +0 -21
  437. package/dist/groovy-C-wabwj0.js +0 -4
  438. package/dist/haskell-DaxVQ_d1.js +0 -4
  439. package/dist/haxe-C2yLoC7h.js +0 -5
  440. package/dist/idl-DQBP8i7k.js +0 -4
  441. package/dist/info-63CPKGFF-GS4w6pCB.js +0 -21
  442. package/dist/infoDiagram-STP46IZ2-DE9YYPFg.js +0 -44
  443. package/dist/javascript-DRwFV9r5.js +0 -5
  444. package/dist/jinja2-CNoIpVmN.js +0 -4
  445. package/dist/julia-DXDf-GhP.js +0 -4
  446. package/dist/livescript-S2uhJQx7.js +0 -4
  447. package/dist/lua-Bvgs0y2G.js +0 -4
  448. package/dist/mathematica-D2zqfwIg.js +0 -4
  449. package/dist/mbox-SBcPaDuZ.js +0 -4
  450. package/dist/mirc-hkQc7sVF.js +0 -4
  451. package/dist/mllike-DRWPBlr9.js +0 -6
  452. package/dist/modelica-CO2ROGlP.js +0 -4
  453. package/dist/mscgen-BpX61bO6.js +0 -6
  454. package/dist/mumps-BCnFeIn6.js +0 -4
  455. package/dist/nsis-BaTOxlD1.js +0 -5
  456. package/dist/ntriples-zEo5BWjr.js +0 -4
  457. package/dist/octave-BE0RnCM9.js +0 -4
  458. package/dist/oz-C4_2Ttul.js +0 -4
  459. package/dist/packet-HUATNLJX-CjHqJIqk.js +0 -21
  460. package/dist/pascal-Q3jJucpw.js +0 -4
  461. package/dist/perl-DkXZIWHF.js +0 -4
  462. package/dist/pie-WTHONI2E-D67gLWtR.js +0 -21
  463. package/dist/pig-DCgEHdsu.js +0 -4
  464. package/dist/powershell-3rK_nRRJ.js +0 -236
  465. package/dist/powershell-Eo2-7MoM.js +0 -4
  466. package/dist/properties-C0IOX8WR.js +0 -4
  467. package/dist/protobuf--lGQUSRO.js +0 -4
  468. package/dist/pug-Cf8AQHMJ.js +0 -5
  469. package/dist/puppet-D7Z3dTJn.js +0 -4
  470. package/dist/python-FHIx_i8Y.js +0 -5
  471. package/dist/q-B7UA1feM.js +0 -4
  472. package/dist/r-Cc9R2A7N.js +0 -4
  473. package/dist/radar-NJJJXTRR-C-AZP_Te.js +0 -21
  474. package/dist/rpm-vhJNlrQ6.js +0 -5
  475. package/dist/ruby-CVluPY0M.js +0 -4
  476. package/dist/sas-A8DL8oy3.js +0 -4
  477. package/dist/scheme-6xHHcSXC.js +0 -4
  478. package/dist/shell-DHN-e5rf.js +0 -4
  479. package/dist/sieve-BuQwLY02.js +0 -4
  480. package/dist/smalltalk-BA4HPg2H.js +0 -4
  481. package/dist/sparql-Bf4yCuy3.js +0 -4
  482. package/dist/stateDiagram-v2-UMBNRL4Z-C_0FUzzk.js +0 -38
  483. package/dist/stex-D-I1cYeE.js +0 -5
  484. package/dist/stylus-BMeped2l.js +0 -4
  485. package/dist/swift-lwEdlZoC.js +0 -4
  486. package/dist/tcl-B03ipeqv.js +0 -4
  487. package/dist/toml-BLgrVtfu.js +0 -4
  488. package/dist/treemap-75Q7IDZK-DTvwfpWt.js +0 -21
  489. package/dist/troff-g6EjN2O2.js +0 -4
  490. package/dist/ttcn-Dzvba8jK.js +0 -4
  491. package/dist/ttcn-cfg-CadG0p1K.js +0 -4
  492. package/dist/turtle-DkXAMWo9.js +0 -4
  493. package/dist/vb-C5dCiel8.js +0 -4
  494. package/dist/vbscript-I4bDEQln.js +0 -4
  495. package/dist/velocity-mt0fDwFH.js +0 -4
  496. package/dist/verilog-Dxq3KJkc.js +0 -4
  497. package/dist/vhdl-Km0QUlV-.js +0 -4
  498. package/dist/webidl-B3lJ2MRL.js +0 -4
  499. package/dist/xquery-CcIxNPEe.js +0 -4
  500. package/dist/yacas-oMa-f-tN.js +0 -4
  501. package/dist/z80-D03Nvn6l.js +0 -4
  502. /package/dist/{apl-DZqo8Elt.js → apl-CEHentF4.js} +0 -0
  503. /package/dist/{asciiarmor-DTzHAIeX.js → asciiarmor-DURYiCS0.js} +0 -0
  504. /package/dist/{asn1-DrAXKsZH.js → asn1-ETAiEoXY.js} +0 -0
  505. /package/dist/{asterisk-oF4U3h48.js → asterisk-DTpbbXPb.js} +0 -0
  506. /package/dist/{brainfuck-BYgLey30.js → brainfuck-BWQep-SA.js} +0 -0
  507. /package/dist/{clojure-Bs2M3OUY.js → clojure-BzFapDkA.js} +0 -0
  508. /package/dist/{cmake-DpI8vxJN.js → cmake-DvlbIC8x.js} +0 -0
  509. /package/dist/{cobol-BQyrWo72.js → cobol-BrEI4cPR.js} +0 -0
  510. /package/dist/{coffeescript-9ke9UHmw.js → coffeescript-B6cvu8mO.js} +0 -0
  511. /package/dist/{common-keywords-BzgeAvH1.js → common-keywords-WqQm7W8t.js} +0 -0
  512. /package/dist/{commonlisp-DghUdrUH.js → commonlisp-BIT8PQqi.js} +0 -0
  513. /package/dist/{crystal-DEf_SInh.js → crystal-B_UcPArT.js} +0 -0
  514. /package/dist/{css-BzTU9lNO.js → css-dHbnt_zl.js} +0 -0
  515. /package/dist/{cypher-a2v0c11S.js → cypher-Dh3FOpL7.js} +0 -0
  516. /package/dist/{d-SAswny-M.js → d-CQD1IHee.js} +0 -0
  517. /package/dist/{diff-OJ-xLXcG.js → diff-CpF_IDx0.js} +0 -0
  518. /package/dist/{dtd-BsUf-rer.js → dtd-DYoNpy6c.js} +0 -0
  519. /package/dist/{duckdb-keywords-B0NOra5o.js → duckdb-keywords-CdIsl9L0.js} +0 -0
  520. /package/dist/{dylan-C0ZYngjn.js → dylan-Bc_2G1E-.js} +0 -0
  521. /package/dist/{ebnf-DF1xx0b_.js → ebnf-jGVT_YpN.js} +0 -0
  522. /package/dist/{ecl-Bsuvoouq.js → ecl-UIU-P-Ar.js} +0 -0
  523. /package/dist/{eiffel-DgfSpLi-.js → eiffel-C90Oyuix.js} +0 -0
  524. /package/dist/{elm-GNxDj-5E.js → elm-B9fWSySj.js} +0 -0
  525. /package/dist/{erlang-Ds3uY1kL.js → erlang-Ccff0UAn.js} +0 -0
  526. /package/dist/{fcl-CqBgSioc.js → fcl-CGR8NxAg.js} +0 -0
  527. /package/dist/{forth-JCaLysGk.js → forth-U1ROGcBY.js} +0 -0
  528. /package/dist/{fortran-Dc2AoKAl.js → fortran-3nOkjDmc.js} +0 -0
  529. /package/dist/{gas-Q4Uz82YW.js → gas-B_4H5FzV.js} +0 -0
  530. /package/dist/{gherkin-Dpxe49sQ.js → gherkin-B0eru5Uz.js} +0 -0
  531. /package/dist/{groovy-D8mTRCu6.js → groovy-dqjtZUVf.js} +0 -0
  532. /package/dist/{haskell-2_8cC4wY.js → haskell-DFzCCQzo.js} +0 -0
  533. /package/dist/{haxe-Bl9zkZlz.js → haxe-Da8Pj5RT.js} +0 -0
  534. /package/dist/{http-DKCqY6yS.js → http-1HACL_9s.js} +0 -0
  535. /package/dist/{idl-Dn-HNfGW.js → idl-D3NXs5iM.js} +0 -0
  536. /package/dist/{jinja2-JjFiAGKk.js → jinja2-gBHAxUdF.js} +0 -0
  537. /package/dist/{julia-R5wne8eu.js → julia-bG-6nJ-_.js} +0 -0
  538. /package/dist/{livescript-DSwokrYj.js → livescript-BlsRC8UJ.js} +0 -0
  539. /package/dist/{lua-CgXfrp2-.js → lua-BbDC0_5w.js} +0 -0
  540. /package/dist/{mathematica-BVli92MR.js → mathematica-YZTe3-PF.js} +0 -0
  541. /package/dist/{mbox-CMFlocdS.js → mbox-CY5idp08.js} +0 -0
  542. /package/dist/{mirc-BkW04Zpc.js → mirc-CbQuFZKk.js} +0 -0
  543. /package/dist/{mllike-DEjvHvNV.js → mllike-DsbHMX-5.js} +0 -0
  544. /package/dist/{modelica-CxDn-oje.js → modelica-CQuvsOQk.js} +0 -0
  545. /package/dist/{mscgen-D78wmE-w.js → mscgen-LIpBP9VR.js} +0 -0
  546. /package/dist/{mumps-Bi0IvPOV.js → mumps-Ct5NXoaG.js} +0 -0
  547. /package/dist/{nginx-DErPZFhX.js → nginx-Dvc62C8z.js} +0 -0
  548. /package/dist/{ntriples-Btyp6wRL.js → ntriples-jVkxWUuv.js} +0 -0
  549. /package/dist/{octave-CZA6-2F8.js → octave-jGOImUB0.js} +0 -0
  550. /package/dist/{oz-Bm6LSNfE.js → oz-Y0FKDMS2.js} +0 -0
  551. /package/dist/{pascal-B4J6a9BH.js → pascal-BaLtPWWB.js} +0 -0
  552. /package/dist/{perl-CzVqxS08.js → perl-CjfE0JLo.js} +0 -0
  553. /package/dist/{pig-Clh03cnn.js → pig-DE4epV99.js} +0 -0
  554. /package/dist/{properties-D7ch1Wyb.js → properties-CLyCG5C-.js} +0 -0
  555. /package/dist/{protobuf-DrkdrMPK.js → protobuf-BjBBs_V4.js} +0 -0
  556. /package/dist/{puppet-BtZG8zdO.js → puppet-ZImLuomA.js} +0 -0
  557. /package/dist/{python-B6FKOVIv.js → python-C9YN71pR.js} +0 -0
  558. /package/dist/{r-Dnvo5-96.js → r-DILmKWWW.js} +0 -0
  559. /package/dist/{rpm-B1DrgfnX.js → rpm-fpIsm1Kr.js} +0 -0
  560. /package/dist/{ruby-CelfUg17.js → ruby-BuiQI41h.js} +0 -0
  561. /package/dist/{sas-DfSQFMWG.js → sas-C76sJ1zF.js} +0 -0
  562. /package/dist/{scheme-BplhaWuO.js → scheme-DHjM-txv.js} +0 -0
  563. /package/dist/{shell-DqU5OS2c.js → shell--7NmGJ9p.js} +0 -0
  564. /package/dist/{sieve-BE4_IyGa.js → sieve-DaPvBv1M.js} +0 -0
  565. /package/dist/{smalltalk-B_WPL8Nx.js → smalltalk-KPvwrjCs.js} +0 -0
  566. /package/dist/{solr-DlJFg7H5.js → solr-PvZUtEDb.js} +0 -0
  567. /package/dist/{sparql-7XIlcOgW.js → sparql-CXSUIQer.js} +0 -0
  568. /package/dist/{spreadsheet-BdZSVwVp.js → spreadsheet-DPJdGPkx.js} +0 -0
  569. /package/dist/{sql-CCrq7lfJ.js → sql-Dp4ZLSIa.js} +0 -0
  570. /package/dist/{stex-BiFc8QAu.js → stex-CeXW4zzk.js} +0 -0
  571. /package/dist/{stylus-DlSH9xpH.js → stylus-BXcmrg9w.js} +0 -0
  572. /package/dist/{swift-e3tMTZgJ.js → swift-DD8I7hKP.js} +0 -0
  573. /package/dist/{tcl-DfZMC20G.js → tcl-B9Lp4GtA.js} +0 -0
  574. /package/dist/{textile-DaSeca5U.js → textile-qdiY0teq.js} +0 -0
  575. /package/dist/{tiddlywiki-dfoiz8pS.js → tiddlywiki-t32lkubq.js} +0 -0
  576. /package/dist/{tiki-yJbQzhma.js → tiki-B0qKrSMl.js} +0 -0
  577. /package/dist/{troff-FN_FrCXR.js → troff-105XJOEu.js} +0 -0
  578. /package/dist/{ttcn-7_i4HlyB.js → ttcn-1_BxDcM8.js} +0 -0
  579. /package/dist/{ttcn-cfg-B46AlBUV.js → ttcn-cfg-Cn_XgXiw.js} +0 -0
  580. /package/dist/{turtle-QQfeFveR.js → turtle-BI6LyfEu.js} +0 -0
  581. /package/dist/{vb-DToPVnLa.js → vb-BecoBfmr.js} +0 -0
  582. /package/dist/{vbscript-CtsNaTz4.js → vbscript-De-zpA4i.js} +0 -0
  583. /package/dist/{velocity-CAoNe6ns.js → velocity-DhlYJTrD.js} +0 -0
  584. /package/dist/{verilog-DrDOMiJq.js → verilog-BDZgxDOW.js} +0 -0
  585. /package/dist/{vhdl-DnO0OEPh.js → vhdl-CV0OKTbp.js} +0 -0
  586. /package/dist/{webidl-Or6d1ZfA.js → webidl-BOM1Fs0O.js} +0 -0
  587. /package/dist/{xquery-CEp_Mcpr.js → xquery-CltP_CGh.js} +0 -0
  588. /package/dist/{yacas-DgnYrSlp.js → yacas-Dch4E2Dg.js} +0 -0
  589. /package/dist/{z80-DlG_kyeB.js → z80-B5Yly27o.js} +0 -0
@@ -1,268 +1,267 @@
1
1
  import { s as __toESM } from "./chunk-DgPTj83v.js";
2
2
  import { t as require_react } from "./react-DHL_F5hS.js";
3
3
  import { n as require_compiler_runtime, t as require_jsx_runtime } from "./jsx-runtime-DZyWJV5b.js";
4
- import { n as Copy, r as toast, t as copyToClipboard } from "./copy-C5RFg7ok.js";
5
- import { t as Check } from "./check-BK9zDfQk.js";
6
- import { d as cn, u as Events } from "./button-CEcjneWG.js";
7
- import { c as Tooltip } from "./error-banner-OQIGTqFR.js";
8
- 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-DPF5TTUg.js";
9
- import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-CxD5E6Sh.js";
10
- import { i as markdown } from "./dist-DW9er3Zq.js";
11
- import { n as html, r as htmlCompletionSource } from "./dist-CdE2C2In.js";
12
- import { r as cssLanguage, t as css } from "./dist-BEvIw5Nh.js";
13
- import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-CUnh_3Ii.js";
14
- import { r as python } from "./dist-C3WYsf4K.js";
15
- import { t as stex } from "./stex-BiFc8QAu.js";
16
- import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-C7ASiFxI.js";
17
- import { t as cpp } from "./dist-BQmQQqFH.js";
18
- import { t as go } from "./dist-Cib4sGDA.js";
19
- import { t as java } from "./dist-BBlFk9ki.js";
20
- import { t as json } from "./dist-CutXTm8t.js";
21
- import { t as less } from "./dist-elblfNXO.js";
22
- import { n as liquid } from "./dist-CGIZPq3J.js";
23
- import { t as php } from "./dist-DNnYAdRE.js";
24
- import { t as rust } from "./dist-DL_ci7Yc.js";
25
- import { t as sass } from "./dist-DzOpMdwb.js";
26
- import { t as wast } from "./dist-BZBitvuL.js";
27
- import { r as xml } from "./dist-JCAky9ND.js";
28
- import { t as yaml } from "./dist-CLvpViod.js";
29
- import { t as apl } from "./apl-DZqo8Elt.js";
30
- import { t as asciiArmor } from "./asciiarmor-DTzHAIeX.js";
31
- import { t as asn1 } from "./asn1-DrAXKsZH.js";
32
- import { t as brainfuck } from "./brainfuck-BYgLey30.js";
33
- import { t as cobol } from "./cobol-BQyrWo72.js";
34
- import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-Cg_DBrJ0.js";
35
- import { t as clojure } from "./clojure-Bs2M3OUY.js";
36
- import { t as gss } from "./css-BzTU9lNO.js";
37
- import { t as cmake } from "./cmake-DpI8vxJN.js";
38
- import { t as coffeeScript } from "./coffeescript-9ke9UHmw.js";
39
- import { t as commonLisp } from "./commonlisp-DghUdrUH.js";
40
- import { t as cypher } from "./cypher-a2v0c11S.js";
41
- import { t as cython } from "./python-B6FKOVIv.js";
42
- import { t as crystal } from "./crystal-DEf_SInh.js";
43
- import { t as d } from "./d-SAswny-M.js";
44
- import { t as diff } from "./diff-OJ-xLXcG.js";
45
- import { t as dtd } from "./dtd-BsUf-rer.js";
46
- import { t as dylan } from "./dylan-C0ZYngjn.js";
47
- import { t as ecl } from "./ecl-Bsuvoouq.js";
48
- import { t as eiffel } from "./eiffel-DgfSpLi-.js";
49
- import { t as elm } from "./elm-GNxDj-5E.js";
50
- import { t as erlang } from "./erlang-Ds3uY1kL.js";
51
- import { t as factor } from "./factor-CdgiDGiu.js";
52
- import { t as forth } from "./forth-JCaLysGk.js";
53
- import { t as fortran } from "./fortran-Dc2AoKAl.js";
54
- import { n as oCaml, r as sml, t as fSharp } from "./mllike-DEjvHvNV.js";
55
- import { t as gas } from "./gas-Q4Uz82YW.js";
56
- import { t as gherkin } from "./gherkin-Dpxe49sQ.js";
57
- import { t as groovy } from "./groovy-D8mTRCu6.js";
58
- import { t as haskell } from "./haskell-2_8cC4wY.js";
59
- import { n as hxml, t as haxe } from "./haxe-Bl9zkZlz.js";
60
- import { t as idl } from "./idl-Dn-HNfGW.js";
61
- import { n as jsonld } from "./javascript-Dfq1qI35.js";
62
- import { t as jinja2 } from "./jinja2-JjFiAGKk.js";
63
- import { t as julia } from "./julia-R5wne8eu.js";
64
- import { t as liveScript } from "./livescript-DSwokrYj.js";
65
- import { t as lua } from "./lua-CgXfrp2-.js";
66
- import { t as mirc } from "./mirc-BkW04Zpc.js";
67
- import { t as mathematica } from "./mathematica-BVli92MR.js";
68
- import { t as modelica } from "./modelica-CxDn-oje.js";
69
- import { t as mumps } from "./mumps-Bi0IvPOV.js";
70
- import { t as mbox } from "./mbox-CMFlocdS.js";
71
- import { t as nsis } from "./nsis-BW6_XagK.js";
72
- import { t as ntriples } from "./ntriples-Btyp6wRL.js";
73
- import { t as octave } from "./octave-CZA6-2F8.js";
74
- import { t as oz } from "./oz-Bm6LSNfE.js";
75
- import { t as pascal } from "./pascal-B4J6a9BH.js";
76
- import { t as perl } from "./perl-CzVqxS08.js";
77
- import { t as pig } from "./pig-Clh03cnn.js";
78
- import { t as powerShell } from "./powershell-3rK_nRRJ.js";
79
- import { t as properties } from "./properties-D7ch1Wyb.js";
80
- import { t as protobuf } from "./protobuf-DrkdrMPK.js";
81
- import { t as pug } from "./pug-Bmups_z0.js";
82
- import { t as puppet } from "./puppet-BtZG8zdO.js";
83
- import { t as q } from "./q-BzWcnVri.js";
84
- import { t as r } from "./r-Dnvo5-96.js";
85
- import { n as rpmSpec } from "./rpm-B1DrgfnX.js";
86
- import { t as ruby } from "./ruby-CelfUg17.js";
87
- import { t as sas } from "./sas-DfSQFMWG.js";
88
- import { t as scheme } from "./scheme-BplhaWuO.js";
89
- import { t as shell } from "./shell-DqU5OS2c.js";
90
- import { t as sieve } from "./sieve-BE4_IyGa.js";
91
- import { t as smalltalk } from "./smalltalk-B_WPL8Nx.js";
92
- import { t as sparql } from "./sparql-7XIlcOgW.js";
93
- import { t as stylus } from "./stylus-DlSH9xpH.js";
94
- import { t as swift } from "./swift-e3tMTZgJ.js";
95
- import { t as verilog } from "./verilog-DrDOMiJq.js";
96
- import { t as tcl } from "./tcl-DfZMC20G.js";
97
- import { t as textile } from "./textile-DaSeca5U.js";
98
- import { t as toml } from "./toml-CIUkU1CP.js";
99
- import { t as troff } from "./troff-FN_FrCXR.js";
100
- import { t as ttcn } from "./ttcn-7_i4HlyB.js";
101
- import { t as ttcnCfg } from "./ttcn-cfg-B46AlBUV.js";
102
- import { t as turtle } from "./turtle-QQfeFveR.js";
103
- import { t as webIDL } from "./webidl-Or6d1ZfA.js";
104
- import { t as vb } from "./vb-DToPVnLa.js";
105
- import { t as vbScript } from "./vbscript-CtsNaTz4.js";
106
- import { t as velocity } from "./velocity-CAoNe6ns.js";
107
- import { t as vhdl } from "./vhdl-DnO0OEPh.js";
108
- import { t as xQuery } from "./xquery-CEp_Mcpr.js";
109
- import { t as yacas } from "./yacas-DgnYrSlp.js";
110
- import { t as z80 } from "./z80-DlG_kyeB.js";
111
- import { n as msgenny, r as xu, t as mscgen } from "./mscgen-D78wmE-w.js";
112
- import { t as vue } from "./dist-Bar1QnNM.js";
4
+ import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BkZ8PkBM.js";
5
+ import { t as Check } from "./check-D7ifz5op.js";
6
+ import { d as cn, u as Events } from "./button-DcnBVpVa.js";
7
+ import { c as Tooltip } from "./error-banner-npbEfanI.js";
8
+ 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-z_iuDES7.js";
9
+ import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-C7zhQ7K0.js";
10
+ import { i as markdown } from "./dist-d5NxvX2s.js";
11
+ import { n as html, r as htmlCompletionSource } from "./dist-2Ne-33Xy.js";
12
+ import { r as cssLanguage, t as css } from "./dist-RwqAqkpG.js";
13
+ import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-CYhQCVru.js";
14
+ import { r as python } from "./dist-PGgOcwbF.js";
15
+ import { t as stex } from "./stex-CeXW4zzk.js";
16
+ import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-DMxl6Qbu.js";
17
+ import { t as cpp } from "./dist-BpzZrRd6.js";
18
+ import { t as go } from "./dist-reo2kYlN.js";
19
+ import { t as java } from "./dist-CZq5-ZyD.js";
20
+ import { t as json } from "./dist-DBhEu3-F.js";
21
+ import { t as less } from "./dist-Cacac5HV.js";
22
+ import { n as liquid } from "./dist-BFkr6kAQ.js";
23
+ import { t as php } from "./dist-RdxOJbBw.js";
24
+ import { t as rust } from "./dist-BL2DSY0P.js";
25
+ import { t as sass } from "./dist-NUdHX0XE.js";
26
+ import { t as wast } from "./dist-wHVprCkn.js";
27
+ import { r as xml } from "./dist-CkvGMBAS.js";
28
+ import { t as yaml } from "./dist-DS6nuHYK.js";
29
+ import { t as apl } from "./apl-CEHentF4.js";
30
+ import { t as asciiArmor } from "./asciiarmor-DURYiCS0.js";
31
+ import { t as asn1 } from "./asn1-ETAiEoXY.js";
32
+ import { t as brainfuck } from "./brainfuck-BWQep-SA.js";
33
+ import { t as cobol } from "./cobol-BrEI4cPR.js";
34
+ import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-bzZTreP4.js";
35
+ import { t as clojure } from "./clojure-BzFapDkA.js";
36
+ import { t as gss } from "./css-dHbnt_zl.js";
37
+ import { t as cmake } from "./cmake-DvlbIC8x.js";
38
+ import { t as coffeeScript } from "./coffeescript-B6cvu8mO.js";
39
+ import { t as commonLisp } from "./commonlisp-BIT8PQqi.js";
40
+ import { t as cypher } from "./cypher-Dh3FOpL7.js";
41
+ import { t as cython } from "./python-C9YN71pR.js";
42
+ import { t as crystal } from "./crystal-B_UcPArT.js";
43
+ import { t as d } from "./d-CQD1IHee.js";
44
+ import { t as diff } from "./diff-CpF_IDx0.js";
45
+ import { t as dtd } from "./dtd-DYoNpy6c.js";
46
+ import { t as dylan } from "./dylan-Bc_2G1E-.js";
47
+ import { t as ecl } from "./ecl-UIU-P-Ar.js";
48
+ import { t as eiffel } from "./eiffel-C90Oyuix.js";
49
+ import { t as elm } from "./elm-B9fWSySj.js";
50
+ import { t as erlang } from "./erlang-Ccff0UAn.js";
51
+ import { t as factor } from "./factor-CRFTmP_a.js";
52
+ import { t as forth } from "./forth-U1ROGcBY.js";
53
+ import { t as fortran } from "./fortran-3nOkjDmc.js";
54
+ import { n as oCaml, r as sml, t as fSharp } from "./mllike-DsbHMX-5.js";
55
+ import { t as gas } from "./gas-B_4H5FzV.js";
56
+ import { t as gherkin } from "./gherkin-B0eru5Uz.js";
57
+ import { t as groovy } from "./groovy-dqjtZUVf.js";
58
+ import { t as haskell } from "./haskell-DFzCCQzo.js";
59
+ import { n as hxml, t as haxe } from "./haxe-Da8Pj5RT.js";
60
+ import { t as idl } from "./idl-D3NXs5iM.js";
61
+ import { n as jsonld } from "./javascript-BfCTmOnk.js";
62
+ import { t as jinja2 } from "./jinja2-gBHAxUdF.js";
63
+ import { t as julia } from "./julia-bG-6nJ-_.js";
64
+ import { t as liveScript } from "./livescript-BlsRC8UJ.js";
65
+ import { t as lua } from "./lua-BbDC0_5w.js";
66
+ import { t as mirc } from "./mirc-CbQuFZKk.js";
67
+ import { t as mathematica } from "./mathematica-YZTe3-PF.js";
68
+ import { t as modelica } from "./modelica-CQuvsOQk.js";
69
+ import { t as mumps } from "./mumps-Ct5NXoaG.js";
70
+ import { t as mbox } from "./mbox-CY5idp08.js";
71
+ import { t as nsis } from "./nsis-BWJEeUyS.js";
72
+ import { t as ntriples } from "./ntriples-jVkxWUuv.js";
73
+ import { t as octave } from "./octave-jGOImUB0.js";
74
+ import { t as oz } from "./oz-Y0FKDMS2.js";
75
+ import { t as pascal } from "./pascal-BaLtPWWB.js";
76
+ import { t as perl } from "./perl-CjfE0JLo.js";
77
+ import { t as pig } from "./pig-DE4epV99.js";
78
+ import { t as powerShell } from "./powershell-BZx53Ujw.js";
79
+ import { t as properties } from "./properties-CLyCG5C-.js";
80
+ import { t as protobuf } from "./protobuf-BjBBs_V4.js";
81
+ import { t as pug } from "./pug-PJh82u1M.js";
82
+ import { t as puppet } from "./puppet-ZImLuomA.js";
83
+ import { t as q } from "./q-CMoUHJ5Q.js";
84
+ import { t as r } from "./r-DILmKWWW.js";
85
+ import { n as rpmSpec } from "./rpm-fpIsm1Kr.js";
86
+ import { t as ruby } from "./ruby-BuiQI41h.js";
87
+ import { t as sas } from "./sas-C76sJ1zF.js";
88
+ import { t as scheme } from "./scheme-DHjM-txv.js";
89
+ import { t as shell } from "./shell--7NmGJ9p.js";
90
+ import { t as sieve } from "./sieve-DaPvBv1M.js";
91
+ import { t as smalltalk } from "./smalltalk-KPvwrjCs.js";
92
+ import { t as sparql } from "./sparql-CXSUIQer.js";
93
+ import { t as stylus } from "./stylus-BXcmrg9w.js";
94
+ import { t as swift } from "./swift-DD8I7hKP.js";
95
+ import { t as verilog } from "./verilog-BDZgxDOW.js";
96
+ import { t as tcl } from "./tcl-B9Lp4GtA.js";
97
+ import { t as textile } from "./textile-qdiY0teq.js";
98
+ import { t as toml } from "./toml-eSl4PUAH.js";
99
+ import { t as troff } from "./troff-105XJOEu.js";
100
+ import { t as ttcn } from "./ttcn-1_BxDcM8.js";
101
+ import { t as ttcnCfg } from "./ttcn-cfg-Cn_XgXiw.js";
102
+ import { t as turtle } from "./turtle-BI6LyfEu.js";
103
+ import { t as webIDL } from "./webidl-BOM1Fs0O.js";
104
+ import { t as vb } from "./vb-BecoBfmr.js";
105
+ import { t as vbScript } from "./vbscript-De-zpA4i.js";
106
+ import { t as velocity } from "./velocity-DhlYJTrD.js";
107
+ import { t as vhdl } from "./vhdl-CV0OKTbp.js";
108
+ import { t as xQuery } from "./xquery-CltP_CGh.js";
109
+ import { t as yacas } from "./yacas-Dch4E2Dg.js";
110
+ import { t as z80 } from "./z80-B5Yly27o.js";
111
+ import { n as msgenny, r as xu, t as mscgen } from "./mscgen-LIpBP9VR.js";
112
+ import { t as vue } from "./dist-BhVFggab.js";
113
113
  var import_compiler_runtime = /* @__PURE__ */ __toESM(require_compiler_runtime()), import_react = /* @__PURE__ */ __toESM(require_react()), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
114
114
  const CopyClipboardIcon = (e6) => {
115
- let _ = (0, import_compiler_runtime.c)(12), { value: v, className: y, tooltip: D, toastTitle: O } = e6, [k, A] = (0, import_react.useState)(false), j;
116
- _[0] !== O || _[1] !== v ? (j = Events.stopPropagation(async () => {
117
- let e7 = typeof v == "function" ? v() : v;
118
- await copyToClipboard(e7).then(() => {
119
- A(true), setTimeout(() => A(false), 2e3), O && toast({ title: O });
115
+ let y = (0, import_compiler_runtime.c)(13), { value: b, className: x, tooltip: k, toastTitle: A, ariaLabel: j } = e6, [M, N] = (0, import_react.useState)(false), P;
116
+ y[0] !== A || y[1] !== b ? (P = Events.stopPropagation(async (e7) => {
117
+ await copyToClipboard(typeof b == "function" ? b(e7) : b).then(() => {
118
+ N(true), setTimeout(() => N(false), 2e3), A && toast({ title: A });
120
119
  });
121
- }), _[0] = O, _[1] = v, _[2] = j) : j = _[2];
122
- let M = j, N;
123
- _[3] !== y || _[4] !== k ? (N = k ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(y, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: y }), _[3] = y, _[4] = k, _[5] = N) : N = _[5];
124
- let P;
125
- _[6] !== M || _[7] !== N ? (P = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
120
+ }), y[0] = A, y[1] = b, y[2] = P) : P = y[2];
121
+ let F = P, I = j ?? "Copy to clipboard", L;
122
+ y[3] !== x || y[4] !== M ? (L = M ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(x, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: x }), y[3] = x, y[4] = M, y[5] = L) : L = y[5];
123
+ let R;
124
+ y[6] !== F || y[7] !== I || y[8] !== L ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
126
125
  type: "button",
127
- onClick: M,
128
- "aria-label": "Copy to clipboard",
129
- children: N
130
- }), _[6] = M, _[7] = N, _[8] = P) : P = _[8];
131
- let F = P;
132
- if (D === false) return F;
133
- let I = k ? "Copied!" : D ?? "Copy to clipboard", L;
134
- return _[9] !== F || _[10] !== I ? (L = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
135
- content: I,
126
+ onClick: F,
127
+ "aria-label": I,
128
+ children: L
129
+ }), y[6] = F, y[7] = I, y[8] = L, y[9] = R) : R = y[9];
130
+ let z = R;
131
+ if (k === false) return z;
132
+ let B = M ? "Copied!" : k ?? "Copy to clipboard", V;
133
+ return y[10] !== z || y[11] !== B ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
134
+ content: B,
136
135
  delayDuration: 400,
137
- children: F
138
- }), _[9] = F, _[10] = I, _[11] = L) : L = _[11], L;
136
+ children: z
137
+ }), y[10] = z, y[11] = B, y[12] = V) : V = y[12], V;
139
138
  };
140
139
  var toggleComment = (e6) => {
141
- let { state: _ } = e6, v = _.doc.lineAt(_.selection.main.from), y = getConfig(e6.state, v.from);
142
- return y.line ? toggleLineComment(e6) : y.block ? toggleBlockCommentByLine(e6) : false;
140
+ let { state: y } = e6, b = y.doc.lineAt(y.selection.main.from), x = getConfig(e6.state, b.from);
141
+ return x.line ? toggleLineComment(e6) : x.block ? toggleBlockCommentByLine(e6) : false;
143
142
  };
144
- function command(e6, _) {
145
- return ({ state: v, dispatch: y }) => {
146
- if (v.readOnly) return false;
147
- let b = e6(_, v);
148
- return b ? (y(v.update(b)), true) : false;
143
+ function command(e6, y) {
144
+ return ({ state: b, dispatch: x }) => {
145
+ if (b.readOnly) return false;
146
+ let S = e6(y, b);
147
+ return S ? (x(b.update(S)), true) : false;
149
148
  };
150
149
  }
151
- var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6, _) => changeBlockComment(e6, _, selectedLineRanges(_)), 0);
152
- function getConfig(e6, _) {
153
- let v = e6.languageDataAt("commentTokens", _, 1);
154
- return v.length ? v[0] : {};
150
+ var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6, y) => changeBlockComment(e6, y, selectedLineRanges(y)), 0);
151
+ function getConfig(e6, y) {
152
+ let b = e6.languageDataAt("commentTokens", y, 1);
153
+ return b.length ? b[0] : {};
155
154
  }
156
155
  var SearchMargin = 50;
157
- function findBlockComment(e6, { open: _, close: v }, y, b) {
158
- let x = e6.sliceDoc(y - SearchMargin, y), S = e6.sliceDoc(b, b + SearchMargin), C = /\s*$/.exec(x)[0].length, w = /^\s*/.exec(S)[0].length, T = x.length - C;
159
- if (x.slice(T - _.length, T) == _ && S.slice(w, w + v.length) == v) return {
156
+ function findBlockComment(e6, { open: y, close: b }, x, S) {
157
+ 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;
158
+ if (C.slice(D - y.length, D) == y && w.slice(E, E + b.length) == b) return {
160
159
  open: {
161
- pos: y - C,
162
- margin: C && 1
160
+ pos: x - T,
161
+ margin: T && 1
163
162
  },
164
163
  close: {
165
- pos: b + w,
166
- margin: w && 1
164
+ pos: S + E,
165
+ margin: E && 1
167
166
  }
168
167
  };
169
- let E, D;
170
- b - y <= 2 * SearchMargin ? E = D = e6.sliceDoc(y, b) : (E = e6.sliceDoc(y, y + SearchMargin), D = e6.sliceDoc(b - SearchMargin, b));
171
- let O = /^\s*/.exec(E)[0].length, k = /\s*$/.exec(D)[0].length, A = D.length - k - v.length;
172
- return E.slice(O, O + _.length) == _ && D.slice(A, A + v.length) == v ? {
168
+ let O, k;
169
+ S - x <= 2 * SearchMargin ? O = k = e6.sliceDoc(x, S) : (O = e6.sliceDoc(x, x + SearchMargin), k = e6.sliceDoc(S - SearchMargin, S));
170
+ let A = /^\s*/.exec(O)[0].length, j = /\s*$/.exec(k)[0].length, M = k.length - j - b.length;
171
+ return O.slice(A, A + y.length) == y && k.slice(M, M + b.length) == b ? {
173
172
  open: {
174
- pos: y + O + _.length,
175
- margin: /\s/.test(E.charAt(O + _.length)) ? 1 : 0
173
+ pos: x + A + y.length,
174
+ margin: /\s/.test(O.charAt(A + y.length)) ? 1 : 0
176
175
  },
177
176
  close: {
178
- pos: b - k - v.length,
179
- margin: /\s/.test(D.charAt(A - 1)) ? 1 : 0
177
+ pos: S - j - b.length,
178
+ margin: /\s/.test(k.charAt(M - 1)) ? 1 : 0
180
179
  }
181
180
  } : null;
182
181
  }
183
182
  function selectedLineRanges(e6) {
184
- let _ = [];
185
- for (let v of e6.selection.ranges) {
186
- let y = e6.doc.lineAt(v.from), b = v.to <= y.to ? y : e6.doc.lineAt(v.to);
187
- b.from > y.from && b.from == v.to && (b = v.to == y.to + 1 ? y : e6.doc.lineAt(v.to - 1));
188
- let x = _.length - 1;
189
- x >= 0 && _[x].to > y.from ? _[x].to = b.to : _.push({
190
- from: y.from + /^\s*/.exec(y.text)[0].length,
191
- to: b.to
183
+ let y = [];
184
+ for (let b of e6.selection.ranges) {
185
+ let x = e6.doc.lineAt(b.from), S = b.to <= x.to ? x : e6.doc.lineAt(b.to);
186
+ S.from > x.from && S.from == b.to && (S = b.to == x.to + 1 ? x : e6.doc.lineAt(b.to - 1));
187
+ let C = y.length - 1;
188
+ C >= 0 && y[C].to > x.from ? y[C].to = S.to : y.push({
189
+ from: x.from + /^\s*/.exec(x.text)[0].length,
190
+ to: S.to
192
191
  });
193
192
  }
194
- return _;
193
+ return y;
195
194
  }
196
- function changeBlockComment(e6, _, v = _.selection.ranges) {
197
- let y = v.map((e7) => getConfig(_, e7.from).block);
198
- if (!y.every((e7) => e7)) return null;
199
- let b = v.map((e7, v2) => findBlockComment(_, y[v2], e7.from, e7.to));
200
- if (e6 != 2 && !b.every((e7) => e7)) return { changes: _.changes(v.map((e7, _2) => b[_2] ? [] : [{
195
+ function changeBlockComment(e6, y, b = y.selection.ranges) {
196
+ let x = b.map((e7) => getConfig(y, e7.from).block);
197
+ if (!x.every((e7) => e7)) return null;
198
+ let S = b.map((e7, b2) => findBlockComment(y, x[b2], e7.from, e7.to));
199
+ if (e6 != 2 && !S.every((e7) => e7)) return { changes: y.changes(b.map((e7, y2) => S[y2] ? [] : [{
201
200
  from: e7.from,
202
- insert: y[_2].open + " "
201
+ insert: x[y2].open + " "
203
202
  }, {
204
203
  from: e7.to,
205
- insert: " " + y[_2].close
204
+ insert: " " + x[y2].close
206
205
  }])) };
207
- if (e6 != 1 && b.some((e7) => e7)) {
206
+ if (e6 != 1 && S.some((e7) => e7)) {
208
207
  let e7 = [];
209
- for (let _2 = 0, v2; _2 < b.length; _2++) if (v2 = b[_2]) {
210
- let b2 = y[_2], { open: x, close: S } = v2;
208
+ for (let y2 = 0, b2; y2 < S.length; y2++) if (b2 = S[y2]) {
209
+ let S2 = x[y2], { open: C, close: w } = b2;
211
210
  e7.push({
212
- from: x.pos - b2.open.length,
213
- to: x.pos + x.margin
211
+ from: C.pos - S2.open.length,
212
+ to: C.pos + C.margin
214
213
  }, {
215
- from: S.pos - S.margin,
216
- to: S.pos + b2.close.length
214
+ from: w.pos - w.margin,
215
+ to: w.pos + S2.close.length
217
216
  });
218
217
  }
219
218
  return { changes: e7 };
220
219
  }
221
220
  return null;
222
221
  }
223
- function changeLineComment(e6, _, v = _.selection.ranges) {
224
- let y = [], b = -1;
225
- for (let { from: e7, to: x } of v) {
226
- let v2 = y.length, S = 1e9, C = getConfig(_, e7).line;
227
- if (C) {
228
- for (let v3 = e7; v3 <= x; ) {
229
- let w = _.doc.lineAt(v3);
230
- if (w.from > b && (e7 == x || x > w.from)) {
231
- b = w.from;
232
- let e8 = /^\s*/.exec(w.text)[0].length, _2 = e8 == w.length, v4 = w.text.slice(e8, e8 + C.length) == C ? e8 : -1;
233
- e8 < w.text.length && e8 < S && (S = e8), y.push({
234
- line: w,
235
- comment: v4,
236
- token: C,
222
+ function changeLineComment(e6, y, b = y.selection.ranges) {
223
+ let x = [], S = -1;
224
+ for (let { from: e7, to: C } of b) {
225
+ let b2 = x.length, w = 1e9, T = getConfig(y, e7).line;
226
+ if (T) {
227
+ for (let b3 = e7; b3 <= C; ) {
228
+ let E = y.doc.lineAt(b3);
229
+ if (E.from > S && (e7 == C || C > E.from)) {
230
+ S = E.from;
231
+ let e8 = /^\s*/.exec(E.text)[0].length, y2 = e8 == E.length, b4 = E.text.slice(e8, e8 + T.length) == T ? e8 : -1;
232
+ e8 < E.text.length && e8 < w && (w = e8), x.push({
233
+ line: E,
234
+ comment: b4,
235
+ token: T,
237
236
  indent: e8,
238
- empty: _2,
237
+ empty: y2,
239
238
  single: false
240
239
  });
241
240
  }
242
- v3 = w.to + 1;
241
+ b3 = E.to + 1;
243
242
  }
244
- if (S < 1e9) for (let e8 = v2; e8 < y.length; e8++) y[e8].indent < y[e8].line.text.length && (y[e8].indent = S);
245
- y.length == v2 + 1 && (y[v2].single = true);
243
+ if (w < 1e9) for (let e8 = b2; e8 < x.length; e8++) x[e8].indent < x[e8].line.text.length && (x[e8].indent = w);
244
+ x.length == b2 + 1 && (x[b2].single = true);
246
245
  }
247
246
  }
248
- if (e6 != 2 && y.some((e7) => e7.comment < 0 && (!e7.empty || e7.single))) {
247
+ if (e6 != 2 && x.some((e7) => e7.comment < 0 && (!e7.empty || e7.single))) {
249
248
  let e7 = [];
250
- for (let { line: _2, token: v3, indent: b2, empty: x, single: S } of y) (S || !x) && e7.push({
251
- from: _2.from + b2,
252
- insert: v3 + " "
249
+ for (let { line: y2, token: b3, indent: S2, empty: C, single: w } of x) (w || !C) && e7.push({
250
+ from: y2.from + S2,
251
+ insert: b3 + " "
253
252
  });
254
- let v2 = _.changes(e7);
253
+ let b2 = y.changes(e7);
255
254
  return {
256
- changes: v2,
257
- selection: _.selection.map(v2, 1)
255
+ changes: b2,
256
+ selection: y.selection.map(b2, 1)
258
257
  };
259
- } else if (e6 != 1 && y.some((e7) => e7.comment >= 0)) {
258
+ } else if (e6 != 1 && x.some((e7) => e7.comment >= 0)) {
260
259
  let e7 = [];
261
- for (let { line: _2, comment: v2, token: b2 } of y) if (v2 >= 0) {
262
- let y2 = _2.from + v2, x = y2 + b2.length;
263
- _2.text[x - _2.from] == " " && x++, e7.push({
264
- from: y2,
265
- to: x
260
+ for (let { line: y2, comment: b2, token: S2 } of x) if (b2 >= 0) {
261
+ let x2 = y2.from + b2, C = x2 + S2.length;
262
+ y2.text[C - y2.from] == " " && C++, e7.push({
263
+ from: x2,
264
+ to: C
266
265
  });
267
266
  }
268
267
  return { changes: e7 };
@@ -273,26 +272,26 @@ var fromHistory = /* @__PURE__ */ Annotation.define(), isolateHistory = /* @__PU
273
272
  return combineConfig(e6, {
274
273
  minDepth: 100,
275
274
  newGroupDelay: 500,
276
- joinToEvent: (e7, _) => _
275
+ joinToEvent: (e7, y) => y
277
276
  }, {
278
277
  minDepth: Math.max,
279
278
  newGroupDelay: Math.min,
280
- joinToEvent: (e7, _) => (v, y) => e7(v, y) || _(v, y)
279
+ joinToEvent: (e7, y) => (b, x) => e7(b, x) || y(b, x)
281
280
  });
282
281
  } }), historyField_ = /* @__PURE__ */ StateField.define({
283
282
  create() {
284
283
  return HistoryState.empty;
285
284
  },
286
- update(e6, _) {
287
- let v = _.state.facet(historyConfig), y = _.annotation(fromHistory);
288
- if (y) {
289
- let b2 = HistEvent.fromTransaction(_, y.selection), x2 = y.side, S2 = x2 == 0 ? e6.undone : e6.done;
290
- return S2 = b2 ? updateBranch(S2, S2.length, v.minDepth, b2) : addSelection(S2, _.startState.selection), new HistoryState(x2 == 0 ? y.rest : S2, x2 == 0 ? S2 : y.rest);
285
+ update(e6, y) {
286
+ let b = y.state.facet(historyConfig), x = y.annotation(fromHistory);
287
+ if (x) {
288
+ let S2 = HistEvent.fromTransaction(y, x.selection), C2 = x.side, w2 = C2 == 0 ? e6.undone : e6.done;
289
+ 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);
291
290
  }
292
- let b = _.annotation(isolateHistory);
293
- if ((b == "full" || b == "before") && (e6 = e6.isolate()), _.annotation(Transaction.addToHistory) === false) return _.changes.empty ? e6 : e6.addMapping(_.changes.desc);
294
- let x = HistEvent.fromTransaction(_), S = _.annotation(Transaction.time), C = _.annotation(Transaction.userEvent);
295
- return x ? e6 = e6.addChanges(x, S, C, v, _) : _.selection && (e6 = e6.addSelection(_.startState.selection, S, C, v.newGroupDelay)), (b == "full" || b == "after") && (e6 = e6.isolate()), e6;
291
+ let S = y.annotation(isolateHistory);
292
+ if ((S == "full" || S == "before") && (e6 = e6.isolate()), y.annotation(Transaction.addToHistory) === false) return y.changes.empty ? e6 : e6.addMapping(y.changes.desc);
293
+ let C = HistEvent.fromTransaction(y), w = y.annotation(Transaction.time), T = y.annotation(Transaction.userEvent);
294
+ 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;
296
295
  },
297
296
  toJSON(e6) {
298
297
  return {
@@ -308,28 +307,28 @@ function history(e6 = {}) {
308
307
  return [
309
308
  historyField_,
310
309
  historyConfig.of(e6),
311
- EditorView.domEventHandlers({ beforeinput(e7, _) {
312
- let v = e7.inputType == "historyUndo" ? undo : e7.inputType == "historyRedo" ? redo : null;
313
- return v ? (e7.preventDefault(), v(_)) : false;
310
+ EditorView.domEventHandlers({ beforeinput(e7, y) {
311
+ let b = e7.inputType == "historyUndo" ? undo : e7.inputType == "historyRedo" ? redo : null;
312
+ return b ? (e7.preventDefault(), b(y)) : false;
314
313
  } })
315
314
  ];
316
315
  }
317
316
  var historyField = historyField_;
318
- function cmd(e6, _) {
319
- return function({ state: v, dispatch: y }) {
320
- if (!_ && v.readOnly) return false;
321
- let b = v.field(historyField_, false);
322
- if (!b) return false;
323
- let x = b.pop(e6, v, _);
324
- return x ? (y(x), true) : false;
317
+ function cmd(e6, y) {
318
+ return function({ state: b, dispatch: x }) {
319
+ if (!y && b.readOnly) return false;
320
+ let S = b.field(historyField_, false);
321
+ if (!S) return false;
322
+ let C = S.pop(e6, b, y);
323
+ return C ? (x(C), true) : false;
325
324
  };
326
325
  }
327
326
  var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false), undoSelection = /* @__PURE__ */ cmd(0, true), redoSelection = /* @__PURE__ */ cmd(1, true), HistEvent = class e {
328
- constructor(e6, _, v, y, b) {
329
- this.changes = e6, this.effects = _, this.mapped = v, this.startSelection = y, this.selectionsAfter = b;
327
+ constructor(e6, y, b, x, S) {
328
+ this.changes = e6, this.effects = y, this.mapped = b, this.startSelection = x, this.selectionsAfter = S;
330
329
  }
331
- setSelAfter(_) {
332
- return new e(this.changes, this.effects, this.mapped, this.startSelection, _);
330
+ setSelAfter(y) {
331
+ return new e(this.changes, this.effects, this.mapped, this.startSelection, y);
333
332
  }
334
333
  toJSON() {
335
334
  var _a, _b, _c;
@@ -340,111 +339,111 @@ var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false),
340
339
  selectionsAfter: this.selectionsAfter.map((e6) => e6.toJSON())
341
340
  };
342
341
  }
343
- static fromJSON(_) {
344
- return new e(_.changes && ChangeSet.fromJSON(_.changes), [], _.mapped && ChangeDesc.fromJSON(_.mapped), _.startSelection && EditorSelection.fromJSON(_.startSelection), _.selectionsAfter.map(EditorSelection.fromJSON));
342
+ static fromJSON(y) {
343
+ 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));
345
344
  }
346
- static fromTransaction(_, v) {
347
- let y = none;
348
- for (let e6 of _.startState.facet(invertedEffects)) {
349
- let v2 = e6(_);
350
- v2.length && (y = y.concat(v2));
345
+ static fromTransaction(y, b) {
346
+ let x = none;
347
+ for (let e6 of y.startState.facet(invertedEffects)) {
348
+ let b2 = e6(y);
349
+ b2.length && (x = x.concat(b2));
351
350
  }
352
- return !y.length && _.changes.empty ? null : new e(_.changes.invert(_.startState.doc), y, void 0, v || _.startState.selection, none);
351
+ return !x.length && y.changes.empty ? null : new e(y.changes.invert(y.startState.doc), x, void 0, b || y.startState.selection, none);
353
352
  }
354
- static selection(_) {
355
- return new e(void 0, none, void 0, void 0, _);
353
+ static selection(y) {
354
+ return new e(void 0, none, void 0, void 0, y);
356
355
  }
357
356
  };
358
- function updateBranch(e6, _, v, y) {
359
- let b = _ + 1 > v + 20 ? _ - v - 1 : 0, x = e6.slice(b, _);
360
- return x.push(y), x;
357
+ function updateBranch(e6, y, b, x) {
358
+ let S = y + 1 > b + 20 ? y - b - 1 : 0, C = e6.slice(S, y);
359
+ return C.push(x), C;
361
360
  }
362
- function isAdjacent(e6, _) {
363
- let v = [], y = false;
364
- return e6.iterChangedRanges((e7, _2) => v.push(e7, _2)), _.iterChangedRanges((e7, _2, b, x) => {
365
- for (let e8 = 0; e8 < v.length; ) {
366
- let _3 = v[e8++], S = v[e8++];
367
- x >= _3 && b <= S && (y = true);
361
+ function isAdjacent(e6, y) {
362
+ let b = [], x = false;
363
+ return e6.iterChangedRanges((e7, y2) => b.push(e7, y2)), y.iterChangedRanges((e7, y2, S, C) => {
364
+ for (let e8 = 0; e8 < b.length; ) {
365
+ let y3 = b[e8++], w = b[e8++];
366
+ C >= y3 && S <= w && (x = true);
368
367
  }
369
- }), y;
368
+ }), x;
370
369
  }
371
- function eqSelectionShape(e6, _) {
372
- return e6.ranges.length == _.ranges.length && e6.ranges.filter((e7, v) => e7.empty != _.ranges[v].empty).length === 0;
370
+ function eqSelectionShape(e6, y) {
371
+ return e6.ranges.length == y.ranges.length && e6.ranges.filter((e7, b) => e7.empty != y.ranges[b].empty).length === 0;
373
372
  }
374
- function conc(e6, _) {
375
- return e6.length ? _.length ? e6.concat(_) : e6 : _;
373
+ function conc(e6, y) {
374
+ return e6.length ? y.length ? e6.concat(y) : e6 : y;
376
375
  }
377
376
  var none = [], MaxSelectionsPerEvent = 200;
378
- function addSelection(e6, _) {
377
+ function addSelection(e6, y) {
379
378
  if (e6.length) {
380
- let v = e6[e6.length - 1], y = v.selectionsAfter.slice(Math.max(0, v.selectionsAfter.length - MaxSelectionsPerEvent));
381
- return y.length && y[y.length - 1].eq(_) ? e6 : (y.push(_), updateBranch(e6, e6.length - 1, 1e9, v.setSelAfter(y)));
382
- } else return [HistEvent.selection([_])];
379
+ let b = e6[e6.length - 1], x = b.selectionsAfter.slice(Math.max(0, b.selectionsAfter.length - MaxSelectionsPerEvent));
380
+ return x.length && x[x.length - 1].eq(y) ? e6 : (x.push(y), updateBranch(e6, e6.length - 1, 1e9, b.setSelAfter(x)));
381
+ } else return [HistEvent.selection([y])];
383
382
  }
384
383
  function popSelection(e6) {
385
- let _ = e6[e6.length - 1], v = e6.slice();
386
- return v[e6.length - 1] = _.setSelAfter(_.selectionsAfter.slice(0, _.selectionsAfter.length - 1)), v;
384
+ let y = e6[e6.length - 1], b = e6.slice();
385
+ return b[e6.length - 1] = y.setSelAfter(y.selectionsAfter.slice(0, y.selectionsAfter.length - 1)), b;
387
386
  }
388
- function addMappingToBranch(e6, _) {
387
+ function addMappingToBranch(e6, y) {
389
388
  if (!e6.length) return e6;
390
- let v = e6.length, y = none;
391
- for (; v; ) {
392
- let b = mapEvent(e6[v - 1], _, y);
393
- if (b.changes && !b.changes.empty || b.effects.length) {
394
- let _2 = e6.slice(0, v);
395
- return _2[v - 1] = b, _2;
396
- } else _ = b.mapped, v--, y = b.selectionsAfter;
397
- }
398
- return y.length ? [HistEvent.selection(y)] : none;
389
+ let b = e6.length, x = none;
390
+ for (; b; ) {
391
+ let S = mapEvent(e6[b - 1], y, x);
392
+ if (S.changes && !S.changes.empty || S.effects.length) {
393
+ let y2 = e6.slice(0, b);
394
+ return y2[b - 1] = S, y2;
395
+ } else y = S.mapped, b--, x = S.selectionsAfter;
396
+ }
397
+ return x.length ? [HistEvent.selection(x)] : none;
399
398
  }
400
- function mapEvent(e6, _, v) {
401
- let y = conc(e6.selectionsAfter.length ? e6.selectionsAfter.map((e7) => e7.map(_)) : none, v);
402
- if (!e6.changes) return HistEvent.selection(y);
403
- let b = e6.changes.map(_), x = _.mapDesc(e6.changes, true), S = e6.mapped ? e6.mapped.composeDesc(x) : x;
404
- return new HistEvent(b, StateEffect.mapEffects(e6.effects, _), S, e6.startSelection.map(x), y);
399
+ function mapEvent(e6, y, b) {
400
+ let x = conc(e6.selectionsAfter.length ? e6.selectionsAfter.map((e7) => e7.map(y)) : none, b);
401
+ if (!e6.changes) return HistEvent.selection(x);
402
+ let S = e6.changes.map(y), C = y.mapDesc(e6.changes, true), w = e6.mapped ? e6.mapped.composeDesc(C) : C;
403
+ return new HistEvent(S, StateEffect.mapEffects(e6.effects, y), w, e6.startSelection.map(C), x);
405
404
  }
406
405
  var joinableUserEvent = /^(input\.type|delete)($|\.)/, HistoryState = class e2 {
407
- constructor(e6, _, v = 0, y = void 0) {
408
- this.done = e6, this.undone = _, this.prevTime = v, this.prevUserEvent = y;
406
+ constructor(e6, y, b = 0, x = void 0) {
407
+ this.done = e6, this.undone = y, this.prevTime = b, this.prevUserEvent = x;
409
408
  }
410
409
  isolate() {
411
410
  return this.prevTime ? new e2(this.done, this.undone) : this;
412
411
  }
413
- addChanges(_, v, y, b, x) {
414
- let S = this.done, C = S[S.length - 1];
415
- return S = C && C.changes && !C.changes.empty && _.changes && (!y || joinableUserEvent.test(y)) && (!C.selectionsAfter.length && v - this.prevTime < b.newGroupDelay && b.joinToEvent(x, isAdjacent(C.changes, _.changes)) || y == "input.type.compose") ? updateBranch(S, S.length - 1, b.minDepth, new HistEvent(_.changes.compose(C.changes), conc(StateEffect.mapEffects(_.effects, C.changes), C.effects), C.mapped, C.startSelection, none)) : updateBranch(S, S.length, b.minDepth, _), new e2(S, none, v, y);
412
+ addChanges(y, b, x, S, C) {
413
+ let w = this.done, T = w[w.length - 1];
414
+ 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);
416
415
  }
417
- addSelection(_, v, y, b) {
418
- let x = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
419
- return x.length > 0 && v - this.prevTime < b && y == this.prevUserEvent && y && /^select($|\.)/.test(y) && eqSelectionShape(x[x.length - 1], _) ? this : new e2(addSelection(this.done, _), this.undone, v, y);
416
+ addSelection(y, b, x, S) {
417
+ let C = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
418
+ 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);
420
419
  }
421
- addMapping(_) {
422
- return new e2(addMappingToBranch(this.done, _), addMappingToBranch(this.undone, _), this.prevTime, this.prevUserEvent);
420
+ addMapping(y) {
421
+ return new e2(addMappingToBranch(this.done, y), addMappingToBranch(this.undone, y), this.prevTime, this.prevUserEvent);
423
422
  }
424
- pop(e6, _, v) {
425
- let y = e6 == 0 ? this.done : this.undone;
426
- if (y.length == 0) return null;
427
- let b = y[y.length - 1], x = b.selectionsAfter[0] || _.selection;
428
- if (v && b.selectionsAfter.length) return _.update({
429
- selection: b.selectionsAfter[b.selectionsAfter.length - 1],
423
+ pop(e6, y, b) {
424
+ let x = e6 == 0 ? this.done : this.undone;
425
+ if (x.length == 0) return null;
426
+ let S = x[x.length - 1], C = S.selectionsAfter[0] || y.selection;
427
+ if (b && S.selectionsAfter.length) return y.update({
428
+ selection: S.selectionsAfter[S.selectionsAfter.length - 1],
430
429
  annotations: fromHistory.of({
431
430
  side: e6,
432
- rest: popSelection(y),
433
- selection: x
431
+ rest: popSelection(x),
432
+ selection: C
434
433
  }),
435
434
  userEvent: e6 == 0 ? "select.undo" : "select.redo",
436
435
  scrollIntoView: true
437
436
  });
438
- if (b.changes) {
439
- let v2 = y.length == 1 ? none : y.slice(0, y.length - 1);
440
- return b.mapped && (v2 = addMappingToBranch(v2, b.mapped)), _.update({
441
- changes: b.changes,
442
- selection: b.startSelection,
443
- effects: b.effects,
437
+ if (S.changes) {
438
+ let b2 = x.length == 1 ? none : x.slice(0, x.length - 1);
439
+ return S.mapped && (b2 = addMappingToBranch(b2, S.mapped)), y.update({
440
+ changes: S.changes,
441
+ selection: S.startSelection,
442
+ effects: S.effects,
444
443
  annotations: fromHistory.of({
445
444
  side: e6,
446
- rest: v2,
447
- selection: x
445
+ rest: b2,
446
+ selection: C
448
447
  }),
449
448
  filter: false,
450
449
  userEvent: e6 == 0 ? "undo" : "redo",
@@ -483,228 +482,244 @@ var historyKeymap = [
483
482
  preventDefault: true
484
483
  }
485
484
  ];
486
- function updateSel(e6, _) {
487
- return EditorSelection.create(e6.ranges.map(_), e6.mainIndex);
485
+ function updateSel(e6, y) {
486
+ return EditorSelection.create(e6.ranges.map(y), e6.mainIndex);
488
487
  }
489
- function setSel(e6, _) {
488
+ function setSel(e6, y) {
490
489
  return e6.update({
491
- selection: _,
490
+ selection: y,
492
491
  scrollIntoView: true,
493
492
  userEvent: "select"
494
493
  });
495
494
  }
496
- function moveSel({ state: e6, dispatch: _ }, v) {
497
- let y = updateSel(e6.selection, v);
498
- return y.eq(e6.selection, true) ? false : (_(setSel(e6, y)), true);
495
+ function moveSel({ state: e6, dispatch: y }, b) {
496
+ let x = updateSel(e6.selection, b);
497
+ return x.eq(e6.selection, true) ? false : (y(setSel(e6, x)), true);
499
498
  }
500
- function rangeEnd(e6, _) {
501
- return EditorSelection.cursor(_ ? e6.to : e6.from);
499
+ function rangeEnd(e6, y) {
500
+ return EditorSelection.cursor(y ? e6.to : e6.from);
502
501
  }
503
- function cursorByChar(e6, _) {
504
- return moveSel(e6, (v) => v.empty ? e6.moveByChar(v, _) : rangeEnd(v, _));
502
+ function cursorByChar(e6, y) {
503
+ return moveSel(e6, (b) => b.empty ? e6.moveByChar(b, y) : rangeEnd(b, y));
505
504
  }
506
505
  function ltrAtCursor(e6) {
507
506
  return e6.textDirectionAt(e6.state.selection.main.head) == Direction.LTR;
508
507
  }
509
508
  var cursorCharLeft = (e6) => cursorByChar(e6, !ltrAtCursor(e6)), cursorCharRight = (e6) => cursorByChar(e6, ltrAtCursor(e6));
510
- function cursorByGroup(e6, _) {
511
- return moveSel(e6, (v) => v.empty ? e6.moveByGroup(v, _) : rangeEnd(v, _));
509
+ function cursorByGroup(e6, y) {
510
+ return moveSel(e6, (b) => b.empty ? e6.moveByGroup(b, y) : rangeEnd(b, y));
512
511
  }
513
512
  var cursorGroupLeft = (e6) => cursorByGroup(e6, !ltrAtCursor(e6)), cursorGroupRight = (e6) => cursorByGroup(e6, ltrAtCursor(e6));
514
513
  typeof Intl < "u" && Intl.Segmenter;
515
- function interestingNode(e6, _, v) {
516
- if (_.type.prop(v)) return true;
517
- let y = _.to - _.from;
518
- return y && (y > 2 || /[^\s,.;:]/.test(e6.sliceDoc(_.from, _.to))) || _.firstChild;
514
+ function interestingNode(e6, y, b) {
515
+ if (y.type.prop(b)) return true;
516
+ let x = y.to - y.from;
517
+ return x && (x > 2 || /[^\s,.;:]/.test(e6.sliceDoc(y.from, y.to))) || y.firstChild;
519
518
  }
520
- function moveBySyntax(e6, _, v) {
521
- let y = syntaxTree(e6).resolveInner(_.head), b = v ? NodeProp.closedBy : NodeProp.openedBy;
522
- for (let x2 = _.head; ; ) {
523
- let _2 = v ? y.childAfter(x2) : y.childBefore(x2);
524
- if (!_2) break;
525
- interestingNode(e6, _2, b) ? y = _2 : x2 = v ? _2.to : _2.from;
526
- }
527
- let x = y.type.prop(b), S, C;
528
- return C = x && (S = v ? matchBrackets(e6, y.from, 1) : matchBrackets(e6, y.to, -1)) && S.matched ? v ? S.end.to : S.end.from : v ? y.to : y.from, EditorSelection.cursor(C, v ? -1 : 1);
519
+ function moveBySyntax(e6, y, b) {
520
+ let x = syntaxTree(e6).resolveInner(y.head), S = b ? NodeProp.closedBy : NodeProp.openedBy;
521
+ for (let C2 = y.head; ; ) {
522
+ let y2 = b ? x.childAfter(C2) : x.childBefore(C2);
523
+ if (!y2) break;
524
+ interestingNode(e6, y2, S) ? x = y2 : C2 = b ? y2.to : y2.from;
525
+ }
526
+ let C = x.type.prop(S), w, T;
527
+ 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);
529
528
  }
530
- var cursorSyntaxLeft = (e6) => moveSel(e6, (_) => moveBySyntax(e6.state, _, !ltrAtCursor(e6))), cursorSyntaxRight = (e6) => moveSel(e6, (_) => moveBySyntax(e6.state, _, ltrAtCursor(e6)));
531
- function cursorByLine(e6, _) {
532
- return moveSel(e6, (v) => {
533
- if (!v.empty) return rangeEnd(v, _);
534
- let y = e6.moveVertically(v, _);
535
- return y.head == v.head ? e6.moveToLineBoundary(v, _) : y;
529
+ var cursorSyntaxLeft = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, !ltrAtCursor(e6))), cursorSyntaxRight = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, ltrAtCursor(e6)));
530
+ function cursorByLine(e6, y) {
531
+ return moveSel(e6, (b) => {
532
+ if (!b.empty) return rangeEnd(b, y);
533
+ let x = e6.moveVertically(b, y);
534
+ return x.head == b.head ? e6.moveToLineBoundary(b, y) : x;
536
535
  });
537
536
  }
538
537
  var cursorLineUp = (e6) => cursorByLine(e6, false), cursorLineDown = (e6) => cursorByLine(e6, true);
539
538
  function pageInfo(e6) {
540
- let _ = e6.scrollDOM.clientHeight < e6.scrollDOM.scrollHeight - 2, v = 0, y = 0, b;
541
- if (_) {
542
- for (let _2 of e6.state.facet(EditorView.scrollMargins)) {
543
- let b2 = _2(e6);
544
- (b2 == null ? void 0 : b2.top) && (v = Math.max(b2 == null ? void 0 : b2.top, v)), (b2 == null ? void 0 : b2.bottom) && (y = Math.max(b2 == null ? void 0 : b2.bottom, y));
539
+ let y = e6.scrollDOM.clientHeight < e6.scrollDOM.scrollHeight - 2, b = 0, x = 0, S;
540
+ if (y) {
541
+ for (let y2 of e6.state.facet(EditorView.scrollMargins)) {
542
+ let S2 = y2(e6);
543
+ (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));
545
544
  }
546
- b = e6.scrollDOM.clientHeight - v - y;
547
- } else b = (e6.dom.ownerDocument.defaultView || window).innerHeight;
545
+ S = e6.scrollDOM.clientHeight - b - x;
546
+ } else S = (e6.dom.ownerDocument.defaultView || window).innerHeight;
548
547
  return {
549
- marginTop: v,
550
- marginBottom: y,
551
- selfScroll: _,
552
- height: Math.max(e6.defaultLineHeight, b - 5)
548
+ marginTop: b,
549
+ marginBottom: x,
550
+ selfScroll: y,
551
+ height: Math.max(e6.defaultLineHeight, S - 5)
553
552
  };
554
553
  }
555
- function cursorByPage(e6, _) {
556
- let v = pageInfo(e6), { state: y } = e6, b = updateSel(y.selection, (y2) => y2.empty ? e6.moveVertically(y2, _, v.height) : rangeEnd(y2, _));
557
- if (b.eq(y.selection)) return false;
558
- let x;
559
- if (v.selfScroll) {
560
- let _2 = e6.coordsAtPos(y.selection.main.head), S = e6.scrollDOM.getBoundingClientRect(), C = S.top + v.marginTop, w = S.bottom - v.marginBottom;
561
- _2 && _2.top > C && _2.bottom < w && (x = EditorView.scrollIntoView(b.main.head, {
554
+ function cursorByPage(e6, y) {
555
+ let b = pageInfo(e6), { state: x } = e6, S = updateSel(x.selection, (x2) => x2.empty ? e6.moveVertically(x2, y, b.height) : rangeEnd(x2, y));
556
+ if (S.eq(x.selection)) return false;
557
+ let C;
558
+ if (b.selfScroll) {
559
+ let y2 = e6.coordsAtPos(x.selection.main.head), w = e6.scrollDOM.getBoundingClientRect(), T = w.top + b.marginTop, E = w.bottom - b.marginBottom;
560
+ y2 && y2.top > T && y2.bottom < E && (C = EditorView.scrollIntoView(S.main.head, {
562
561
  y: "start",
563
- yMargin: _2.top - C
562
+ yMargin: y2.top - T
564
563
  }));
565
564
  }
566
- return e6.dispatch(setSel(y, b), { effects: x }), true;
565
+ return e6.dispatch(setSel(x, S), { effects: C }), true;
567
566
  }
568
567
  var cursorPageUp = (e6) => cursorByPage(e6, false), cursorPageDown = (e6) => cursorByPage(e6, true);
569
- function moveByLineBoundary(e6, _, v) {
570
- let y = e6.lineBlockAt(_.head), b = e6.moveToLineBoundary(_, v);
571
- if (b.head == _.head && b.head != (v ? y.to : y.from) && (b = e6.moveToLineBoundary(_, v, false)), !v && b.head == y.from && y.length) {
572
- let v2 = /^\s*/.exec(e6.state.sliceDoc(y.from, Math.min(y.from + 100, y.to)))[0].length;
573
- v2 && _.head != y.from + v2 && (b = EditorSelection.cursor(y.from + v2));
568
+ function moveByLineBoundary(e6, y, b) {
569
+ let x = e6.lineBlockAt(y.head), S = e6.moveToLineBoundary(y, b);
570
+ 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) {
571
+ let b2 = /^\s*/.exec(e6.state.sliceDoc(x.from, Math.min(x.from + 100, x.to)))[0].length;
572
+ b2 && y.head != x.from + b2 && (S = EditorSelection.cursor(x.from + b2));
574
573
  }
575
- return b;
574
+ return S;
576
575
  }
577
- var cursorLineBoundaryForward = (e6) => moveSel(e6, (_) => moveByLineBoundary(e6, _, true)), cursorLineBoundaryBackward = (e6) => moveSel(e6, (_) => moveByLineBoundary(e6, _, false)), cursorLineBoundaryLeft = (e6) => moveSel(e6, (_) => moveByLineBoundary(e6, _, !ltrAtCursor(e6))), cursorLineBoundaryRight = (e6) => moveSel(e6, (_) => moveByLineBoundary(e6, _, ltrAtCursor(e6))), cursorLineStart = (e6) => moveSel(e6, (_) => EditorSelection.cursor(e6.lineBlockAt(_.head).from, 1)), cursorLineEnd = (e6) => moveSel(e6, (_) => EditorSelection.cursor(e6.lineBlockAt(_.head).to, -1));
578
- function toMatchingBracket(e6, _, v) {
579
- let y = false, b = updateSel(e6.selection, (_2) => {
580
- let b2 = matchBrackets(e6, _2.head, -1) || matchBrackets(e6, _2.head, 1) || _2.head > 0 && matchBrackets(e6, _2.head - 1, 1) || _2.head < e6.doc.length && matchBrackets(e6, _2.head + 1, -1);
581
- if (!b2 || !b2.end) return _2;
582
- y = true;
583
- let x = b2.start.from == _2.head ? b2.end.to : b2.end.from;
584
- return v ? EditorSelection.range(_2.anchor, x) : EditorSelection.cursor(x);
576
+ 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));
577
+ function toMatchingBracket(e6, y, b) {
578
+ let x = false, S = updateSel(e6.selection, (y2) => {
579
+ 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);
580
+ if (!S2 || !S2.end) return y2;
581
+ x = true;
582
+ let C = S2.start.from == y2.head ? S2.end.to : S2.end.from;
583
+ return b ? EditorSelection.range(y2.anchor, C) : EditorSelection.cursor(C);
585
584
  });
586
- return y ? (_(setSel(e6, b)), true) : false;
585
+ return x ? (y(setSel(e6, S)), true) : false;
587
586
  }
588
- var cursorMatchingBracket = ({ state: e6, dispatch: _ }) => toMatchingBracket(e6, _, false);
589
- function extendSel(e6, _) {
590
- let v = updateSel(e6.state.selection, (e7) => {
591
- let v2 = _(e7);
592
- return EditorSelection.range(e7.anchor, v2.head, v2.goalColumn, v2.bidiLevel || void 0);
587
+ var cursorMatchingBracket = ({ state: e6, dispatch: y }) => toMatchingBracket(e6, y, false);
588
+ function extendSel(e6, y) {
589
+ let b = updateSel(e6.state.selection, (e7) => {
590
+ let b2 = y(e7);
591
+ return EditorSelection.range(e7.anchor, b2.head, b2.goalColumn, b2.bidiLevel || void 0);
593
592
  });
594
- return v.eq(e6.state.selection) ? false : (e6.dispatch(setSel(e6.state, v)), true);
593
+ return b.eq(e6.state.selection) ? false : (e6.dispatch(setSel(e6.state, b)), true);
595
594
  }
596
- function selectByChar(e6, _) {
597
- return extendSel(e6, (v) => e6.moveByChar(v, _));
595
+ function selectByChar(e6, y) {
596
+ return extendSel(e6, (b) => e6.moveByChar(b, y));
598
597
  }
599
598
  var selectCharLeft = (e6) => selectByChar(e6, !ltrAtCursor(e6)), selectCharRight = (e6) => selectByChar(e6, ltrAtCursor(e6));
600
- function selectByGroup(e6, _) {
601
- return extendSel(e6, (v) => e6.moveByGroup(v, _));
599
+ function selectByGroup(e6, y) {
600
+ return extendSel(e6, (b) => e6.moveByGroup(b, y));
602
601
  }
603
- var selectGroupLeft = (e6) => selectByGroup(e6, !ltrAtCursor(e6)), selectGroupRight = (e6) => selectByGroup(e6, ltrAtCursor(e6)), selectSyntaxLeft = (e6) => extendSel(e6, (_) => moveBySyntax(e6.state, _, !ltrAtCursor(e6))), selectSyntaxRight = (e6) => extendSel(e6, (_) => moveBySyntax(e6.state, _, ltrAtCursor(e6)));
604
- function selectByLine(e6, _) {
605
- return extendSel(e6, (v) => e6.moveVertically(v, _));
602
+ 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)));
603
+ function selectByLine(e6, y) {
604
+ return extendSel(e6, (b) => e6.moveVertically(b, y));
606
605
  }
607
606
  var selectLineUp = (e6) => selectByLine(e6, false), selectLineDown = (e6) => selectByLine(e6, true);
608
- function selectByPage(e6, _) {
609
- return extendSel(e6, (v) => e6.moveVertically(v, _, pageInfo(e6).height));
607
+ function selectByPage(e6, y) {
608
+ return extendSel(e6, (b) => e6.moveVertically(b, y, pageInfo(e6).height));
610
609
  }
611
- var selectPageUp = (e6) => selectByPage(e6, false), selectPageDown = (e6) => selectByPage(e6, true), selectLineBoundaryForward = (e6) => extendSel(e6, (_) => moveByLineBoundary(e6, _, true)), selectLineBoundaryBackward = (e6) => extendSel(e6, (_) => moveByLineBoundary(e6, _, false)), selectLineBoundaryLeft = (e6) => extendSel(e6, (_) => moveByLineBoundary(e6, _, !ltrAtCursor(e6))), selectLineBoundaryRight = (e6) => extendSel(e6, (_) => moveByLineBoundary(e6, _, ltrAtCursor(e6))), selectLineStart = (e6) => extendSel(e6, (_) => EditorSelection.cursor(e6.lineBlockAt(_.head).from)), selectLineEnd = (e6) => extendSel(e6, (_) => EditorSelection.cursor(e6.lineBlockAt(_.head).to)), cursorDocStart = ({ state: e6, dispatch: _ }) => (_(setSel(e6, { anchor: 0 })), true), cursorDocEnd = ({ state: e6, dispatch: _ }) => (_(setSel(e6, { anchor: e6.doc.length })), true), selectDocStart = ({ state: e6, dispatch: _ }) => (_(setSel(e6, {
610
+ 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, {
612
611
  anchor: e6.selection.main.anchor,
613
612
  head: 0
614
- })), true), selectDocEnd = ({ state: e6, dispatch: _ }) => (_(setSel(e6, {
613
+ })), true), selectDocEnd = ({ state: e6, dispatch: y }) => (y(setSel(e6, {
615
614
  anchor: e6.selection.main.anchor,
616
615
  head: e6.doc.length
617
- })), true), selectAll = ({ state: e6, dispatch: _ }) => (_(e6.update({
616
+ })), true), selectAll = ({ state: e6, dispatch: y }) => (y(e6.update({
618
617
  selection: {
619
618
  anchor: 0,
620
619
  head: e6.doc.length
621
620
  },
622
621
  userEvent: "select"
623
- })), true), selectLine = ({ state: e6, dispatch: _ }) => {
624
- let v = selectedLineBlocks(e6).map(({ from: _2, to: v2 }) => EditorSelection.range(_2, Math.min(v2 + 1, e6.doc.length)));
625
- return _(e6.update({
626
- selection: EditorSelection.create(v),
622
+ })), true), selectLine = ({ state: e6, dispatch: y }) => {
623
+ let b = selectedLineBlocks(e6).map(({ from: y2, to: b2 }) => EditorSelection.range(y2, Math.min(b2 + 1, e6.doc.length)));
624
+ return y(e6.update({
625
+ selection: EditorSelection.create(b),
627
626
  userEvent: "select"
628
627
  })), true;
629
- }, selectParentSyntax = ({ state: e6, dispatch: _ }) => {
630
- let v = updateSel(e6.selection, (_2) => {
631
- let v2 = syntaxTree(e6), y = v2.resolveStack(_2.from, 1);
632
- if (_2.empty) {
633
- let e7 = v2.resolveStack(_2.from, -1);
634
- e7.node.from >= y.node.from && e7.node.to <= y.node.to && (y = e7);
628
+ }, selectParentSyntax = ({ state: e6, dispatch: y }) => {
629
+ let b = updateSel(e6.selection, (y2) => {
630
+ let b2 = syntaxTree(e6), x = b2.resolveStack(y2.from, 1);
631
+ if (y2.empty) {
632
+ let e7 = b2.resolveStack(y2.from, -1);
633
+ e7.node.from >= x.node.from && e7.node.to <= x.node.to && (x = e7);
635
634
  }
636
- for (let e7 = y; e7; e7 = e7.next) {
637
- let { node: v3 } = e7;
638
- if ((v3.from < _2.from && v3.to >= _2.to || v3.to > _2.to && v3.from <= _2.from) && e7.next) return EditorSelection.range(v3.to, v3.from);
635
+ for (let e7 = x; e7; e7 = e7.next) {
636
+ let { node: b3 } = e7;
637
+ 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);
639
638
  }
640
- return _2;
639
+ return y2;
641
640
  });
642
- return v.eq(e6.selection) ? false : (_(setSel(e6, v)), true);
643
- }, simplifySelection = ({ state: e6, dispatch: _ }) => {
644
- let v = e6.selection, y = null;
645
- return v.ranges.length > 1 ? y = EditorSelection.create([v.main]) : v.main.empty || (y = EditorSelection.create([EditorSelection.cursor(v.main.head)])), y ? (_(setSel(e6, y)), true) : false;
641
+ return b.eq(e6.selection) ? false : (y(setSel(e6, b)), true);
642
+ };
643
+ function addCursorVertically(e6, y) {
644
+ let { state: b } = e6, x = b.selection, S = b.selection.ranges.slice();
645
+ for (let x2 of b.selection.ranges) {
646
+ let C = b.doc.lineAt(x2.head);
647
+ if (y ? C.to < e6.state.doc.length : C.from > 0) for (let b2 = x2; ; ) {
648
+ let x3 = e6.moveVertically(b2, y);
649
+ if (x3.head < C.from || x3.head > C.to) {
650
+ S.some((e7) => e7.head == x3.head) || S.push(x3);
651
+ break;
652
+ } else if (x3.head == b2.head) break;
653
+ else b2 = x3;
654
+ }
655
+ }
656
+ return S.length == x.ranges.length ? false : (e6.dispatch(setSel(b, EditorSelection.create(S, S.length - 1))), true);
657
+ }
658
+ var addCursorAbove = (e6) => addCursorVertically(e6, false), addCursorBelow = (e6) => addCursorVertically(e6, true), simplifySelection = ({ state: e6, dispatch: y }) => {
659
+ let b = e6.selection, x = null;
660
+ 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;
646
661
  };
647
- function deleteBy(e6, _) {
662
+ function deleteBy(e6, y) {
648
663
  if (e6.state.readOnly) return false;
649
- let v = "delete.selection", { state: y } = e6, b = y.changeByRange((y2) => {
650
- let { from: b2, to: x } = y2;
651
- if (b2 == x) {
652
- let S = _(y2);
653
- S < b2 ? (v = "delete.backward", S = skipAtomic(e6, S, false)) : S > b2 && (v = "delete.forward", S = skipAtomic(e6, S, true)), b2 = Math.min(b2, S), x = Math.max(x, S);
654
- } else b2 = skipAtomic(e6, b2, false), x = skipAtomic(e6, x, true);
655
- return b2 == x ? { range: y2 } : {
664
+ let b = "delete.selection", { state: x } = e6, S = x.changeByRange((x2) => {
665
+ let { from: S2, to: C } = x2;
666
+ if (S2 == C) {
667
+ let w = y(x2);
668
+ 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);
669
+ } else S2 = skipAtomic(e6, S2, false), C = skipAtomic(e6, C, true);
670
+ return S2 == C ? { range: x2 } : {
656
671
  changes: {
657
- from: b2,
658
- to: x
672
+ from: S2,
673
+ to: C
659
674
  },
660
- range: EditorSelection.cursor(b2, b2 < y2.head ? -1 : 1)
675
+ range: EditorSelection.cursor(S2, S2 < x2.head ? -1 : 1)
661
676
  };
662
677
  });
663
- return b.changes.empty ? false : (e6.dispatch(y.update(b, {
678
+ return S.changes.empty ? false : (e6.dispatch(x.update(S, {
664
679
  scrollIntoView: true,
665
- userEvent: v,
666
- effects: v == "delete.selection" ? EditorView.announce.of(y.phrase("Selection deleted")) : void 0
680
+ userEvent: b,
681
+ effects: b == "delete.selection" ? EditorView.announce.of(x.phrase("Selection deleted")) : void 0
667
682
  })), true);
668
683
  }
669
- function skipAtomic(e6, _, v) {
670
- if (e6 instanceof EditorView) for (let y of e6.state.facet(EditorView.atomicRanges).map((_2) => _2(e6))) y.between(_, _, (e7, y2) => {
671
- e7 < _ && y2 > _ && (_ = v ? y2 : e7);
684
+ function skipAtomic(e6, y, b) {
685
+ if (e6 instanceof EditorView) for (let x of e6.state.facet(EditorView.atomicRanges).map((y2) => y2(e6))) x.between(y, y, (e7, x2) => {
686
+ e7 < y && x2 > y && (y = b ? x2 : e7);
672
687
  });
673
- return _;
688
+ return y;
674
689
  }
675
- var deleteByChar = (e6, _, v) => deleteBy(e6, (y) => {
676
- let b = y.from, { state: x } = e6, S = x.doc.lineAt(b), C, w;
677
- if (v && !_ && b > S.from && b < S.from + 200 && !/[^ \t]/.test(C = S.text.slice(0, b - S.from))) {
678
- if (C[C.length - 1] == " ") return b - 1;
679
- let e7 = countColumn(C, x.tabSize) % getIndentUnit(x) || getIndentUnit(x);
680
- for (let _2 = 0; _2 < e7 && C[C.length - 1 - _2] == " "; _2++) b--;
681
- w = b;
682
- } else w = findClusterBreak(S.text, b - S.from, _, _) + S.from, w == b && S.number != (_ ? x.doc.lines : 1) ? w += _ ? 1 : -1 : !_ && /[\ufe00-\ufe0f]/.test(S.text.slice(w - S.from, b - S.from)) && (w = findClusterBreak(S.text, w - S.from, false, false) + S.from);
683
- return w;
684
- }), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6, _) => deleteBy(e6, (v) => {
685
- let y = v.head, { state: b } = e6, x = b.doc.lineAt(y), S = b.charCategorizer(y);
690
+ var deleteByChar = (e6, y, b) => deleteBy(e6, (x) => {
691
+ let S = x.from, { state: C } = e6, w = C.doc.lineAt(S), T, E;
692
+ if (b && !y && S > w.from && S < w.from + 200 && !/[^ \t]/.test(T = w.text.slice(0, S - w.from))) {
693
+ if (T[T.length - 1] == " ") return S - 1;
694
+ let e7 = countColumn(T, C.tabSize) % getIndentUnit(C) || getIndentUnit(C);
695
+ for (let y2 = 0; y2 < e7 && T[T.length - 1 - y2] == " "; y2++) S--;
696
+ E = S;
697
+ } 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);
698
+ return E;
699
+ }), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6, y) => deleteBy(e6, (b) => {
700
+ let x = b.head, { state: S } = e6, C = S.doc.lineAt(x), w = S.charCategorizer(x);
686
701
  for (let e7 = null; ; ) {
687
- if (y == (_ ? x.to : x.from)) {
688
- y == v.head && x.number != (_ ? b.doc.lines : 1) && (y += _ ? 1 : -1);
702
+ if (x == (y ? C.to : C.from)) {
703
+ x == b.head && C.number != (y ? S.doc.lines : 1) && (x += y ? 1 : -1);
689
704
  break;
690
705
  }
691
- let C = findClusterBreak(x.text, y - x.from, _) + x.from, w = x.text.slice(Math.min(y, C) - x.from, Math.max(y, C) - x.from), T = S(w);
692
- if (e7 != null && T != e7) break;
693
- (w != " " || y != v.head) && (e7 = T), y = C;
694
- }
695
- return y;
696
- }), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (_) => {
697
- let v = e6.lineBlockAt(_.head).to;
698
- return _.head < v ? v : Math.min(e6.state.doc.length, _.head + 1);
699
- }), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (_) => {
700
- let v = e6.moveToLineBoundary(_, false).head;
701
- return _.head > v ? v : Math.max(0, _.head - 1);
702
- }), deleteLineBoundaryForward = (e6) => deleteBy(e6, (_) => {
703
- let v = e6.moveToLineBoundary(_, true).head;
704
- return _.head < v ? v : Math.min(e6.state.doc.length, _.head + 1);
705
- }), splitLine = ({ state: e6, dispatch: _ }) => {
706
+ 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);
707
+ if (e7 != null && D != e7) break;
708
+ (E != " " || x != b.head) && (e7 = D), x = T;
709
+ }
710
+ return x;
711
+ }), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (y) => {
712
+ let b = e6.lineBlockAt(y.head).to;
713
+ return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
714
+ }), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (y) => {
715
+ let b = e6.moveToLineBoundary(y, false).head;
716
+ return y.head > b ? b : Math.max(0, y.head - 1);
717
+ }), deleteLineBoundaryForward = (e6) => deleteBy(e6, (y) => {
718
+ let b = e6.moveToLineBoundary(y, true).head;
719
+ return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
720
+ }), splitLine = ({ state: e6, dispatch: y }) => {
706
721
  if (e6.readOnly) return false;
707
- let v = e6.changeByRange((e7) => ({
722
+ let b = e6.changeByRange((e7) => ({
708
723
  changes: {
709
724
  from: e7.from,
710
725
  to: e7.to,
@@ -712,203 +727,203 @@ var deleteByChar = (e6, _, v) => deleteBy(e6, (y) => {
712
727
  },
713
728
  range: EditorSelection.cursor(e7.from)
714
729
  }));
715
- return _(e6.update(v, {
730
+ return y(e6.update(b, {
716
731
  scrollIntoView: true,
717
732
  userEvent: "input"
718
733
  })), true;
719
- }, transposeChars = ({ state: e6, dispatch: _ }) => {
734
+ }, transposeChars = ({ state: e6, dispatch: y }) => {
720
735
  if (e6.readOnly) return false;
721
- let v = e6.changeByRange((_2) => {
722
- if (!_2.empty || _2.from == 0 || _2.from == e6.doc.length) return { range: _2 };
723
- let v2 = _2.from, y = e6.doc.lineAt(v2), b = v2 == y.from ? v2 - 1 : findClusterBreak(y.text, v2 - y.from, false) + y.from, x = v2 == y.to ? v2 + 1 : findClusterBreak(y.text, v2 - y.from, true) + y.from;
736
+ let b = e6.changeByRange((y2) => {
737
+ if (!y2.empty || y2.from == 0 || y2.from == e6.doc.length) return { range: y2 };
738
+ 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;
724
739
  return {
725
740
  changes: {
726
- from: b,
727
- to: x,
728
- insert: e6.doc.slice(v2, x).append(e6.doc.slice(b, v2))
741
+ from: S,
742
+ to: C,
743
+ insert: e6.doc.slice(b2, C).append(e6.doc.slice(S, b2))
729
744
  },
730
- range: EditorSelection.cursor(x)
745
+ range: EditorSelection.cursor(C)
731
746
  };
732
747
  });
733
- return v.changes.empty ? false : (_(e6.update(v, {
748
+ return b.changes.empty ? false : (y(e6.update(b, {
734
749
  scrollIntoView: true,
735
750
  userEvent: "move.character"
736
751
  })), true);
737
752
  };
738
753
  function selectedLineBlocks(e6) {
739
- let _ = [], v = -1;
740
- for (let y of e6.selection.ranges) {
741
- let b = e6.doc.lineAt(y.from), x = e6.doc.lineAt(y.to);
742
- if (!y.empty && y.to == x.from && (x = e6.doc.lineAt(y.to - 1)), v >= b.number) {
743
- let e7 = _[_.length - 1];
744
- e7.to = x.to, e7.ranges.push(y);
745
- } else _.push({
746
- from: b.from,
747
- to: x.to,
748
- ranges: [y]
754
+ let y = [], b = -1;
755
+ for (let x of e6.selection.ranges) {
756
+ let S = e6.doc.lineAt(x.from), C = e6.doc.lineAt(x.to);
757
+ if (!x.empty && x.to == C.from && (C = e6.doc.lineAt(x.to - 1)), b >= S.number) {
758
+ let e7 = y[y.length - 1];
759
+ e7.to = C.to, e7.ranges.push(x);
760
+ } else y.push({
761
+ from: S.from,
762
+ to: C.to,
763
+ ranges: [x]
749
764
  });
750
- v = x.number + 1;
765
+ b = C.number + 1;
751
766
  }
752
- return _;
767
+ return y;
753
768
  }
754
- function moveLine(e6, _, v) {
769
+ function moveLine(e6, y, b) {
755
770
  if (e6.readOnly) return false;
756
- let y = [], b = [];
757
- for (let _2 of selectedLineBlocks(e6)) {
758
- if (v ? _2.to == e6.doc.length : _2.from == 0) continue;
759
- let x = e6.doc.lineAt(v ? _2.to + 1 : _2.from - 1), S = x.length + 1;
760
- if (v) {
761
- y.push({
762
- from: _2.to,
763
- to: x.to
771
+ let x = [], S = [];
772
+ for (let y2 of selectedLineBlocks(e6)) {
773
+ if (b ? y2.to == e6.doc.length : y2.from == 0) continue;
774
+ let C = e6.doc.lineAt(b ? y2.to + 1 : y2.from - 1), w = C.length + 1;
775
+ if (b) {
776
+ x.push({
777
+ from: y2.to,
778
+ to: C.to
764
779
  }, {
765
- from: _2.from,
766
- insert: x.text + e6.lineBreak
780
+ from: y2.from,
781
+ insert: C.text + e6.lineBreak
767
782
  });
768
- for (let v2 of _2.ranges) b.push(EditorSelection.range(Math.min(e6.doc.length, v2.anchor + S), Math.min(e6.doc.length, v2.head + S)));
783
+ 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)));
769
784
  } else {
770
- y.push({
771
- from: x.from,
772
- to: _2.from
785
+ x.push({
786
+ from: C.from,
787
+ to: y2.from
773
788
  }, {
774
- from: _2.to,
775
- insert: e6.lineBreak + x.text
789
+ from: y2.to,
790
+ insert: e6.lineBreak + C.text
776
791
  });
777
- for (let e7 of _2.ranges) b.push(EditorSelection.range(e7.anchor - S, e7.head - S));
792
+ for (let e7 of y2.ranges) S.push(EditorSelection.range(e7.anchor - w, e7.head - w));
778
793
  }
779
794
  }
780
- return y.length ? (_(e6.update({
781
- changes: y,
795
+ return x.length ? (y(e6.update({
796
+ changes: x,
782
797
  scrollIntoView: true,
783
- selection: EditorSelection.create(b, e6.selection.mainIndex),
798
+ selection: EditorSelection.create(S, e6.selection.mainIndex),
784
799
  userEvent: "move.line"
785
800
  })), true) : false;
786
801
  }
787
- var moveLineUp = ({ state: e6, dispatch: _ }) => moveLine(e6, _, false), moveLineDown = ({ state: e6, dispatch: _ }) => moveLine(e6, _, true);
788
- function copyLine(e6, _, v) {
802
+ var moveLineUp = ({ state: e6, dispatch: y }) => moveLine(e6, y, false), moveLineDown = ({ state: e6, dispatch: y }) => moveLine(e6, y, true);
803
+ function copyLine(e6, y, b) {
789
804
  if (e6.readOnly) return false;
790
- let y = [];
791
- for (let _2 of selectedLineBlocks(e6)) v ? y.push({
792
- from: _2.from,
793
- insert: e6.doc.slice(_2.from, _2.to) + e6.lineBreak
794
- }) : y.push({
795
- from: _2.to,
796
- insert: e6.lineBreak + e6.doc.slice(_2.from, _2.to)
805
+ let x = [];
806
+ for (let y2 of selectedLineBlocks(e6)) b ? x.push({
807
+ from: y2.from,
808
+ insert: e6.doc.slice(y2.from, y2.to) + e6.lineBreak
809
+ }) : x.push({
810
+ from: y2.to,
811
+ insert: e6.lineBreak + e6.doc.slice(y2.from, y2.to)
797
812
  });
798
- return _(e6.update({
799
- changes: y,
813
+ return y(e6.update({
814
+ changes: x,
800
815
  scrollIntoView: true,
801
816
  userEvent: "input.copyline"
802
817
  })), true;
803
818
  }
804
- var copyLineUp = ({ state: e6, dispatch: _ }) => copyLine(e6, _, false), copyLineDown = ({ state: e6, dispatch: _ }) => copyLine(e6, _, true), deleteLine = (e6) => {
819
+ var copyLineUp = ({ state: e6, dispatch: y }) => copyLine(e6, y, false), copyLineDown = ({ state: e6, dispatch: y }) => copyLine(e6, y, true), deleteLine = (e6) => {
805
820
  if (e6.state.readOnly) return false;
806
- let { state: _ } = e6, v = _.changes(selectedLineBlocks(_).map(({ from: e7, to: v2 }) => (e7 > 0 ? e7-- : v2 < _.doc.length && v2++, {
821
+ let { state: y } = e6, b = y.changes(selectedLineBlocks(y).map(({ from: e7, to: b2 }) => (e7 > 0 ? e7-- : b2 < y.doc.length && b2++, {
807
822
  from: e7,
808
- to: v2
809
- }))), y = updateSel(_.selection, (_2) => {
810
- let v2;
823
+ to: b2
824
+ }))), x = updateSel(y.selection, (y2) => {
825
+ let b2;
811
826
  if (e6.lineWrapping) {
812
- let y2 = e6.lineBlockAt(_2.head), b = e6.coordsAtPos(_2.head, _2.assoc || 1);
813
- b && (v2 = y2.bottom + e6.documentTop - b.bottom + e6.defaultLineHeight / 2);
827
+ let x2 = e6.lineBlockAt(y2.head), S = e6.coordsAtPos(y2.head, y2.assoc || 1);
828
+ S && (b2 = x2.bottom + e6.documentTop - S.bottom + e6.defaultLineHeight / 2);
814
829
  }
815
- return e6.moveVertically(_2, true, v2);
816
- }).map(v);
830
+ return e6.moveVertically(y2, true, b2);
831
+ }).map(b);
817
832
  return e6.dispatch({
818
- changes: v,
819
- selection: y,
833
+ changes: b,
834
+ selection: x,
820
835
  scrollIntoView: true,
821
836
  userEvent: "delete.line"
822
837
  }), true;
823
838
  };
824
- function isBetweenBrackets(e6, _) {
825
- if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(_ - 1, _ + 1))) return {
826
- from: _,
827
- to: _
839
+ function isBetweenBrackets(e6, y) {
840
+ if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(y - 1, y + 1))) return {
841
+ from: y,
842
+ to: y
828
843
  };
829
- let v = syntaxTree(e6).resolveInner(_), y = v.childBefore(_), b = v.childAfter(_), x;
830
- return y && b && y.to <= _ && b.from >= _ && (x = y.type.prop(NodeProp.closedBy)) && x.indexOf(b.name) > -1 && e6.doc.lineAt(y.to).from == e6.doc.lineAt(b.from).from && !/\S/.test(e6.sliceDoc(y.to, b.from)) ? {
831
- from: y.to,
832
- to: b.from
844
+ let b = syntaxTree(e6).resolveInner(y), x = b.childBefore(y), S = b.childAfter(y), C;
845
+ 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)) ? {
846
+ from: x.to,
847
+ to: S.from
833
848
  } : null;
834
849
  }
835
850
  var insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false), insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
836
851
  function newlineAndIndent(e6) {
837
- return ({ state: _, dispatch: v }) => {
838
- if (_.readOnly) return false;
839
- let y = _.changeByRange((v2) => {
840
- let { from: y2, to: b } = v2, x = _.doc.lineAt(y2), S = !e6 && y2 == b && isBetweenBrackets(_, y2);
841
- e6 && (y2 = b = (b <= x.to ? x : _.doc.lineAt(b)).to);
842
- let C = new IndentContext(_, {
843
- simulateBreak: y2,
844
- simulateDoubleBreak: !!S
845
- }), w = getIndentation(C, y2);
846
- for (w ?? (w = countColumn(/^\s*/.exec(_.doc.lineAt(y2).text)[0], _.tabSize)); b < x.to && /\s/.test(x.text[b - x.from]); ) b++;
847
- S ? { from: y2, to: b } = S : y2 > x.from && y2 < x.from + 100 && !/\S/.test(x.text.slice(0, y2)) && (y2 = x.from);
848
- let T = ["", indentString(_, w)];
849
- return S && T.push(indentString(_, C.lineIndent(x.from, -1))), {
852
+ return ({ state: y, dispatch: b }) => {
853
+ if (y.readOnly) return false;
854
+ let x = y.changeByRange((b2) => {
855
+ let { from: x2, to: S } = b2, C = y.doc.lineAt(x2), w = !e6 && x2 == S && isBetweenBrackets(y, x2);
856
+ e6 && (x2 = S = (S <= C.to ? C : y.doc.lineAt(S)).to);
857
+ let T = new IndentContext(y, {
858
+ simulateBreak: x2,
859
+ simulateDoubleBreak: !!w
860
+ }), E = getIndentation(T, x2);
861
+ 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++;
862
+ w ? { from: x2, to: S } = w : x2 > C.from && x2 < C.from + 100 && !/\S/.test(C.text.slice(0, x2)) && (x2 = C.from);
863
+ let D = ["", indentString(y, E)];
864
+ return w && D.push(indentString(y, T.lineIndent(C.from, -1))), {
850
865
  changes: {
851
- from: y2,
852
- to: b,
853
- insert: Text.of(T)
866
+ from: x2,
867
+ to: S,
868
+ insert: Text.of(D)
854
869
  },
855
- range: EditorSelection.cursor(y2 + 1 + T[1].length)
870
+ range: EditorSelection.cursor(x2 + 1 + D[1].length)
856
871
  };
857
872
  });
858
- return v(_.update(y, {
873
+ return b(y.update(x, {
859
874
  scrollIntoView: true,
860
875
  userEvent: "input"
861
876
  })), true;
862
877
  };
863
878
  }
864
- function changeBySelectedLine(e6, _) {
865
- let v = -1;
866
- return e6.changeByRange((y) => {
867
- let b = [];
868
- for (let x2 = y.from; x2 <= y.to; ) {
869
- let S = e6.doc.lineAt(x2);
870
- S.number > v && (y.empty || y.to > S.from) && (_(S, b, y), v = S.number), x2 = S.to + 1;
879
+ function changeBySelectedLine(e6, y) {
880
+ let b = -1;
881
+ return e6.changeByRange((x) => {
882
+ let S = [];
883
+ for (let C2 = x.from; C2 <= x.to; ) {
884
+ let w = e6.doc.lineAt(C2);
885
+ w.number > b && (x.empty || x.to > w.from) && (y(w, S, x), b = w.number), C2 = w.to + 1;
871
886
  }
872
- let x = e6.changes(b);
887
+ let C = e6.changes(S);
873
888
  return {
874
- changes: b,
875
- range: EditorSelection.range(x.mapPos(y.anchor, 1), x.mapPos(y.head, 1))
889
+ changes: S,
890
+ range: EditorSelection.range(C.mapPos(x.anchor, 1), C.mapPos(x.head, 1))
876
891
  };
877
892
  });
878
893
  }
879
- var indentSelection = ({ state: e6, dispatch: _ }) => {
894
+ var indentSelection = ({ state: e6, dispatch: y }) => {
880
895
  if (e6.readOnly) return false;
881
- let v = /* @__PURE__ */ Object.create(null), y = new IndentContext(e6, { overrideIndentation: (e7) => v[e7] ?? -1 }), b = changeBySelectedLine(e6, (_2, b2, x) => {
882
- let S = getIndentation(y, _2.from);
883
- if (S == null) return;
884
- /\S/.test(_2.text) || (S = 0);
885
- let C = /^\s*/.exec(_2.text)[0], w = indentString(e6, S);
886
- (C != w || x.from < _2.from + C.length) && (v[_2.from] = S, b2.push({
887
- from: _2.from,
888
- to: _2.from + C.length,
889
- insert: w
896
+ let b = /* @__PURE__ */ Object.create(null), x = new IndentContext(e6, { overrideIndentation: (e7) => b[e7] ?? -1 }), S = changeBySelectedLine(e6, (y2, S2, C) => {
897
+ let w = getIndentation(x, y2.from);
898
+ if (w == null) return;
899
+ /\S/.test(y2.text) || (w = 0);
900
+ let T = /^\s*/.exec(y2.text)[0], E = indentString(e6, w);
901
+ (T != E || C.from < y2.from + T.length) && (b[y2.from] = w, S2.push({
902
+ from: y2.from,
903
+ to: y2.from + T.length,
904
+ insert: E
890
905
  }));
891
906
  });
892
- return b.changes.empty || _(e6.update(b, { userEvent: "indent" })), true;
893
- }, indentMore = ({ state: e6, dispatch: _ }) => e6.readOnly ? false : (_(e6.update(changeBySelectedLine(e6, (_2, v) => {
894
- v.push({
895
- from: _2.from,
907
+ return S.changes.empty || y(e6.update(S, { userEvent: "indent" })), true;
908
+ }, indentMore = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
909
+ b.push({
910
+ from: y2.from,
896
911
  insert: e6.facet(indentUnit)
897
912
  });
898
- }), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch: _ }) => e6.readOnly ? false : (_(e6.update(changeBySelectedLine(e6, (_2, v) => {
899
- let y = /^\s*/.exec(_2.text)[0];
900
- if (!y) return;
901
- let b = countColumn(y, e6.tabSize), x = 0, S = indentString(e6, Math.max(0, b - getIndentUnit(e6)));
902
- for (; x < y.length && x < S.length && y.charCodeAt(x) == S.charCodeAt(x); ) x++;
903
- v.push({
904
- from: _2.from + x,
905
- to: _2.from + y.length,
906
- insert: S.slice(x)
913
+ }), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
914
+ let x = /^\s*/.exec(y2.text)[0];
915
+ if (!x) return;
916
+ let S = countColumn(x, e6.tabSize), C = 0, w = indentString(e6, Math.max(0, S - getIndentUnit(e6)));
917
+ for (; C < x.length && C < w.length && x.charCodeAt(C) == w.charCodeAt(C); ) C++;
918
+ b.push({
919
+ from: y2.from + C,
920
+ to: y2.from + x.length,
921
+ insert: w.slice(C)
907
922
  });
908
- }), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch: _ }) => e6.selection.ranges.some((e7) => !e7.empty) ? indentMore({
923
+ }), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch: y }) => e6.selection.ranges.some((e7) => !e7.empty) ? indentMore({
909
924
  state: e6,
910
- dispatch: _
911
- }) : (_(e6.update(e6.replaceSelection(" "), {
925
+ dispatch: y
926
+ }) : (y(e6.update(e6.replaceSelection(" "), {
912
927
  scrollIntoView: true,
913
928
  userEvent: "input"
914
929
  })), true), emacsStyleKeymap = [
@@ -1086,29 +1101,35 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
1086
1101
  {
1087
1102
  key: "Backspace",
1088
1103
  run: deleteCharBackward,
1089
- shift: deleteCharBackward
1104
+ shift: deleteCharBackward,
1105
+ preventDefault: true
1090
1106
  },
1091
1107
  {
1092
1108
  key: "Delete",
1093
- run: deleteCharForward
1109
+ run: deleteCharForward,
1110
+ preventDefault: true
1094
1111
  },
1095
1112
  {
1096
1113
  key: "Mod-Backspace",
1097
1114
  mac: "Alt-Backspace",
1098
- run: deleteGroupBackward
1115
+ run: deleteGroupBackward,
1116
+ preventDefault: true
1099
1117
  },
1100
1118
  {
1101
1119
  key: "Mod-Delete",
1102
1120
  mac: "Alt-Delete",
1103
- run: deleteGroupForward
1121
+ run: deleteGroupForward,
1122
+ preventDefault: true
1104
1123
  },
1105
1124
  {
1106
1125
  mac: "Mod-Backspace",
1107
- run: deleteLineBoundaryBackward
1126
+ run: deleteLineBoundaryBackward,
1127
+ preventDefault: true
1108
1128
  },
1109
1129
  {
1110
1130
  mac: "Mod-Delete",
1111
- run: deleteLineBoundaryForward
1131
+ run: deleteLineBoundaryForward,
1132
+ preventDefault: true
1112
1133
  }
1113
1134
  ].concat(/* @__PURE__ */ emacsStyleKeymap.map((e6) => ({
1114
1135
  mac: e6.key,
@@ -1143,6 +1164,14 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
1143
1164
  key: "Shift-Alt-ArrowDown",
1144
1165
  run: copyLineDown
1145
1166
  },
1167
+ {
1168
+ key: "Mod-Alt-ArrowUp",
1169
+ run: addCursorAbove
1170
+ },
1171
+ {
1172
+ key: "Mod-Alt-ArrowDown",
1173
+ run: addCursorBelow
1174
+ },
1146
1175
  {
1147
1176
  key: "Escape",
1148
1177
  run: simplifySelection
@@ -1199,11 +1228,11 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
1199
1228
  run: indentMore,
1200
1229
  shift: indentLess
1201
1230
  }, basicNormalize = typeof String.prototype.normalize == "function" ? (e6) => e6.normalize("NFKD") : (e6) => e6, SearchCursor = class {
1202
- constructor(e6, _, v = 0, y = e6.length, b, x) {
1203
- this.test = x, this.value = {
1231
+ constructor(e6, y, b = 0, x = e6.length, S, C) {
1232
+ this.test = C, this.value = {
1204
1233
  from: 0,
1205
1234
  to: 0
1206
- }, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e6.iterRange(v, y), this.bufferStart = v, this.normalize = b ? (e7) => b(basicNormalize(e7)) : basicNormalize, this.query = this.normalize(_);
1235
+ }, 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);
1207
1236
  }
1208
1237
  peek() {
1209
1238
  if (this.bufferPos == this.buffer.length) {
@@ -1220,32 +1249,32 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
1220
1249
  for (; ; ) {
1221
1250
  let e6 = this.peek();
1222
1251
  if (e6 < 0) return this.done = true, this;
1223
- let _ = fromCodePoint(e6), v = this.bufferStart + this.bufferPos;
1252
+ let y = fromCodePoint(e6), b = this.bufferStart + this.bufferPos;
1224
1253
  this.bufferPos += codePointSize(e6);
1225
- let y = this.normalize(_);
1226
- if (y.length) for (let e7 = 0, b = v; ; e7++) {
1227
- let x = y.charCodeAt(e7), S = this.match(x, b, this.bufferPos + this.bufferStart);
1228
- if (e7 == y.length - 1) {
1229
- if (S) return this.value = S, this;
1254
+ let x = this.normalize(y);
1255
+ if (x.length) for (let e7 = 0, S = b; ; e7++) {
1256
+ let C = x.charCodeAt(e7), w = this.match(C, S, this.bufferPos + this.bufferStart);
1257
+ if (e7 == x.length - 1) {
1258
+ if (w) return this.value = w, this;
1230
1259
  break;
1231
1260
  }
1232
- b == v && e7 < _.length && _.charCodeAt(e7) == x && b++;
1261
+ S == b && e7 < y.length && y.charCodeAt(e7) == C && S++;
1233
1262
  }
1234
1263
  }
1235
1264
  }
1236
- match(e6, _, v) {
1237
- let y = null;
1238
- for (let _2 = 0; _2 < this.matches.length; _2 += 2) {
1239
- let b = this.matches[_2], x = false;
1240
- this.query.charCodeAt(b) == e6 && (b == this.query.length - 1 ? y = {
1241
- from: this.matches[_2 + 1],
1242
- to: v
1243
- } : (this.matches[_2]++, x = true)), x || (this.matches.splice(_2, 2), _2 -= 2);
1265
+ match(e6, y, b) {
1266
+ let x = null;
1267
+ for (let y2 = 0; y2 < this.matches.length; y2 += 2) {
1268
+ let S = this.matches[y2], C = false;
1269
+ this.query.charCodeAt(S) == e6 && (S == this.query.length - 1 ? x = {
1270
+ from: this.matches[y2 + 1],
1271
+ to: b
1272
+ } : (this.matches[y2]++, C = true)), C || (this.matches.splice(y2, 2), y2 -= 2);
1244
1273
  }
1245
- return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ? y = {
1246
- from: _,
1247
- to: v
1248
- } : this.matches.push(1, _)), y && this.test && !this.test(y.from, y.to, this.buffer, this.bufferStart) && (y = null), y;
1274
+ return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ? x = {
1275
+ from: y,
1276
+ to: b
1277
+ } : this.matches.push(1, y)), x && this.test && !this.test(x.from, x.to, this.buffer, this.bufferStart) && (x = null), x;
1249
1278
  }
1250
1279
  };
1251
1280
  typeof Symbol < "u" && (SearchCursor.prototype[Symbol.iterator] = function() {
@@ -1256,9 +1285,9 @@ var empty = {
1256
1285
  to: -1,
1257
1286
  match: /* @__PURE__ */ /.*/.exec("")
1258
1287
  }, baseFlags = "gm" + (/x/.unicode == null ? "" : "u"), RegExpCursor = class {
1259
- constructor(e6, _, v, y = 0, b = e6.length) {
1260
- if (this.text = e6, this.to = b, this.curLine = "", this.done = false, this.value = empty, /\\[sWDnr]|\n|\r|\[\^/.test(_)) return new MultilineRegExpCursor(e6, _, v, y, b);
1261
- this.re = new RegExp(_, baseFlags + ((v == null ? void 0 : v.ignoreCase) ? "i" : "")), this.test = v == null ? void 0 : v.test, this.iter = e6.iter(), this.curLineStart = e6.lineAt(y).from, this.matchPos = toCharEnd(e6, y), this.getLine(this.curLineStart);
1288
+ constructor(e6, y, b, x = 0, S = e6.length) {
1289
+ 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);
1290
+ 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);
1262
1291
  }
1263
1292
  getLine(e6) {
1264
1293
  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());
@@ -1269,13 +1298,13 @@ var empty = {
1269
1298
  next() {
1270
1299
  for (let e6 = this.matchPos - this.curLineStart; ; ) {
1271
1300
  this.re.lastIndex = e6;
1272
- let _ = this.matchPos <= this.to && this.re.exec(this.curLine);
1273
- if (_) {
1274
- let v = this.curLineStart + _.index, y = v + _[0].length;
1275
- if (this.matchPos = toCharEnd(this.text, y + (v == y ? 1 : 0)), v == this.curLineStart + this.curLine.length && this.nextLine(), (v < y || v > this.value.to) && (!this.test || this.test(v, y, _))) return this.value = {
1276
- from: v,
1277
- to: y,
1278
- match: _
1301
+ let y = this.matchPos <= this.to && this.re.exec(this.curLine);
1302
+ if (y) {
1303
+ let b = this.curLineStart + y.index, x = b + y[0].length;
1304
+ 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 = {
1305
+ from: b,
1306
+ to: x,
1307
+ match: y
1279
1308
  }, this;
1280
1309
  e6 = this.matchPos - this.curLineStart;
1281
1310
  } else if (this.curLineStart + this.curLine.length < this.to) this.nextLine(), e6 = 0;
@@ -1283,39 +1312,39 @@ var empty = {
1283
1312
  }
1284
1313
  }
1285
1314
  }, flattened = /* @__PURE__ */ new WeakMap(), FlattenedDoc = class e3 {
1286
- constructor(e6, _) {
1287
- this.from = e6, this.text = _;
1315
+ constructor(e6, y) {
1316
+ this.from = e6, this.text = y;
1288
1317
  }
1289
1318
  get to() {
1290
1319
  return this.from + this.text.length;
1291
1320
  }
1292
- static get(_, v, y) {
1293
- let b = flattened.get(_);
1294
- if (!b || b.from >= y || b.to <= v) {
1295
- let b2 = new e3(v, _.sliceString(v, y));
1296
- return flattened.set(_, b2), b2;
1321
+ static get(y, b, x) {
1322
+ let S = flattened.get(y);
1323
+ if (!S || S.from >= x || S.to <= b) {
1324
+ let S2 = new e3(b, y.sliceString(b, x));
1325
+ return flattened.set(y, S2), S2;
1297
1326
  }
1298
- if (b.from == v && b.to == y) return b;
1299
- let { text: x, from: S } = b;
1300
- return S > v && (x = _.sliceString(v, S) + x, S = v), b.to < y && (x += _.sliceString(b.to, y)), flattened.set(_, new e3(S, x)), new e3(v, x.slice(v - S, y - S));
1327
+ if (S.from == b && S.to == x) return S;
1328
+ let { text: C, from: w } = S;
1329
+ return w > b && (C = y.sliceString(b, w) + C, w = b), S.to < x && (C += y.sliceString(S.to, x)), flattened.set(y, new e3(w, C)), new e3(b, C.slice(b - w, x - w));
1301
1330
  }
1302
1331
  }, MultilineRegExpCursor = class {
1303
- constructor(e6, _, v, y, b) {
1304
- this.text = e6, this.to = b, this.done = false, this.value = empty, this.matchPos = toCharEnd(e6, y), this.re = new RegExp(_, baseFlags + ((v == null ? void 0 : v.ignoreCase) ? "i" : "")), this.test = v == null ? void 0 : v.test, this.flat = FlattenedDoc.get(e6, y, this.chunkEnd(y + 5e3));
1332
+ constructor(e6, y, b, x, S) {
1333
+ 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));
1305
1334
  }
1306
1335
  chunkEnd(e6) {
1307
1336
  return e6 >= this.to ? this.to : this.text.lineAt(e6).to;
1308
1337
  }
1309
1338
  next() {
1310
1339
  for (; ; ) {
1311
- let e6 = this.re.lastIndex = this.matchPos - this.flat.from, _ = this.re.exec(this.flat.text);
1312
- if (_ && !_[0] && _.index == e6 && (this.re.lastIndex = e6 + 1, _ = this.re.exec(this.flat.text)), _) {
1313
- let e7 = this.flat.from + _.index, v = e7 + _[0].length;
1314
- if ((this.flat.to >= this.to || _.index + _[0].length <= this.flat.text.length - 10) && (!this.test || this.test(e7, v, _))) return this.value = {
1340
+ let e6 = this.re.lastIndex = this.matchPos - this.flat.from, y = this.re.exec(this.flat.text);
1341
+ if (y && !y[0] && y.index == e6 && (this.re.lastIndex = e6 + 1, y = this.re.exec(this.flat.text)), y) {
1342
+ let e7 = this.flat.from + y.index, b = e7 + y[0].length;
1343
+ 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 = {
1315
1344
  from: e7,
1316
- to: v,
1317
- match: _
1318
- }, this.matchPos = toCharEnd(this.text, v + (e7 == v ? 1 : 0)), this;
1345
+ to: b,
1346
+ match: y
1347
+ }, this.matchPos = toCharEnd(this.text, b + (e7 == b ? 1 : 0)), this;
1319
1348
  }
1320
1349
  if (this.flat.to == this.to) return this.done = true, this;
1321
1350
  this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
@@ -1332,26 +1361,26 @@ function validRegExp(e6) {
1332
1361
  return false;
1333
1362
  }
1334
1363
  }
1335
- function toCharEnd(e6, _) {
1336
- if (_ >= e6.length) return _;
1337
- let v = e6.lineAt(_), y;
1338
- for (; _ < v.to && (y = v.text.charCodeAt(_ - v.from)) >= 56320 && y < 57344; ) _++;
1339
- return _;
1364
+ function toCharEnd(e6, y) {
1365
+ if (y >= e6.length) return y;
1366
+ let b = e6.lineAt(y), x;
1367
+ for (; y < b.to && (x = b.text.charCodeAt(y - b.from)) >= 56320 && x < 57344; ) y++;
1368
+ return y;
1340
1369
  }
1341
1370
  function createLineDialog(e6) {
1342
- let _ = String(e6.state.doc.lineAt(e6.state.selection.main.head).number), v = crelt("input", {
1371
+ let y = crelt("input", {
1343
1372
  class: "cm-textfield",
1344
1373
  name: "line",
1345
- value: _
1346
- }), y = crelt("form", {
1374
+ value: String(e6.state.doc.lineAt(e6.state.selection.main.head).number)
1375
+ }), b = crelt("form", {
1347
1376
  class: "cm-gotoLine",
1348
- onkeydown: (_2) => {
1349
- _2.keyCode == 27 ? (_2.preventDefault(), e6.dispatch({ effects: dialogEffect.of(false) }), e6.focus()) : _2.keyCode == 13 && (_2.preventDefault(), b());
1377
+ onkeydown: (y2) => {
1378
+ y2.keyCode == 27 ? (y2.preventDefault(), e6.dispatch({ effects: dialogEffect.of(false) }), e6.focus()) : y2.keyCode == 13 && (y2.preventDefault(), x());
1350
1379
  },
1351
1380
  onsubmit: (e7) => {
1352
- e7.preventDefault(), b();
1381
+ e7.preventDefault(), x();
1353
1382
  }
1354
- }, crelt("label", e6.state.phrase("Go to line"), ": ", v), " ", crelt("button", {
1383
+ }, crelt("label", e6.state.phrase("Go to line"), ": ", y), " ", crelt("button", {
1355
1384
  class: "cm-button",
1356
1385
  type: "submit"
1357
1386
  }, e6.state.phrase("go")), crelt("button", {
@@ -1362,38 +1391,38 @@ function createLineDialog(e6) {
1362
1391
  "aria-label": e6.state.phrase("close"),
1363
1392
  type: "button"
1364
1393
  }, ["\xD7"]));
1365
- function b() {
1366
- let _2 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(v.value);
1367
- if (!_2) return;
1368
- let { state: y2 } = e6, b2 = y2.doc.lineAt(y2.selection.main.head), [, x, S, C, w] = _2, T = C ? +C.slice(1) : 0, E = S ? +S : b2.number;
1369
- if (S && w) {
1370
- let e7 = E / 100;
1371
- x && (e7 = e7 * (x == "-" ? -1 : 1) + b2.number / y2.doc.lines), E = Math.round(y2.doc.lines * e7);
1372
- } else S && x && (E = E * (x == "-" ? -1 : 1) + b2.number);
1373
- let D = y2.doc.line(Math.max(1, Math.min(y2.doc.lines, E))), O = EditorSelection.cursor(D.from + Math.max(0, Math.min(T, D.length)));
1394
+ function x() {
1395
+ let b2 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(y.value);
1396
+ if (!b2) return;
1397
+ 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;
1398
+ if (w && E) {
1399
+ let e7 = O / 100;
1400
+ C && (e7 = e7 * (C == "-" ? -1 : 1) + S.number / x2.doc.lines), O = Math.round(x2.doc.lines * e7);
1401
+ } else w && C && (O = O * (C == "-" ? -1 : 1) + S.number);
1402
+ 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)));
1374
1403
  e6.dispatch({
1375
- effects: [dialogEffect.of(false), EditorView.scrollIntoView(O.from, { y: "center" })],
1376
- selection: O
1404
+ effects: [dialogEffect.of(false), EditorView.scrollIntoView(A.from, { y: "center" })],
1405
+ selection: A
1377
1406
  }), e6.focus();
1378
1407
  }
1379
- return { dom: y };
1408
+ return { dom: b };
1380
1409
  }
1381
1410
  var dialogEffect = /* @__PURE__ */ StateEffect.define(), dialogField = /* @__PURE__ */ StateField.define({
1382
1411
  create() {
1383
1412
  return true;
1384
1413
  },
1385
- update(e6, _) {
1386
- for (let v of _.effects) v.is(dialogEffect) && (e6 = v.value);
1414
+ update(e6, y) {
1415
+ for (let b of y.effects) b.is(dialogEffect) && (e6 = b.value);
1387
1416
  return e6;
1388
1417
  },
1389
1418
  provide: (e6) => showPanel.from(e6, (e7) => e7 ? createLineDialog : null)
1390
1419
  }), gotoLine = (e6) => {
1391
- let _ = getPanel(e6, createLineDialog);
1392
- if (!_) {
1393
- let v = [dialogEffect.of(true)];
1394
- e6.state.field(dialogField, false) ?? v.push(StateEffect.appendConfig.of([dialogField, baseTheme$1])), e6.dispatch({ effects: v }), _ = getPanel(e6, createLineDialog);
1420
+ let y = getPanel(e6, createLineDialog);
1421
+ if (!y) {
1422
+ let b = [dialogEffect.of(true)];
1423
+ e6.state.field(dialogField, false) ?? b.push(StateEffect.appendConfig.of([dialogField, baseTheme$1])), e6.dispatch({ effects: b }), y = getPanel(e6, createLineDialog);
1395
1424
  }
1396
- return _ && _.dom.querySelector("input").select(), true;
1425
+ return y && y.dom.querySelector("input").select(), true;
1397
1426
  }, baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({ ".cm-panel.cm-gotoLine": {
1398
1427
  padding: "2px 6px 4px",
1399
1428
  position: "relative",
@@ -1415,21 +1444,21 @@ var dialogEffect = /* @__PURE__ */ StateEffect.define(), dialogField = /* @__PUR
1415
1444
  wholeWords: false
1416
1445
  }, highlightConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
1417
1446
  return combineConfig(e6, defaultHighlightOptions, {
1418
- highlightWordAroundCursor: (e7, _) => e7 || _,
1447
+ highlightWordAroundCursor: (e7, y) => e7 || y,
1419
1448
  minSelectionLength: Math.min,
1420
1449
  maxMatches: Math.min
1421
1450
  });
1422
1451
  } });
1423
1452
  function highlightSelectionMatches(e6) {
1424
- let _ = [defaultTheme, matchHighlighter];
1425
- return e6 && _.push(highlightConfig.of(e6)), _;
1453
+ let y = [defaultTheme, matchHighlighter];
1454
+ return e6 && y.push(highlightConfig.of(e6)), y;
1426
1455
  }
1427
1456
  var matchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch" }), mainMatchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
1428
- function insideWordBoundaries(e6, _, v, y) {
1429
- return (v == 0 || e6(_.sliceDoc(v - 1, v)) != CharCategory.Word) && (y == _.doc.length || e6(_.sliceDoc(y, y + 1)) != CharCategory.Word);
1457
+ function insideWordBoundaries(e6, y, b, x) {
1458
+ return (b == 0 || e6(y.sliceDoc(b - 1, b)) != CharCategory.Word) && (x == y.doc.length || e6(y.sliceDoc(x, x + 1)) != CharCategory.Word);
1430
1459
  }
1431
- function insideWord(e6, _, v, y) {
1432
- return e6(_.sliceDoc(v, v + 1)) == CharCategory.Word && e6(_.sliceDoc(y - 1, y)) == CharCategory.Word;
1460
+ function insideWord(e6, y, b, x) {
1461
+ return e6(y.sliceDoc(b, b + 1)) == CharCategory.Word && e6(y.sliceDoc(x - 1, x)) == CharCategory.Word;
1433
1462
  }
1434
1463
  var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
1435
1464
  constructor(e6) {
@@ -1439,64 +1468,64 @@ var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
1439
1468
  (e6.selectionSet || e6.docChanged || e6.viewportChanged) && (this.decorations = this.getDeco(e6.view));
1440
1469
  }
1441
1470
  getDeco(e6) {
1442
- let _ = e6.state.facet(highlightConfig), { state: v } = e6, y = v.selection;
1443
- if (y.ranges.length > 1) return Decoration.none;
1444
- let b = y.main, x, S = null;
1445
- if (b.empty) {
1446
- if (!_.highlightWordAroundCursor) return Decoration.none;
1447
- let e7 = v.wordAt(b.head);
1471
+ let y = e6.state.facet(highlightConfig), { state: b } = e6, x = b.selection;
1472
+ if (x.ranges.length > 1) return Decoration.none;
1473
+ let S = x.main, C, w = null;
1474
+ if (S.empty) {
1475
+ if (!y.highlightWordAroundCursor) return Decoration.none;
1476
+ let e7 = b.wordAt(S.head);
1448
1477
  if (!e7) return Decoration.none;
1449
- S = v.charCategorizer(b.head), x = v.sliceDoc(e7.from, e7.to);
1478
+ w = b.charCategorizer(S.head), C = b.sliceDoc(e7.from, e7.to);
1450
1479
  } else {
1451
- let e7 = b.to - b.from;
1452
- if (e7 < _.minSelectionLength || e7 > 200) return Decoration.none;
1453
- if (_.wholeWords) {
1454
- if (x = v.sliceDoc(b.from, b.to), S = v.charCategorizer(b.head), !(insideWordBoundaries(S, v, b.from, b.to) && insideWord(S, v, b.from, b.to))) return Decoration.none;
1455
- } else if (x = v.sliceDoc(b.from, b.to), !x) return Decoration.none;
1480
+ let e7 = S.to - S.from;
1481
+ if (e7 < y.minSelectionLength || e7 > 200) return Decoration.none;
1482
+ if (y.wholeWords) {
1483
+ 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;
1484
+ } else if (C = b.sliceDoc(S.from, S.to), !C) return Decoration.none;
1456
1485
  }
1457
- let C = [];
1458
- for (let y2 of e6.visibleRanges) {
1459
- let e7 = new SearchCursor(v.doc, x, y2.from, y2.to);
1486
+ let T = [];
1487
+ for (let x2 of e6.visibleRanges) {
1488
+ let e7 = new SearchCursor(b.doc, C, x2.from, x2.to);
1460
1489
  for (; !e7.next().done; ) {
1461
- let { from: y3, to: x2 } = e7.value;
1462
- if ((!S || insideWordBoundaries(S, v, y3, x2)) && (b.empty && y3 <= b.from && x2 >= b.to ? C.push(mainMatchDeco.range(y3, x2)) : (y3 >= b.to || x2 <= b.from) && C.push(matchDeco.range(y3, x2)), C.length > _.maxMatches)) return Decoration.none;
1490
+ let { from: x3, to: C2 } = e7.value;
1491
+ 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;
1463
1492
  }
1464
1493
  }
1465
- return Decoration.set(C);
1494
+ return Decoration.set(T);
1466
1495
  }
1467
1496
  }, { decorations: (e6) => e6.decorations }), defaultTheme = /* @__PURE__ */ EditorView.baseTheme({
1468
1497
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
1469
1498
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
1470
- }), selectWord = ({ state: e6, dispatch: _ }) => {
1471
- let { selection: v } = e6, y = EditorSelection.create(v.ranges.map((_2) => e6.wordAt(_2.head) || EditorSelection.cursor(_2.head)), v.mainIndex);
1472
- return y.eq(v) ? false : (_(e6.update({ selection: y })), true);
1499
+ }), selectWord = ({ state: e6, dispatch: y }) => {
1500
+ let { selection: b } = e6, x = EditorSelection.create(b.ranges.map((y2) => e6.wordAt(y2.head) || EditorSelection.cursor(y2.head)), b.mainIndex);
1501
+ return x.eq(b) ? false : (y(e6.update({ selection: x })), true);
1473
1502
  };
1474
- function findNextOccurrence(e6, _) {
1475
- let { main: v, ranges: y } = e6.selection, b = e6.wordAt(v.head), x = b && b.from == v.from && b.to == v.to;
1476
- for (let v2 = false, b2 = new SearchCursor(e6.doc, _, y[y.length - 1].to); ; ) if (b2.next(), b2.done) {
1477
- if (v2) return null;
1478
- b2 = new SearchCursor(e6.doc, _, 0, Math.max(0, y[y.length - 1].from - 1)), v2 = true;
1503
+ function findNextOccurrence(e6, y) {
1504
+ let { main: b, ranges: x } = e6.selection, S = e6.wordAt(b.head), C = S && S.from == b.from && S.to == b.to;
1505
+ for (let b2 = false, S2 = new SearchCursor(e6.doc, y, x[x.length - 1].to); ; ) if (S2.next(), S2.done) {
1506
+ if (b2) return null;
1507
+ S2 = new SearchCursor(e6.doc, y, 0, Math.max(0, x[x.length - 1].from - 1)), b2 = true;
1479
1508
  } else {
1480
- if (v2 && y.some((e7) => e7.from == b2.value.from)) continue;
1481
- if (x) {
1482
- let _2 = e6.wordAt(b2.value.from);
1483
- if (!_2 || _2.from != b2.value.from || _2.to != b2.value.to) continue;
1509
+ if (b2 && x.some((e7) => e7.from == S2.value.from)) continue;
1510
+ if (C) {
1511
+ let y2 = e6.wordAt(S2.value.from);
1512
+ if (!y2 || y2.from != S2.value.from || y2.to != S2.value.to) continue;
1484
1513
  }
1485
- return b2.value;
1514
+ return S2.value;
1486
1515
  }
1487
1516
  }
1488
- var selectNextOccurrence = ({ state: e6, dispatch: _ }) => {
1489
- let { ranges: v } = e6.selection;
1490
- if (v.some((e7) => e7.from === e7.to)) return selectWord({
1517
+ var selectNextOccurrence = ({ state: e6, dispatch: y }) => {
1518
+ let { ranges: b } = e6.selection;
1519
+ if (b.some((e7) => e7.from === e7.to)) return selectWord({
1491
1520
  state: e6,
1492
- dispatch: _
1521
+ dispatch: y
1493
1522
  });
1494
- let y = e6.sliceDoc(v[0].from, v[0].to);
1495
- if (e6.selection.ranges.some((_2) => e6.sliceDoc(_2.from, _2.to) != y)) return false;
1496
- let b = findNextOccurrence(e6, y);
1497
- return b ? (_(e6.update({
1498
- selection: e6.selection.addRange(EditorSelection.range(b.from, b.to), false),
1499
- effects: EditorView.scrollIntoView(b.to)
1523
+ let x = e6.sliceDoc(b[0].from, b[0].to);
1524
+ if (e6.selection.ranges.some((y2) => e6.sliceDoc(y2.from, y2.to) != x)) return false;
1525
+ let S = findNextOccurrence(e6, x);
1526
+ return S ? (y(e6.update({
1527
+ selection: e6.selection.addRange(EditorSelection.range(S.from, S.to), false),
1528
+ effects: EditorView.scrollIntoView(S.to)
1500
1529
  })), true) : false;
1501
1530
  }, searchConfigFacet = /* @__PURE__ */ Facet.define({ combine(e6) {
1502
1531
  return combineConfig(e6, {
@@ -1513,7 +1542,7 @@ var selectNextOccurrence = ({ state: e6, dispatch: _ }) => {
1513
1542
  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;
1514
1543
  }
1515
1544
  unquote(e6) {
1516
- return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7, _) => _ == "n" ? "\n" : _ == "r" ? "\r" : _ == "t" ? " " : "\\");
1545
+ return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7, y) => y == "n" ? "\n" : y == "r" ? "\r" : y == "t" ? " " : "\\");
1517
1546
  }
1518
1547
  eq(e6) {
1519
1548
  return this.search == e6.search && this.replace == e6.replace && this.caseSensitive == e6.caseSensitive && this.regexp == e6.regexp && this.wholeWord == e6.wholeWord;
@@ -1521,267 +1550,267 @@ var selectNextOccurrence = ({ state: e6, dispatch: _ }) => {
1521
1550
  create() {
1522
1551
  return this.regexp ? new RegExpQuery(this) : new StringQuery(this);
1523
1552
  }
1524
- getCursor(e6, _ = 0, v) {
1525
- let y = e6.doc ? e6 : EditorState.create({ doc: e6 });
1526
- return v ?? (v = y.doc.length), this.regexp ? regexpCursor(this, y, _, v) : stringCursor(this, y, _, v);
1553
+ getCursor(e6, y = 0, b) {
1554
+ let x = e6.doc ? e6 : EditorState.create({ doc: e6 });
1555
+ return b ?? (b = x.doc.length), this.regexp ? regexpCursor(this, x, y, b) : stringCursor(this, x, y, b);
1527
1556
  }
1528
1557
  }, QueryType = class {
1529
1558
  constructor(e6) {
1530
1559
  this.spec = e6;
1531
1560
  }
1532
1561
  };
1533
- function stringCursor(e6, _, v, y) {
1534
- return new SearchCursor(_.doc, e6.unquoted, v, y, e6.caseSensitive ? void 0 : (e7) => e7.toLowerCase(), e6.wholeWord ? stringWordTest(_.doc, _.charCategorizer(_.selection.main.head)) : void 0);
1562
+ function stringCursor(e6, y, b, x) {
1563
+ 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);
1535
1564
  }
1536
- function stringWordTest(e6, _) {
1537
- return (v, y, b, x) => ((x > v || x + b.length < y) && (x = Math.max(0, v - 2), b = e6.sliceString(x, Math.min(e6.length, y + 2))), (_(charBefore(b, v - x)) != CharCategory.Word || _(charAfter(b, v - x)) != CharCategory.Word) && (_(charAfter(b, y - x)) != CharCategory.Word || _(charBefore(b, y - x)) != CharCategory.Word));
1565
+ function stringWordTest(e6, y) {
1566
+ 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));
1538
1567
  }
1539
1568
  var StringQuery = class extends QueryType {
1540
1569
  constructor(e6) {
1541
1570
  super(e6);
1542
1571
  }
1543
- nextMatch(e6, _, v) {
1544
- let y = stringCursor(this.spec, e6, v, e6.doc.length).nextOverlapping();
1545
- if (y.done) {
1546
- let v2 = Math.min(e6.doc.length, _ + this.spec.unquoted.length);
1547
- y = stringCursor(this.spec, e6, 0, v2).nextOverlapping();
1572
+ nextMatch(e6, y, b) {
1573
+ let x = stringCursor(this.spec, e6, b, e6.doc.length).nextOverlapping();
1574
+ if (x.done) {
1575
+ let b2 = Math.min(e6.doc.length, y + this.spec.unquoted.length);
1576
+ x = stringCursor(this.spec, e6, 0, b2).nextOverlapping();
1548
1577
  }
1549
- return y.done || y.value.from == _ && y.value.to == v ? null : y.value;
1550
- }
1551
- prevMatchInRange(e6, _, v) {
1552
- for (let y = v; ; ) {
1553
- let v2 = Math.max(_, y - 1e4 - this.spec.unquoted.length), b = stringCursor(this.spec, e6, v2, y), x = null;
1554
- for (; !b.nextOverlapping().done; ) x = b.value;
1555
- if (x) return x;
1556
- if (v2 == _) return null;
1557
- y -= 1e4;
1578
+ return x.done || x.value.from == y && x.value.to == b ? null : x.value;
1579
+ }
1580
+ prevMatchInRange(e6, y, b) {
1581
+ for (let x = b; ; ) {
1582
+ let b2 = Math.max(y, x - 1e4 - this.spec.unquoted.length), S = stringCursor(this.spec, e6, b2, x), C = null;
1583
+ for (; !S.nextOverlapping().done; ) C = S.value;
1584
+ if (C) return C;
1585
+ if (b2 == y) return null;
1586
+ x -= 1e4;
1558
1587
  }
1559
1588
  }
1560
- prevMatch(e6, _, v) {
1561
- let y = this.prevMatchInRange(e6, 0, _);
1562
- return y || (y = this.prevMatchInRange(e6, Math.max(0, v - this.spec.unquoted.length), e6.doc.length)), y && (y.from != _ || y.to != v) ? y : null;
1589
+ prevMatch(e6, y, b) {
1590
+ let x = this.prevMatchInRange(e6, 0, y);
1591
+ 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;
1563
1592
  }
1564
1593
  getReplacement(e6) {
1565
1594
  return this.spec.unquote(this.spec.replace);
1566
1595
  }
1567
- matchAll(e6, _) {
1568
- let v = stringCursor(this.spec, e6, 0, e6.doc.length), y = [];
1569
- for (; !v.next().done; ) {
1570
- if (y.length >= _) return null;
1571
- y.push(v.value);
1596
+ matchAll(e6, y) {
1597
+ let b = stringCursor(this.spec, e6, 0, e6.doc.length), x = [];
1598
+ for (; !b.next().done; ) {
1599
+ if (x.length >= y) return null;
1600
+ x.push(b.value);
1572
1601
  }
1573
- return y;
1602
+ return x;
1574
1603
  }
1575
- highlight(e6, _, v, y) {
1576
- let b = stringCursor(this.spec, e6, Math.max(0, _ - this.spec.unquoted.length), Math.min(v + this.spec.unquoted.length, e6.doc.length));
1577
- for (; !b.next().done; ) y(b.value.from, b.value.to);
1604
+ highlight(e6, y, b, x) {
1605
+ let S = stringCursor(this.spec, e6, Math.max(0, y - this.spec.unquoted.length), Math.min(b + this.spec.unquoted.length, e6.doc.length));
1606
+ for (; !S.next().done; ) x(S.value.from, S.value.to);
1578
1607
  }
1579
1608
  };
1580
- function regexpCursor(e6, _, v, y) {
1581
- return new RegExpCursor(_.doc, e6.search, {
1609
+ function regexpCursor(e6, y, b, x) {
1610
+ return new RegExpCursor(y.doc, e6.search, {
1582
1611
  ignoreCase: !e6.caseSensitive,
1583
- test: e6.wholeWord ? regexpWordTest(_.charCategorizer(_.selection.main.head)) : void 0
1584
- }, v, y);
1612
+ test: e6.wholeWord ? regexpWordTest(y.charCategorizer(y.selection.main.head)) : void 0
1613
+ }, b, x);
1585
1614
  }
1586
- function charBefore(e6, _) {
1587
- return e6.slice(findClusterBreak(e6, _, false), _);
1615
+ function charBefore(e6, y) {
1616
+ return e6.slice(findClusterBreak(e6, y, false), y);
1588
1617
  }
1589
- function charAfter(e6, _) {
1590
- return e6.slice(_, findClusterBreak(e6, _));
1618
+ function charAfter(e6, y) {
1619
+ return e6.slice(y, findClusterBreak(e6, y));
1591
1620
  }
1592
1621
  function regexpWordTest(e6) {
1593
- return (_, v, y) => !y[0].length || (e6(charBefore(y.input, y.index)) != CharCategory.Word || e6(charAfter(y.input, y.index)) != CharCategory.Word) && (e6(charAfter(y.input, y.index + y[0].length)) != CharCategory.Word || e6(charBefore(y.input, y.index + y[0].length)) != CharCategory.Word);
1622
+ 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);
1594
1623
  }
1595
1624
  var RegExpQuery = class extends QueryType {
1596
- nextMatch(e6, _, v) {
1597
- let y = regexpCursor(this.spec, e6, v, e6.doc.length).next();
1598
- return y.done && (y = regexpCursor(this.spec, e6, 0, _).next()), y.done ? null : y.value;
1599
- }
1600
- prevMatchInRange(e6, _, v) {
1601
- for (let y = 1; ; y++) {
1602
- let b = Math.max(_, v - y * 1e4), x = regexpCursor(this.spec, e6, b, v), S = null;
1603
- for (; !x.next().done; ) S = x.value;
1604
- if (S && (b == _ || S.from > b + 10)) return S;
1605
- if (b == _) return null;
1625
+ nextMatch(e6, y, b) {
1626
+ let x = regexpCursor(this.spec, e6, b, e6.doc.length).next();
1627
+ return x.done && (x = regexpCursor(this.spec, e6, 0, y).next()), x.done ? null : x.value;
1628
+ }
1629
+ prevMatchInRange(e6, y, b) {
1630
+ for (let x = 1; ; x++) {
1631
+ let S = Math.max(y, b - x * 1e4), C = regexpCursor(this.spec, e6, S, b), w = null;
1632
+ for (; !C.next().done; ) w = C.value;
1633
+ if (w && (S == y || w.from > S + 10)) return w;
1634
+ if (S == y) return null;
1606
1635
  }
1607
1636
  }
1608
- prevMatch(e6, _, v) {
1609
- return this.prevMatchInRange(e6, 0, _) || this.prevMatchInRange(e6, v, e6.doc.length);
1637
+ prevMatch(e6, y, b) {
1638
+ return this.prevMatchInRange(e6, 0, y) || this.prevMatchInRange(e6, b, e6.doc.length);
1610
1639
  }
1611
1640
  getReplacement(e6) {
1612
- return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (_, v) => {
1613
- if (v == "&") return e6.match[0];
1614
- if (v == "$") return "$";
1615
- for (let _2 = v.length; _2 > 0; _2--) {
1616
- let y = +v.slice(0, _2);
1617
- if (y > 0 && y < e6.match.length) return e6.match[y] + v.slice(_2);
1641
+ return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (y, b) => {
1642
+ if (b == "&") return e6.match[0];
1643
+ if (b == "$") return "$";
1644
+ for (let y2 = b.length; y2 > 0; y2--) {
1645
+ let x = +b.slice(0, y2);
1646
+ if (x > 0 && x < e6.match.length) return e6.match[x] + b.slice(y2);
1618
1647
  }
1619
- return _;
1648
+ return y;
1620
1649
  });
1621
1650
  }
1622
- matchAll(e6, _) {
1623
- let v = regexpCursor(this.spec, e6, 0, e6.doc.length), y = [];
1624
- for (; !v.next().done; ) {
1625
- if (y.length >= _) return null;
1626
- y.push(v.value);
1651
+ matchAll(e6, y) {
1652
+ let b = regexpCursor(this.spec, e6, 0, e6.doc.length), x = [];
1653
+ for (; !b.next().done; ) {
1654
+ if (x.length >= y) return null;
1655
+ x.push(b.value);
1627
1656
  }
1628
- return y;
1657
+ return x;
1629
1658
  }
1630
- highlight(e6, _, v, y) {
1631
- let b = regexpCursor(this.spec, e6, Math.max(0, _ - 250), Math.min(v + 250, e6.doc.length));
1632
- for (; !b.next().done; ) y(b.value.from, b.value.to);
1659
+ highlight(e6, y, b, x) {
1660
+ let S = regexpCursor(this.spec, e6, Math.max(0, y - 250), Math.min(b + 250, e6.doc.length));
1661
+ for (; !S.next().done; ) x(S.value.from, S.value.to);
1633
1662
  }
1634
1663
  }, setSearchQuery = /* @__PURE__ */ StateEffect.define(), togglePanel$1 = /* @__PURE__ */ StateEffect.define(), searchState = /* @__PURE__ */ StateField.define({
1635
1664
  create(e6) {
1636
1665
  return new SearchState(defaultQuery(e6).create(), null);
1637
1666
  },
1638
- update(e6, _) {
1639
- for (let v of _.effects) v.is(setSearchQuery) ? e6 = new SearchState(v.value.create(), e6.panel) : v.is(togglePanel$1) && (e6 = new SearchState(e6.query, v.value ? createSearchPanel : null));
1667
+ update(e6, y) {
1668
+ for (let b of y.effects) b.is(setSearchQuery) ? e6 = new SearchState(b.value.create(), e6.panel) : b.is(togglePanel$1) && (e6 = new SearchState(e6.query, b.value ? createSearchPanel : null));
1640
1669
  return e6;
1641
1670
  },
1642
1671
  provide: (e6) => showPanel.from(e6, (e7) => e7.panel)
1643
1672
  }), SearchState = class {
1644
- constructor(e6, _) {
1645
- this.query = e6, this.panel = _;
1673
+ constructor(e6, y) {
1674
+ this.query = e6, this.panel = y;
1646
1675
  }
1647
1676
  }, matchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch" }), selectedMatchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
1648
1677
  constructor(e6) {
1649
1678
  this.view = e6, this.decorations = this.highlight(e6.state.field(searchState));
1650
1679
  }
1651
1680
  update(e6) {
1652
- let _ = e6.state.field(searchState);
1653
- (_ != e6.startState.field(searchState) || e6.docChanged || e6.selectionSet || e6.viewportChanged) && (this.decorations = this.highlight(_));
1654
- }
1655
- highlight({ query: e6, panel: _ }) {
1656
- if (!_ || !e6.spec.valid) return Decoration.none;
1657
- let { view: v } = this, y = new RangeSetBuilder();
1658
- for (let _2 = 0, b = v.visibleRanges, x = b.length; _2 < x; _2++) {
1659
- let { from: S, to: C } = b[_2];
1660
- for (; _2 < x - 1 && C > b[_2 + 1].from - 500; ) C = b[++_2].to;
1661
- e6.highlight(v.state, S, C, (e7, _3) => {
1662
- let b2 = v.state.selection.ranges.some((v2) => v2.from == e7 && v2.to == _3);
1663
- y.add(e7, _3, b2 ? selectedMatchMark : matchMark);
1681
+ let y = e6.state.field(searchState);
1682
+ (y != e6.startState.field(searchState) || e6.docChanged || e6.selectionSet || e6.viewportChanged) && (this.decorations = this.highlight(y));
1683
+ }
1684
+ highlight({ query: e6, panel: y }) {
1685
+ if (!y || !e6.spec.valid) return Decoration.none;
1686
+ let { view: b } = this, x = new RangeSetBuilder();
1687
+ for (let y2 = 0, S = b.visibleRanges, C = S.length; y2 < C; y2++) {
1688
+ let { from: w, to: T } = S[y2];
1689
+ for (; y2 < C - 1 && T > S[y2 + 1].from - 500; ) T = S[++y2].to;
1690
+ e6.highlight(b.state, w, T, (e7, y3) => {
1691
+ let S2 = b.state.selection.ranges.some((b2) => b2.from == e7 && b2.to == y3);
1692
+ x.add(e7, y3, S2 ? selectedMatchMark : matchMark);
1664
1693
  });
1665
1694
  }
1666
- return y.finish();
1695
+ return x.finish();
1667
1696
  }
1668
1697
  }, { decorations: (e6) => e6.decorations });
1669
1698
  function searchCommand(e6) {
1670
- return (_) => {
1671
- let v = _.state.field(searchState, false);
1672
- return v && v.query.spec.valid ? e6(_, v) : openSearchPanel(_);
1699
+ return (y) => {
1700
+ let b = y.state.field(searchState, false);
1701
+ return b && b.query.spec.valid ? e6(y, b) : openSearchPanel(y);
1673
1702
  };
1674
1703
  }
1675
- var findNext = /* @__PURE__ */ searchCommand((e6, { query: _ }) => {
1676
- let { to: v } = e6.state.selection.main, y = _.nextMatch(e6.state, v, v);
1677
- if (!y) return false;
1678
- let b = EditorSelection.single(y.from, y.to), x = e6.state.facet(searchConfigFacet);
1704
+ var findNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
1705
+ let { to: b } = e6.state.selection.main, x = y.nextMatch(e6.state, b, b);
1706
+ if (!x) return false;
1707
+ let S = EditorSelection.single(x.from, x.to), C = e6.state.facet(searchConfigFacet);
1679
1708
  return e6.dispatch({
1680
- selection: b,
1681
- effects: [announceMatch(e6, y), x.scrollToMatch(b.main, e6)],
1709
+ selection: S,
1710
+ effects: [announceMatch(e6, x), C.scrollToMatch(S.main, e6)],
1682
1711
  userEvent: "select.search"
1683
1712
  }), selectSearchInput(e6), true;
1684
- }), findPrevious = /* @__PURE__ */ searchCommand((e6, { query: _ }) => {
1685
- let { state: v } = e6, { from: y } = v.selection.main, b = _.prevMatch(v, y, y);
1686
- if (!b) return false;
1687
- let x = EditorSelection.single(b.from, b.to), S = e6.state.facet(searchConfigFacet);
1713
+ }), findPrevious = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
1714
+ let { state: b } = e6, { from: x } = b.selection.main, S = y.prevMatch(b, x, x);
1715
+ if (!S) return false;
1716
+ let C = EditorSelection.single(S.from, S.to), w = e6.state.facet(searchConfigFacet);
1688
1717
  return e6.dispatch({
1689
- selection: x,
1690
- effects: [announceMatch(e6, b), S.scrollToMatch(x.main, e6)],
1718
+ selection: C,
1719
+ effects: [announceMatch(e6, S), w.scrollToMatch(C.main, e6)],
1691
1720
  userEvent: "select.search"
1692
1721
  }), selectSearchInput(e6), true;
1693
- }), selectMatches = /* @__PURE__ */ searchCommand((e6, { query: _ }) => {
1694
- let v = _.matchAll(e6.state, 1e3);
1695
- return !v || !v.length ? false : (e6.dispatch({
1696
- selection: EditorSelection.create(v.map((e7) => EditorSelection.range(e7.from, e7.to))),
1722
+ }), selectMatches = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
1723
+ let b = y.matchAll(e6.state, 1e3);
1724
+ return !b || !b.length ? false : (e6.dispatch({
1725
+ selection: EditorSelection.create(b.map((e7) => EditorSelection.range(e7.from, e7.to))),
1697
1726
  userEvent: "select.search.matches"
1698
1727
  }), true);
1699
- }), selectSelectionMatches = ({ state: e6, dispatch: _ }) => {
1700
- let v = e6.selection;
1701
- if (v.ranges.length > 1 || v.main.empty) return false;
1702
- let { from: y, to: b } = v.main, x = [], S = 0;
1703
- for (let _2 = new SearchCursor(e6.doc, e6.sliceDoc(y, b)); !_2.next().done; ) {
1704
- if (x.length > 1e3) return false;
1705
- _2.value.from == y && (S = x.length), x.push(EditorSelection.range(_2.value.from, _2.value.to));
1706
- }
1707
- return _(e6.update({
1708
- selection: EditorSelection.create(x, S),
1728
+ }), selectSelectionMatches = ({ state: e6, dispatch: y }) => {
1729
+ let b = e6.selection;
1730
+ if (b.ranges.length > 1 || b.main.empty) return false;
1731
+ let { from: x, to: S } = b.main, C = [], w = 0;
1732
+ for (let y2 = new SearchCursor(e6.doc, e6.sliceDoc(x, S)); !y2.next().done; ) {
1733
+ if (C.length > 1e3) return false;
1734
+ y2.value.from == x && (w = C.length), C.push(EditorSelection.range(y2.value.from, y2.value.to));
1735
+ }
1736
+ return y(e6.update({
1737
+ selection: EditorSelection.create(C, w),
1709
1738
  userEvent: "select.search.matches"
1710
1739
  })), true;
1711
- }, replaceNext = /* @__PURE__ */ searchCommand((e6, { query: _ }) => {
1712
- let { state: v } = e6, { from: y, to: b } = v.selection.main;
1713
- if (v.readOnly) return false;
1714
- let x = _.nextMatch(v, y, y);
1715
- if (!x) return false;
1716
- let S = x, C = [], w, T, E = [];
1717
- S.from == y && S.to == b && (T = v.toText(_.getReplacement(S)), C.push({
1718
- from: S.from,
1719
- to: S.to,
1720
- insert: T
1721
- }), S = _.nextMatch(v, S.from, S.to), E.push(EditorView.announce.of(v.phrase("replaced match on line $", v.doc.lineAt(y).number) + ".")));
1722
- let D = e6.state.changes(C);
1723
- return S && (w = EditorSelection.single(S.from, S.to).map(D), E.push(announceMatch(e6, S)), E.push(v.facet(searchConfigFacet).scrollToMatch(w.main, e6))), e6.dispatch({
1724
- changes: D,
1725
- selection: w,
1726
- effects: E,
1740
+ }, replaceNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
1741
+ let { state: b } = e6, { from: x, to: S } = b.selection.main;
1742
+ if (b.readOnly) return false;
1743
+ let C = y.nextMatch(b, x, x);
1744
+ if (!C) return false;
1745
+ let w = C, T = [], E, D, O = [];
1746
+ w.from == x && w.to == S && (D = b.toText(y.getReplacement(w)), T.push({
1747
+ from: w.from,
1748
+ to: w.to,
1749
+ insert: D
1750
+ }), w = y.nextMatch(b, w.from, w.to), O.push(EditorView.announce.of(b.phrase("replaced match on line $", b.doc.lineAt(x).number) + ".")));
1751
+ let k = e6.state.changes(T);
1752
+ 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({
1753
+ changes: k,
1754
+ selection: E,
1755
+ effects: O,
1727
1756
  userEvent: "input.replace"
1728
1757
  }), true;
1729
- }), replaceAll = /* @__PURE__ */ searchCommand((e6, { query: _ }) => {
1758
+ }), replaceAll = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
1730
1759
  if (e6.state.readOnly) return false;
1731
- let v = _.matchAll(e6.state, 1e9).map((e7) => {
1732
- let { from: v2, to: y2 } = e7;
1760
+ let b = y.matchAll(e6.state, 1e9).map((e7) => {
1761
+ let { from: b2, to: x2 } = e7;
1733
1762
  return {
1734
- from: v2,
1735
- to: y2,
1736
- insert: _.getReplacement(e7)
1763
+ from: b2,
1764
+ to: x2,
1765
+ insert: y.getReplacement(e7)
1737
1766
  };
1738
1767
  });
1739
- if (!v.length) return false;
1740
- let y = e6.state.phrase("replaced $ matches", v.length) + ".";
1768
+ if (!b.length) return false;
1769
+ let x = e6.state.phrase("replaced $ matches", b.length) + ".";
1741
1770
  return e6.dispatch({
1742
- changes: v,
1743
- effects: EditorView.announce.of(y),
1771
+ changes: b,
1772
+ effects: EditorView.announce.of(x),
1744
1773
  userEvent: "input.replace.all"
1745
1774
  }), true;
1746
1775
  });
1747
1776
  function createSearchPanel(e6) {
1748
1777
  return e6.state.facet(searchConfigFacet).createPanel(e6);
1749
1778
  }
1750
- function defaultQuery(e6, _) {
1751
- let v = e6.selection.main, y = v.empty || v.to > v.from + 100 ? "" : e6.sliceDoc(v.from, v.to);
1752
- if (_ && !y) return _;
1753
- let b = e6.facet(searchConfigFacet);
1779
+ function defaultQuery(e6, y) {
1780
+ let b = e6.selection.main, x = b.empty || b.to > b.from + 100 ? "" : e6.sliceDoc(b.from, b.to);
1781
+ if (y && !x) return y;
1782
+ let S = e6.facet(searchConfigFacet);
1754
1783
  return new SearchQuery({
1755
- search: (_ == null ? void 0 : _.literal) ?? b.literal ? y : y.replace(/\n/g, "\\n"),
1756
- caseSensitive: (_ == null ? void 0 : _.caseSensitive) ?? b.caseSensitive,
1757
- literal: (_ == null ? void 0 : _.literal) ?? b.literal,
1758
- regexp: (_ == null ? void 0 : _.regexp) ?? b.regexp,
1759
- wholeWord: (_ == null ? void 0 : _.wholeWord) ?? b.wholeWord
1784
+ search: (y == null ? void 0 : y.literal) ?? S.literal ? x : x.replace(/\n/g, "\\n"),
1785
+ caseSensitive: (y == null ? void 0 : y.caseSensitive) ?? S.caseSensitive,
1786
+ literal: (y == null ? void 0 : y.literal) ?? S.literal,
1787
+ regexp: (y == null ? void 0 : y.regexp) ?? S.regexp,
1788
+ wholeWord: (y == null ? void 0 : y.wholeWord) ?? S.wholeWord
1760
1789
  });
1761
1790
  }
1762
1791
  function getSearchInput(e6) {
1763
- let _ = getPanel(e6, createSearchPanel);
1764
- return _ && _.dom.querySelector("[main-field]");
1792
+ let y = getPanel(e6, createSearchPanel);
1793
+ return y && y.dom.querySelector("[main-field]");
1765
1794
  }
1766
1795
  function selectSearchInput(e6) {
1767
- let _ = getSearchInput(e6);
1768
- _ && _ == e6.root.activeElement && _.select();
1796
+ let y = getSearchInput(e6);
1797
+ y && y == e6.root.activeElement && y.select();
1769
1798
  }
1770
1799
  var openSearchPanel = (e6) => {
1771
- let _ = e6.state.field(searchState, false);
1772
- if (_ && _.panel) {
1773
- let v = getSearchInput(e6);
1774
- if (v && v != e6.root.activeElement) {
1775
- let y = defaultQuery(e6.state, _.query.spec);
1776
- y.valid && e6.dispatch({ effects: setSearchQuery.of(y) }), v.focus(), v.select();
1800
+ let y = e6.state.field(searchState, false);
1801
+ if (y && y.panel) {
1802
+ let b = getSearchInput(e6);
1803
+ if (b && b != e6.root.activeElement) {
1804
+ let x = defaultQuery(e6.state, y.query.spec);
1805
+ x.valid && e6.dispatch({ effects: setSearchQuery.of(x) }), b.focus(), b.select();
1777
1806
  }
1778
- } else e6.dispatch({ effects: [togglePanel$1.of(true), _ ? setSearchQuery.of(defaultQuery(e6.state, _.query.spec)) : StateEffect.appendConfig.of(searchExtensions)] });
1807
+ } else e6.dispatch({ effects: [togglePanel$1.of(true), y ? setSearchQuery.of(defaultQuery(e6.state, y.query.spec)) : StateEffect.appendConfig.of(searchExtensions)] });
1779
1808
  return true;
1780
1809
  }, closeSearchPanel = (e6) => {
1781
- let _ = e6.state.field(searchState, false);
1782
- if (!_ || !_.panel) return false;
1783
- let v = getPanel(e6, createSearchPanel);
1784
- return v && v.dom.contains(e6.root.activeElement) && e6.focus(), e6.dispatch({ effects: togglePanel$1.of(false) }), true;
1810
+ let y = e6.state.field(searchState, false);
1811
+ if (!y || !y.panel) return false;
1812
+ let b = getPanel(e6, createSearchPanel);
1813
+ return b && b.dom.contains(e6.root.activeElement) && e6.focus(), e6.dispatch({ effects: togglePanel$1.of(false) }), true;
1785
1814
  }, searchKeymap = [
1786
1815
  {
1787
1816
  key: "Mod-f",
@@ -1823,9 +1852,9 @@ var openSearchPanel = (e6) => {
1823
1852
  ], SearchPanel = class {
1824
1853
  constructor(e6) {
1825
1854
  this.view = e6;
1826
- let _ = this.query = e6.state.field(searchState).query.spec;
1855
+ let y = this.query = e6.state.field(searchState).query.spec;
1827
1856
  this.commit = this.commit.bind(this), this.searchField = crelt("input", {
1828
- value: _.search,
1857
+ value: y.search,
1829
1858
  placeholder: phrase(e6, "Find"),
1830
1859
  "aria-label": phrase(e6, "Find"),
1831
1860
  class: "cm-textfield",
@@ -1835,7 +1864,7 @@ var openSearchPanel = (e6) => {
1835
1864
  onchange: this.commit,
1836
1865
  onkeyup: this.commit
1837
1866
  }), this.replaceField = crelt("input", {
1838
- value: _.replace,
1867
+ value: y.replace,
1839
1868
  placeholder: phrase(e6, "Replace"),
1840
1869
  "aria-label": phrase(e6, "Replace"),
1841
1870
  class: "cm-textfield",
@@ -1847,45 +1876,45 @@ var openSearchPanel = (e6) => {
1847
1876
  type: "checkbox",
1848
1877
  name: "case",
1849
1878
  form: "",
1850
- checked: _.caseSensitive,
1879
+ checked: y.caseSensitive,
1851
1880
  onchange: this.commit
1852
1881
  }), this.reField = crelt("input", {
1853
1882
  type: "checkbox",
1854
1883
  name: "re",
1855
1884
  form: "",
1856
- checked: _.regexp,
1885
+ checked: y.regexp,
1857
1886
  onchange: this.commit
1858
1887
  }), this.wordField = crelt("input", {
1859
1888
  type: "checkbox",
1860
1889
  name: "word",
1861
1890
  form: "",
1862
- checked: _.wholeWord,
1891
+ checked: y.wholeWord,
1863
1892
  onchange: this.commit
1864
1893
  });
1865
- function v(e7, _2, v2) {
1894
+ function b(e7, y2, b2) {
1866
1895
  return crelt("button", {
1867
1896
  class: "cm-button",
1868
1897
  name: e7,
1869
- onclick: _2,
1898
+ onclick: y2,
1870
1899
  type: "button"
1871
- }, v2);
1900
+ }, b2);
1872
1901
  }
1873
1902
  this.dom = crelt("div", {
1874
1903
  onkeydown: (e7) => this.keydown(e7),
1875
1904
  class: "cm-search"
1876
1905
  }, [
1877
1906
  this.searchField,
1878
- v("next", () => findNext(e6), [phrase(e6, "next")]),
1879
- v("prev", () => findPrevious(e6), [phrase(e6, "previous")]),
1880
- v("select", () => selectMatches(e6), [phrase(e6, "all")]),
1907
+ b("next", () => findNext(e6), [phrase(e6, "next")]),
1908
+ b("prev", () => findPrevious(e6), [phrase(e6, "previous")]),
1909
+ b("select", () => selectMatches(e6), [phrase(e6, "all")]),
1881
1910
  crelt("label", null, [this.caseField, phrase(e6, "match case")]),
1882
1911
  crelt("label", null, [this.reField, phrase(e6, "regexp")]),
1883
1912
  crelt("label", null, [this.wordField, phrase(e6, "by word")]),
1884
1913
  ...e6.state.readOnly ? [] : [
1885
1914
  crelt("br"),
1886
1915
  this.replaceField,
1887
- v("replace", () => replaceNext(e6), [phrase(e6, "replace")]),
1888
- v("replaceAll", () => replaceAll(e6), [phrase(e6, "replace all")])
1916
+ b("replace", () => replaceNext(e6), [phrase(e6, "replace")]),
1917
+ b("replaceAll", () => replaceAll(e6), [phrase(e6, "replace all")])
1889
1918
  ],
1890
1919
  crelt("button", {
1891
1920
  name: "close",
@@ -1909,7 +1938,7 @@ var openSearchPanel = (e6) => {
1909
1938
  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));
1910
1939
  }
1911
1940
  update(e6) {
1912
- for (let _ of e6.transactions) for (let e7 of _.effects) e7.is(setSearchQuery) && !e7.value.eq(this.query) && this.setQuery(e7.value);
1941
+ for (let y of e6.transactions) for (let e7 of y.effects) e7.is(setSearchQuery) && !e7.value.eq(this.query) && this.setQuery(e7.value);
1913
1942
  }
1914
1943
  setQuery(e6) {
1915
1944
  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;
@@ -1924,25 +1953,25 @@ var openSearchPanel = (e6) => {
1924
1953
  return this.view.state.facet(searchConfigFacet).top;
1925
1954
  }
1926
1955
  };
1927
- function phrase(e6, _) {
1928
- return e6.state.phrase(_);
1956
+ function phrase(e6, y) {
1957
+ return e6.state.phrase(y);
1929
1958
  }
1930
1959
  var AnnounceMargin = 30, Break = /[\s\.,:;?!]/;
1931
- function announceMatch(e6, { from: _, to: v }) {
1932
- let y = e6.state.doc.lineAt(_), b = e6.state.doc.lineAt(v).to, x = Math.max(y.from, _ - AnnounceMargin), S = Math.min(b, v + AnnounceMargin), C = e6.state.sliceDoc(x, S);
1933
- if (x != y.from) {
1934
- for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(C[e7 + 1]) && Break.test(C[e7])) {
1935
- C = C.slice(e7);
1960
+ function announceMatch(e6, { from: y, to: b }) {
1961
+ 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);
1962
+ if (C != x.from) {
1963
+ for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(T[e7 + 1]) && Break.test(T[e7])) {
1964
+ T = T.slice(e7);
1936
1965
  break;
1937
1966
  }
1938
1967
  }
1939
- if (S != b) {
1940
- for (let e7 = C.length - 1; e7 > C.length - AnnounceMargin; e7--) if (!Break.test(C[e7 - 1]) && Break.test(C[e7])) {
1941
- C = C.slice(0, e7);
1968
+ if (w != S) {
1969
+ for (let e7 = T.length - 1; e7 > T.length - AnnounceMargin; e7--) if (!Break.test(T[e7 - 1]) && Break.test(T[e7])) {
1970
+ T = T.slice(0, e7);
1942
1971
  break;
1943
1972
  }
1944
1973
  }
1945
- return EditorView.announce.of(`${e6.state.phrase("current match")}. ${C} ${e6.state.phrase("on line")} ${y.number}.`);
1974
+ return EditorView.announce.of(`${e6.state.phrase("current match")}. ${T} ${e6.state.phrase("on line")} ${x.number}.`);
1946
1975
  }
1947
1976
  var baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
1948
1977
  ".cm-panel.cm-search": {
@@ -1974,116 +2003,116 @@ var baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
1974
2003
  /* @__PURE__ */ Prec.low(searchHighlighter),
1975
2004
  baseTheme$2
1976
2005
  ], SelectedDiagnostic = class {
1977
- constructor(e6, _, v) {
1978
- this.from = e6, this.to = _, this.diagnostic = v;
2006
+ constructor(e6, y, b) {
2007
+ this.from = e6, this.to = y, this.diagnostic = b;
1979
2008
  }
1980
2009
  }, LintState = class e4 {
1981
- constructor(e6, _, v) {
1982
- this.diagnostics = e6, this.panel = _, this.selected = v;
2010
+ constructor(e6, y, b) {
2011
+ this.diagnostics = e6, this.panel = y, this.selected = b;
1983
2012
  }
1984
- static init(_, v, y) {
1985
- let b = y.facet(lintConfig).markerFilter;
1986
- b && (_ = b(_, y));
1987
- let x = _.slice().sort((e6, _2) => e6.from - _2.from || e6.to - _2.to), S = new RangeSetBuilder(), C = [], w = 0;
2013
+ static init(y, b, x) {
2014
+ let S = x.facet(lintConfig).markerFilter;
2015
+ S && (y = S(y, x));
2016
+ let C = y.slice().sort((e6, y2) => e6.from - y2.from || e6.to - y2.to), w = new RangeSetBuilder(), T = [], E = 0;
1988
2017
  for (let e6 = 0; ; ) {
1989
- let _2 = e6 == x.length ? null : x[e6];
1990
- if (!_2 && !C.length) break;
1991
- let v2, b2;
1992
- for (C.length ? (v2 = w, b2 = C.reduce((e7, _3) => Math.min(e7, _3.to), _2 && _2.from > v2 ? _2.from : 1e8)) : (v2 = _2.from, b2 = _2.to, C.push(_2), e6++); e6 < x.length; ) {
1993
- let _3 = x[e6];
1994
- if (_3.from == v2 && (_3.to > _3.from || _3.to == v2)) C.push(_3), e6++, b2 = Math.min(_3.to, b2);
2018
+ let y2 = e6 == C.length ? null : C[e6];
2019
+ if (!y2 && !T.length) break;
2020
+ let b2, S2;
2021
+ for (T.length ? (b2 = E, S2 = T.reduce((e7, y3) => Math.min(e7, y3.to), y2 && y2.from > b2 ? y2.from : 1e8)) : (b2 = y2.from, S2 = y2.to, T.push(y2), e6++); e6 < C.length; ) {
2022
+ let y3 = C[e6];
2023
+ if (y3.from == b2 && (y3.to > y3.from || y3.to == b2)) T.push(y3), e6++, S2 = Math.min(y3.to, S2);
1995
2024
  else {
1996
- b2 = Math.min(_3.from, b2);
2025
+ S2 = Math.min(y3.from, S2);
1997
2026
  break;
1998
2027
  }
1999
2028
  }
2000
- let T2 = maxSeverity(C);
2001
- if (C.some((e7) => e7.from == e7.to || e7.from == e7.to - 1 && y.doc.lineAt(e7.from).to == e7.from)) S.add(v2, v2, Decoration.widget({
2002
- widget: new DiagnosticWidget(T2),
2003
- diagnostics: C.slice()
2029
+ let D2 = maxSeverity(T);
2030
+ if (T.some((e7) => e7.from == e7.to || e7.from == e7.to - 1 && x.doc.lineAt(e7.from).to == e7.from)) w.add(b2, b2, Decoration.widget({
2031
+ widget: new DiagnosticWidget(D2),
2032
+ diagnostics: T.slice()
2004
2033
  }));
2005
2034
  else {
2006
- let e7 = C.reduce((e8, _3) => _3.markClass ? e8 + " " + _3.markClass : e8, "");
2007
- S.add(v2, b2, Decoration.mark({
2008
- class: "cm-lintRange cm-lintRange-" + T2 + e7,
2009
- diagnostics: C.slice(),
2010
- inclusiveEnd: C.some((e8) => e8.to > b2)
2035
+ let e7 = T.reduce((e8, y3) => y3.markClass ? e8 + " " + y3.markClass : e8, "");
2036
+ w.add(b2, S2, Decoration.mark({
2037
+ class: "cm-lintRange cm-lintRange-" + D2 + e7,
2038
+ diagnostics: T.slice(),
2039
+ inclusiveEnd: T.some((e8) => e8.to > S2)
2011
2040
  }));
2012
2041
  }
2013
- w = b2;
2014
- for (let e7 = 0; e7 < C.length; e7++) C[e7].to <= w && C.splice(e7--, 1);
2042
+ E = S2;
2043
+ for (let e7 = 0; e7 < T.length; e7++) T[e7].to <= E && T.splice(e7--, 1);
2015
2044
  }
2016
- let T = S.finish();
2017
- return new e4(T, v, findDiagnostic(T));
2045
+ let D = w.finish();
2046
+ return new e4(D, b, findDiagnostic(D));
2018
2047
  }
2019
2048
  };
2020
- function findDiagnostic(e6, _ = null, v = 0) {
2021
- let y = null;
2022
- return e6.between(v, 1e9, (e7, v2, { spec: b }) => {
2023
- if (!(_ && b.diagnostics.indexOf(_) < 0)) if (!y) y = new SelectedDiagnostic(e7, v2, _ || b.diagnostics[0]);
2024
- else if (b.diagnostics.indexOf(y.diagnostic) < 0) return false;
2025
- else y = new SelectedDiagnostic(y.from, v2, y.diagnostic);
2026
- }), y;
2049
+ function findDiagnostic(e6, y = null, b = 0) {
2050
+ let x = null;
2051
+ return e6.between(b, 1e9, (e7, b2, { spec: S }) => {
2052
+ if (!(y && S.diagnostics.indexOf(y) < 0)) if (!x) x = new SelectedDiagnostic(e7, b2, y || S.diagnostics[0]);
2053
+ else if (S.diagnostics.indexOf(x.diagnostic) < 0) return false;
2054
+ else x = new SelectedDiagnostic(x.from, b2, x.diagnostic);
2055
+ }), x;
2027
2056
  }
2028
- function hideTooltip(e6, _) {
2029
- let v = _.pos, y = _.end || v, b = e6.state.facet(lintConfig).hideOn(e6, v, y);
2030
- if (b != null) return b;
2031
- let x = e6.startState.doc.lineAt(_.pos);
2032
- return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(x.from, Math.max(x.to, y)));
2057
+ function hideTooltip(e6, y) {
2058
+ let b = y.pos, x = y.end || b, S = e6.state.facet(lintConfig).hideOn(e6, b, x);
2059
+ if (S != null) return S;
2060
+ let C = e6.startState.doc.lineAt(y.pos);
2061
+ return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(C.from, Math.max(C.to, x)));
2033
2062
  }
2034
- function maybeEnableLint(e6, _) {
2035
- return e6.field(lintState, false) ? _ : _.concat(StateEffect.appendConfig.of(lintExtensions));
2063
+ function maybeEnableLint(e6, y) {
2064
+ return e6.field(lintState, false) ? y : y.concat(StateEffect.appendConfig.of(lintExtensions));
2036
2065
  }
2037
- function setDiagnostics(e6, _) {
2038
- return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(_)]) };
2066
+ function setDiagnostics(e6, y) {
2067
+ return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(y)]) };
2039
2068
  }
2040
2069
  var setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define(), togglePanel = /* @__PURE__ */ StateEffect.define(), movePanelSelection = /* @__PURE__ */ StateEffect.define(), lintState = /* @__PURE__ */ StateField.define({
2041
2070
  create() {
2042
2071
  return new LintState(Decoration.none, null, null);
2043
2072
  },
2044
- update(e6, _) {
2045
- if (_.docChanged && e6.diagnostics.size) {
2046
- let v = e6.diagnostics.map(_.changes), y = null, b = e6.panel;
2073
+ update(e6, y) {
2074
+ if (y.docChanged && e6.diagnostics.size) {
2075
+ let b = e6.diagnostics.map(y.changes), x = null, S = e6.panel;
2047
2076
  if (e6.selected) {
2048
- let b2 = _.changes.mapPos(e6.selected.from, 1);
2049
- y = findDiagnostic(v, e6.selected.diagnostic, b2) || findDiagnostic(v, null, b2);
2077
+ let S2 = y.changes.mapPos(e6.selected.from, 1);
2078
+ x = findDiagnostic(b, e6.selected.diagnostic, S2) || findDiagnostic(b, null, S2);
2050
2079
  }
2051
- !v.size && b && _.state.facet(lintConfig).autoPanel && (b = null), e6 = new LintState(v, b, y);
2080
+ !b.size && S && y.state.facet(lintConfig).autoPanel && (S = null), e6 = new LintState(b, S, x);
2052
2081
  }
2053
- for (let v of _.effects) if (v.is(setDiagnosticsEffect)) {
2054
- let y = _.state.facet(lintConfig).autoPanel ? v.value.length ? LintPanel.open : null : e6.panel;
2055
- e6 = LintState.init(v.value, y, _.state);
2056
- } else v.is(togglePanel) ? e6 = new LintState(e6.diagnostics, v.value ? LintPanel.open : null, e6.selected) : v.is(movePanelSelection) && (e6 = new LintState(e6.diagnostics, e6.panel, v.value));
2082
+ for (let b of y.effects) if (b.is(setDiagnosticsEffect)) {
2083
+ let x = y.state.facet(lintConfig).autoPanel ? b.value.length ? LintPanel.open : null : e6.panel;
2084
+ e6 = LintState.init(b.value, x, y.state);
2085
+ } else b.is(togglePanel) ? e6 = new LintState(e6.diagnostics, b.value ? LintPanel.open : null, e6.selected) : b.is(movePanelSelection) && (e6 = new LintState(e6.diagnostics, e6.panel, b.value));
2057
2086
  return e6;
2058
2087
  },
2059
2088
  provide: (e6) => [showPanel.from(e6, (e7) => e7.panel), EditorView.decorations.from(e6, (e7) => e7.diagnostics)]
2060
2089
  }), activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
2061
- function lintTooltip(e6, _, v) {
2062
- let { diagnostics: y } = e6.state.field(lintState), b, x = -1, S = -1;
2063
- y.between(_ - (v < 0 ? 1 : 0), _ + (v > 0 ? 1 : 0), (e7, y2, { spec: C2 }) => {
2064
- if (_ >= e7 && _ <= y2 && (e7 == y2 || (_ > e7 || v > 0) && (_ < y2 || v < 0))) return b = C2.diagnostics, x = e7, S = y2, false;
2090
+ function lintTooltip(e6, y, b) {
2091
+ let { diagnostics: x } = e6.state.field(lintState), S, C = -1, w = -1;
2092
+ x.between(y - (b < 0 ? 1 : 0), y + (b > 0 ? 1 : 0), (e7, x2, { spec: T2 }) => {
2093
+ if (y >= e7 && y <= x2 && (e7 == x2 || (y > e7 || b > 0) && (y < x2 || b < 0))) return S = T2.diagnostics, C = e7, w = x2, false;
2065
2094
  });
2066
- let C = e6.state.facet(lintConfig).tooltipFilter;
2067
- return b && C && (b = C(b, e6.state)), b ? {
2068
- pos: x,
2069
- end: S,
2070
- above: e6.state.doc.lineAt(x).to < S,
2095
+ let T = e6.state.facet(lintConfig).tooltipFilter;
2096
+ return S && T && (S = T(S, e6.state)), S ? {
2097
+ pos: C,
2098
+ end: w,
2099
+ above: e6.state.doc.lineAt(C).to < w,
2071
2100
  create() {
2072
- return { dom: diagnosticsTooltip(e6, b) };
2101
+ return { dom: diagnosticsTooltip(e6, S) };
2073
2102
  }
2074
2103
  } : null;
2075
2104
  }
2076
- function diagnosticsTooltip(e6, _) {
2077
- return crelt("ul", { class: "cm-tooltip-lint" }, _.map((_2) => renderDiagnostic(e6, _2, false)));
2105
+ function diagnosticsTooltip(e6, y) {
2106
+ return crelt("ul", { class: "cm-tooltip-lint" }, y.map((y2) => renderDiagnostic(e6, y2, false)));
2078
2107
  }
2079
2108
  var openLintPanel = (e6) => {
2080
- let _ = e6.state.field(lintState, false);
2081
- (!_ || !_.panel) && e6.dispatch({ effects: maybeEnableLint(e6.state, [togglePanel.of(true)]) });
2082
- let v = getPanel(e6, LintPanel.open);
2083
- return v && v.dom.querySelector(".cm-panel-lint ul").focus(), true;
2109
+ let y = e6.state.field(lintState, false);
2110
+ (!y || !y.panel) && e6.dispatch({ effects: maybeEnableLint(e6.state, [togglePanel.of(true)]) });
2111
+ let b = getPanel(e6, LintPanel.open);
2112
+ return b && b.dom.querySelector(".cm-panel-lint ul").focus(), true;
2084
2113
  }, closeLintPanel = (e6) => {
2085
- let _ = e6.state.field(lintState, false);
2086
- return !_ || !_.panel ? false : (e6.dispatch({ effects: togglePanel.of(false) }), true);
2114
+ let y = e6.state.field(lintState, false);
2115
+ return !y || !y.panel ? false : (e6.dispatch({ effects: togglePanel.of(false) }), true);
2087
2116
  }, lintKeymap = [{
2088
2117
  key: "Mod-Shift-m",
2089
2118
  run: openLintPanel,
@@ -2091,13 +2120,13 @@ var openLintPanel = (e6) => {
2091
2120
  }, {
2092
2121
  key: "F8",
2093
2122
  run: (e6) => {
2094
- let _ = e6.state.field(lintState, false);
2095
- if (!_) return false;
2096
- let v = e6.state.selection.main, y = _.diagnostics.iter(v.to + 1);
2097
- return !y.value && (y = _.diagnostics.iter(0), !y.value || y.from == v.from && y.to == v.to) ? false : (e6.dispatch({
2123
+ let y = e6.state.field(lintState, false);
2124
+ if (!y) return false;
2125
+ let b = e6.state.selection.main, x = y.diagnostics.iter(b.to + 1);
2126
+ return !x.value && (x = y.diagnostics.iter(0), !x.value || x.from == b.from && x.to == b.to) ? false : (e6.dispatch({
2098
2127
  selection: {
2099
- anchor: y.from,
2100
- head: y.to
2128
+ anchor: x.from,
2129
+ head: x.to
2101
2130
  },
2102
2131
  scrollIntoView: true
2103
2132
  }), true);
@@ -2105,8 +2134,8 @@ var openLintPanel = (e6) => {
2105
2134
  }], lintPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
2106
2135
  constructor(e6) {
2107
2136
  this.view = e6, this.timeout = -1, this.set = true;
2108
- let { delay: _ } = e6.state.facet(lintConfig);
2109
- this.lintTime = Date.now() + _, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, _);
2137
+ let { delay: y } = e6.state.facet(lintConfig);
2138
+ this.lintTime = Date.now() + y, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, y);
2110
2139
  }
2111
2140
  run() {
2112
2141
  clearTimeout(this.timeout);
@@ -2114,17 +2143,17 @@ var openLintPanel = (e6) => {
2114
2143
  if (e6 < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e6);
2115
2144
  else {
2116
2145
  this.set = false;
2117
- let { state: e7 } = this.view, { sources: _ } = e7.facet(lintConfig);
2118
- _.length && batchResults(_.map((e8) => Promise.resolve(e8(this.view))), (_2) => {
2119
- this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state, _2.reduce((e8, _3) => e8.concat(_3))));
2146
+ let { state: e7 } = this.view, { sources: y } = e7.facet(lintConfig);
2147
+ y.length && batchResults(y.map((e8) => Promise.resolve(e8(this.view))), (y2) => {
2148
+ this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state, y2.reduce((e8, y3) => e8.concat(y3))));
2120
2149
  }, (e8) => {
2121
2150
  logException(this.view.state, e8);
2122
2151
  });
2123
2152
  }
2124
2153
  }
2125
2154
  update(e6) {
2126
- let _ = e6.state.facet(lintConfig);
2127
- (e6.docChanged || _ != e6.startState.facet(lintConfig) || _.needsRefresh && _.needsRefresh(e6)) && (this.lintTime = Date.now() + _.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, _.delay)));
2155
+ let y = e6.state.facet(lintConfig);
2156
+ (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)));
2128
2157
  }
2129
2158
  force() {
2130
2159
  this.set && (this.lintTime = Date.now(), this.run());
@@ -2133,67 +2162,80 @@ var openLintPanel = (e6) => {
2133
2162
  clearTimeout(this.timeout);
2134
2163
  }
2135
2164
  });
2136
- function batchResults(e6, _, v) {
2137
- let y = [], b = -1;
2138
- for (let x of e6) x.then((v2) => {
2139
- y.push(v2), clearTimeout(b), y.length == e6.length ? _(y) : b = setTimeout(() => _(y), 200);
2140
- }, v);
2165
+ function batchResults(e6, y, b) {
2166
+ let x = [], S = -1;
2167
+ for (let C of e6) C.then((b2) => {
2168
+ x.push(b2), clearTimeout(S), x.length == e6.length ? y(x) : S = setTimeout(() => y(x), 200);
2169
+ }, b);
2141
2170
  }
2142
2171
  var lintConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
2143
- return Object.assign({ sources: e6.map((e7) => e7.source).filter((e7) => e7 != null) }, combineConfig(e6.map((e7) => e7.config), {
2144
- delay: 750,
2145
- markerFilter: null,
2146
- tooltipFilter: null,
2147
- needsRefresh: null,
2148
- hideOn: () => null
2149
- }, { needsRefresh: (e7, _) => e7 ? _ ? (v) => e7(v) || _(v) : e7 : _ }));
2172
+ return {
2173
+ sources: e6.map((e7) => e7.source).filter((e7) => e7 != null),
2174
+ ...combineConfig(e6.map((e7) => e7.config), {
2175
+ delay: 750,
2176
+ markerFilter: null,
2177
+ tooltipFilter: null,
2178
+ needsRefresh: null,
2179
+ hideOn: () => null
2180
+ }, {
2181
+ delay: Math.max,
2182
+ markerFilter: combineFilter,
2183
+ tooltipFilter: combineFilter,
2184
+ needsRefresh: (e7, y) => e7 ? y ? (b) => e7(b) || y(b) : e7 : y,
2185
+ hideOn: (e7, y) => e7 ? y ? (b, x, S) => e7(b, x, S) || y(b, x, S) : e7 : y,
2186
+ autoPanel: (e7, y) => e7 || y
2187
+ })
2188
+ };
2150
2189
  } });
2151
- function linter(e6, _ = {}) {
2190
+ function combineFilter(e6, y) {
2191
+ return e6 ? y ? (b, x) => y(e6(b, x), x) : e6 : y;
2192
+ }
2193
+ function linter(e6, y = {}) {
2152
2194
  return [
2153
2195
  lintConfig.of({
2154
2196
  source: e6,
2155
- config: _
2197
+ config: y
2156
2198
  }),
2157
2199
  lintPlugin,
2158
2200
  lintExtensions
2159
2201
  ];
2160
2202
  }
2161
2203
  function assignKeys(e6) {
2162
- let _ = [];
2163
- if (e6) actions: for (let { name: v } of e6) {
2164
- for (let e7 = 0; e7 < v.length; e7++) {
2165
- let y = v[e7];
2166
- if (/[a-zA-Z]/.test(y) && !_.some((e8) => e8.toLowerCase() == y.toLowerCase())) {
2167
- _.push(y);
2204
+ let y = [];
2205
+ if (e6) actions: for (let { name: b } of e6) {
2206
+ for (let e7 = 0; e7 < b.length; e7++) {
2207
+ let x = b[e7];
2208
+ if (/[a-zA-Z]/.test(x) && !y.some((e8) => e8.toLowerCase() == x.toLowerCase())) {
2209
+ y.push(x);
2168
2210
  continue actions;
2169
2211
  }
2170
2212
  }
2171
- _.push("");
2213
+ y.push("");
2172
2214
  }
2173
- return _;
2215
+ return y;
2174
2216
  }
2175
- function renderDiagnostic(e6, _, v) {
2217
+ function renderDiagnostic(e6, y, b) {
2176
2218
  var _a;
2177
- let y = v ? assignKeys(_.actions) : [];
2178
- return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + _.severity }, crelt("span", { class: "cm-diagnosticText" }, _.renderMessage ? _.renderMessage(e6) : _.message), (_a = _.actions) == null ? void 0 : _a.map((v2, b) => {
2179
- let x = false, S = (y2) => {
2180
- if (y2.preventDefault(), x) return;
2181
- x = true;
2182
- let b2 = findDiagnostic(e6.state.field(lintState).diagnostics, _);
2183
- b2 && v2.apply(e6, b2.from, b2.to);
2184
- }, { name: C } = v2, w = y[b] ? C.indexOf(y[b]) : -1, T = w < 0 ? C : [
2185
- C.slice(0, w),
2186
- crelt("u", C.slice(w, w + 1)),
2187
- C.slice(w + 1)
2219
+ let x = b ? assignKeys(y.actions) : [];
2220
+ 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) => {
2221
+ let C = false, w = (x2) => {
2222
+ if (x2.preventDefault(), C) return;
2223
+ C = true;
2224
+ let S2 = findDiagnostic(e6.state.field(lintState).diagnostics, y);
2225
+ S2 && b2.apply(e6, S2.from, S2.to);
2226
+ }, { name: T } = b2, E = x[S] ? T.indexOf(x[S]) : -1, D = E < 0 ? T : [
2227
+ T.slice(0, E),
2228
+ crelt("u", T.slice(E, E + 1)),
2229
+ T.slice(E + 1)
2188
2230
  ];
2189
2231
  return crelt("button", {
2190
2232
  type: "button",
2191
- class: "cm-diagnosticAction",
2192
- onclick: S,
2193
- onmousedown: S,
2194
- "aria-label": ` Action: ${C}${w < 0 ? "" : ` (access key "${y[b]})"`}.`
2195
- }, T);
2196
- }), _.source && crelt("div", { class: "cm-diagnosticSource" }, _.source));
2233
+ class: "cm-diagnosticAction" + (b2.markClass ? " " + b2.markClass : ""),
2234
+ onclick: w,
2235
+ onmousedown: w,
2236
+ "aria-label": ` Action: ${T}${E < 0 ? "" : ` (access key "${x[S]})"`}.`
2237
+ }, D);
2238
+ }), y.source && crelt("div", { class: "cm-diagnosticSource" }, y.source));
2197
2239
  }
2198
2240
  var DiagnosticWidget = class extends WidgetType {
2199
2241
  constructor(e6) {
@@ -2206,36 +2248,36 @@ var DiagnosticWidget = class extends WidgetType {
2206
2248
  return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
2207
2249
  }
2208
2250
  }, PanelItem = class {
2209
- constructor(e6, _) {
2210
- this.diagnostic = _, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = renderDiagnostic(e6, _, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
2251
+ constructor(e6, y) {
2252
+ 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");
2211
2253
  }
2212
2254
  }, LintPanel = class e5 {
2213
2255
  constructor(e6) {
2214
2256
  this.view = e6, this.items = [];
2215
- let _ = (_2) => {
2216
- if (_2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
2217
- else if (_2.keyCode == 38 || _2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
2218
- else if (_2.keyCode == 40 || _2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
2219
- else if (_2.keyCode == 36) this.moveSelection(0);
2220
- else if (_2.keyCode == 35) this.moveSelection(this.items.length - 1);
2221
- else if (_2.keyCode == 13) this.view.focus();
2222
- else if (_2.keyCode >= 65 && _2.keyCode <= 90 && this.selectedIndex >= 0) {
2223
- let { diagnostic: v2 } = this.items[this.selectedIndex], y = assignKeys(v2.actions);
2224
- for (let b = 0; b < y.length; b++) if (y[b].toUpperCase().charCodeAt(0) == _2.keyCode) {
2225
- let _3 = findDiagnostic(this.view.state.field(lintState).diagnostics, v2);
2226
- _3 && v2.actions[b].apply(e6, _3.from, _3.to);
2257
+ let y = (y2) => {
2258
+ if (y2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
2259
+ else if (y2.keyCode == 38 || y2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
2260
+ else if (y2.keyCode == 40 || y2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
2261
+ else if (y2.keyCode == 36) this.moveSelection(0);
2262
+ else if (y2.keyCode == 35) this.moveSelection(this.items.length - 1);
2263
+ else if (y2.keyCode == 13) this.view.focus();
2264
+ else if (y2.keyCode >= 65 && y2.keyCode <= 90 && this.selectedIndex >= 0) {
2265
+ let { diagnostic: b2 } = this.items[this.selectedIndex], x = assignKeys(b2.actions);
2266
+ for (let S = 0; S < x.length; S++) if (x[S].toUpperCase().charCodeAt(0) == y2.keyCode) {
2267
+ let y3 = findDiagnostic(this.view.state.field(lintState).diagnostics, b2);
2268
+ y3 && b2.actions[S].apply(e6, y3.from, y3.to);
2227
2269
  }
2228
2270
  } else return;
2229
- _2.preventDefault();
2230
- }, v = (e7) => {
2231
- for (let _2 = 0; _2 < this.items.length; _2++) this.items[_2].dom.contains(e7.target) && this.moveSelection(_2);
2271
+ y2.preventDefault();
2272
+ }, b = (e7) => {
2273
+ for (let y2 = 0; y2 < this.items.length; y2++) this.items[y2].dom.contains(e7.target) && this.moveSelection(y2);
2232
2274
  };
2233
2275
  this.list = crelt("ul", {
2234
2276
  tabIndex: 0,
2235
2277
  role: "listbox",
2236
2278
  "aria-label": this.view.state.phrase("Diagnostics"),
2237
- onkeydown: _,
2238
- onclick: v
2279
+ onkeydown: y,
2280
+ onclick: b
2239
2281
  }), this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
2240
2282
  type: "button",
2241
2283
  name: "close",
@@ -2246,70 +2288,70 @@ var DiagnosticWidget = class extends WidgetType {
2246
2288
  get selectedIndex() {
2247
2289
  let e6 = this.view.state.field(lintState).selected;
2248
2290
  if (!e6) return -1;
2249
- for (let _ = 0; _ < this.items.length; _++) if (this.items[_].diagnostic == e6.diagnostic) return _;
2291
+ for (let y = 0; y < this.items.length; y++) if (this.items[y].diagnostic == e6.diagnostic) return y;
2250
2292
  return -1;
2251
2293
  }
2252
2294
  update() {
2253
- let { diagnostics: e6, selected: _ } = this.view.state.field(lintState), v = 0, y = false, b = null, x = /* @__PURE__ */ new Set();
2254
- for (e6.between(0, this.view.state.doc.length, (e7, S, { spec: C }) => {
2255
- for (let e8 of C.diagnostics) {
2256
- if (x.has(e8)) continue;
2257
- x.add(e8);
2258
- let S2 = -1, C2;
2259
- for (let _2 = v; _2 < this.items.length; _2++) if (this.items[_2].diagnostic == e8) {
2260
- S2 = _2;
2295
+ let { diagnostics: e6, selected: y } = this.view.state.field(lintState), b = 0, x = false, S = null, C = /* @__PURE__ */ new Set();
2296
+ for (e6.between(0, this.view.state.doc.length, (e7, w, { spec: T }) => {
2297
+ for (let e8 of T.diagnostics) {
2298
+ if (C.has(e8)) continue;
2299
+ C.add(e8);
2300
+ let w2 = -1, T2;
2301
+ for (let y2 = b; y2 < this.items.length; y2++) if (this.items[y2].diagnostic == e8) {
2302
+ w2 = y2;
2261
2303
  break;
2262
2304
  }
2263
- S2 < 0 ? (C2 = new PanelItem(this.view, e8), this.items.splice(v, 0, C2), y = true) : (C2 = this.items[S2], S2 > v && (this.items.splice(v, S2 - v), y = true)), _ && C2.diagnostic == _.diagnostic ? C2.dom.hasAttribute("aria-selected") || (C2.dom.setAttribute("aria-selected", "true"), b = C2) : C2.dom.hasAttribute("aria-selected") && C2.dom.removeAttribute("aria-selected"), v++;
2305
+ 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++;
2264
2306
  }
2265
- }); v < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) y = true, this.items.pop();
2307
+ }); b < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) x = true, this.items.pop();
2266
2308
  this.items.length == 0 && (this.items.push(new PanelItem(this.view, {
2267
2309
  from: -1,
2268
2310
  to: -1,
2269
2311
  severity: "info",
2270
2312
  message: this.view.state.phrase("No diagnostics")
2271
- })), y = true), b ? (this.list.setAttribute("aria-activedescendant", b.id), this.view.requestMeasure({
2313
+ })), x = true), S ? (this.list.setAttribute("aria-activedescendant", S.id), this.view.requestMeasure({
2272
2314
  key: this,
2273
2315
  read: () => ({
2274
- sel: b.dom.getBoundingClientRect(),
2316
+ sel: S.dom.getBoundingClientRect(),
2275
2317
  panel: this.list.getBoundingClientRect()
2276
2318
  }),
2277
- write: ({ sel: e7, panel: _2 }) => {
2278
- let v2 = _2.height / this.list.offsetHeight;
2279
- e7.top < _2.top ? this.list.scrollTop -= (_2.top - e7.top) / v2 : e7.bottom > _2.bottom && (this.list.scrollTop += (e7.bottom - _2.bottom) / v2);
2319
+ write: ({ sel: e7, panel: y2 }) => {
2320
+ let b2 = y2.height / this.list.offsetHeight;
2321
+ e7.top < y2.top ? this.list.scrollTop -= (y2.top - e7.top) / b2 : e7.bottom > y2.bottom && (this.list.scrollTop += (e7.bottom - y2.bottom) / b2);
2280
2322
  }
2281
- })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), y && this.sync();
2323
+ })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), x && this.sync();
2282
2324
  }
2283
2325
  sync() {
2284
2326
  let e6 = this.list.firstChild;
2285
- function _() {
2286
- let _2 = e6;
2287
- e6 = _2.nextSibling, _2.remove();
2327
+ function y() {
2328
+ let y2 = e6;
2329
+ e6 = y2.nextSibling, y2.remove();
2288
2330
  }
2289
- for (let v of this.items) if (v.dom.parentNode == this.list) {
2290
- for (; e6 != v.dom; ) _();
2291
- e6 = v.dom.nextSibling;
2292
- } else this.list.insertBefore(v.dom, e6);
2293
- for (; e6; ) _();
2331
+ for (let b of this.items) if (b.dom.parentNode == this.list) {
2332
+ for (; e6 != b.dom; ) y();
2333
+ e6 = b.dom.nextSibling;
2334
+ } else this.list.insertBefore(b.dom, e6);
2335
+ for (; e6; ) y();
2294
2336
  }
2295
2337
  moveSelection(e6) {
2296
2338
  if (this.selectedIndex < 0) return;
2297
- let _ = this.view.state.field(lintState), v = findDiagnostic(_.diagnostics, this.items[e6].diagnostic);
2298
- v && this.view.dispatch({
2339
+ let y = findDiagnostic(this.view.state.field(lintState).diagnostics, this.items[e6].diagnostic);
2340
+ y && this.view.dispatch({
2299
2341
  selection: {
2300
- anchor: v.from,
2301
- head: v.to
2342
+ anchor: y.from,
2343
+ head: y.to
2302
2344
  },
2303
2345
  scrollIntoView: true,
2304
- effects: movePanelSelection.of(v)
2346
+ effects: movePanelSelection.of(y)
2305
2347
  });
2306
2348
  }
2307
- static open(_) {
2308
- return new e5(_);
2349
+ static open(y) {
2350
+ return new e5(y);
2309
2351
  }
2310
2352
  };
2311
- function svg(e6, _ = 'viewBox="0 0 40 40"') {
2312
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${_}>${encodeURIComponent(e6)}</svg>')`;
2353
+ function svg(e6, y = 'viewBox="0 0 40 40"') {
2354
+ return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${y}>${encodeURIComponent(e6)}</svg>')`;
2313
2355
  }
2314
2356
  function underline(e6) {
2315
2357
  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"');
@@ -2403,65 +2445,65 @@ function severityWeight(e6) {
2403
2445
  return e6 == "error" ? 4 : e6 == "warning" ? 3 : e6 == "info" ? 2 : 1;
2404
2446
  }
2405
2447
  function maxSeverity(e6) {
2406
- let _ = "hint", v = 1;
2407
- for (let y of e6) {
2408
- let e7 = severityWeight(y.severity);
2409
- e7 > v && (v = e7, _ = y.severity);
2448
+ let y = "hint", b = 1;
2449
+ for (let x of e6) {
2450
+ let e7 = severityWeight(x.severity);
2451
+ e7 > b && (b = e7, y = x.severity);
2410
2452
  }
2411
- return _;
2453
+ return y;
2412
2454
  }
2413
2455
  var lintExtensions = [
2414
2456
  lintState,
2415
2457
  /* @__PURE__ */ EditorView.decorations.compute([lintState], (e6) => {
2416
- let { selected: _, panel: v } = e6.field(lintState);
2417
- return !_ || !v || _.from == _.to ? Decoration.none : Decoration.set([activeMark.range(_.from, _.to)]);
2458
+ let { selected: y, panel: b } = e6.field(lintState);
2459
+ return !y || !b || y.from == y.to ? Decoration.none : Decoration.set([activeMark.range(y.from, y.to)]);
2418
2460
  }),
2419
2461
  /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
2420
2462
  baseTheme
2421
2463
  ];
2422
- function forEachDiagnostic(e6, _) {
2423
- let v = e6.field(lintState, false);
2424
- if (v && v.diagnostics.size) {
2425
- let e7 = [], y = [], b = -1;
2426
- for (let x = RangeSet.iter([v.diagnostics]); ; x.next()) {
2427
- for (let v2 = 0; v2 < e7.length; v2++) (!x.value || x.value.spec.diagnostics.indexOf(e7[v2]) < 0) && (_(e7[v2], y[v2], b), e7.splice(v2, 1), y.splice(v2--, 1));
2428
- if (!x.value) break;
2429
- for (let _2 of x.value.spec.diagnostics) e7.indexOf(_2) < 0 && (e7.push(_2), y.push(x.from));
2430
- b = x.to;
2464
+ function forEachDiagnostic(e6, y) {
2465
+ let b = e6.field(lintState, false);
2466
+ if (b && b.diagnostics.size) {
2467
+ let e7 = [], x = [], S = -1;
2468
+ for (let C = RangeSet.iter([b.diagnostics]); ; C.next()) {
2469
+ 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));
2470
+ if (!C.value) break;
2471
+ for (let y2 of C.value.spec.diagnostics) e7.indexOf(y2) < 0 && (e7.push(y2), x.push(C.from));
2472
+ S = C.to;
2431
2473
  }
2432
2474
  }
2433
2475
  }
2434
2476
  function _extends() {
2435
2477
  return _extends = Object.assign ? Object.assign.bind() : function(e6) {
2436
- for (var _ = 1; _ < arguments.length; _++) {
2437
- var v = arguments[_];
2438
- for (var y in v) ({}).hasOwnProperty.call(v, y) && (e6[y] = v[y]);
2478
+ for (var y = 1; y < arguments.length; y++) {
2479
+ var b = arguments[y];
2480
+ for (var x in b) ({}).hasOwnProperty.call(b, x) && (e6[x] = b[x]);
2439
2481
  }
2440
2482
  return e6;
2441
2483
  }, _extends.apply(null, arguments);
2442
2484
  }
2443
- function _objectWithoutPropertiesLoose(e6, _) {
2485
+ function _objectWithoutPropertiesLoose(e6, y) {
2444
2486
  if (e6 == null) return {};
2445
- var v = {};
2446
- for (var y in e6) if ({}.hasOwnProperty.call(e6, y)) {
2447
- if (_.indexOf(y) !== -1) continue;
2448
- v[y] = e6[y];
2487
+ var b = {};
2488
+ for (var x in e6) if ({}.hasOwnProperty.call(e6, x)) {
2489
+ if (y.indexOf(x) !== -1) continue;
2490
+ b[x] = e6[x];
2449
2491
  }
2450
- return v;
2492
+ return b;
2451
2493
  }
2452
2494
  var basicSetup = function(e6) {
2453
2495
  e6 === void 0 && (e6 = {});
2454
- var { crosshairCursor: _ = false } = e6, v = [];
2455
- e6.closeBracketsKeymap !== false && (v = v.concat(closeBracketsKeymap)), e6.defaultKeymap !== false && (v = v.concat(defaultKeymap)), e6.searchKeymap !== false && (v = v.concat(searchKeymap)), e6.historyKeymap !== false && (v = v.concat(historyKeymap)), e6.foldKeymap !== false && (v = v.concat(foldKeymap)), e6.completionKeymap !== false && (v = v.concat(completionKeymap)), e6.lintKeymap !== false && (v = v.concat(lintKeymap));
2456
- var y = [];
2457
- return e6.lineNumbers !== false && y.push(lineNumbers()), e6.highlightActiveLineGutter !== false && y.push(highlightActiveLineGutter()), e6.highlightSpecialChars !== false && y.push(highlightSpecialChars()), e6.history !== false && y.push(history()), e6.foldGutter !== false && y.push(foldGutter()), e6.drawSelection !== false && y.push(drawSelection()), e6.dropCursor !== false && y.push(dropCursor()), e6.allowMultipleSelections !== false && y.push(EditorState.allowMultipleSelections.of(true)), e6.indentOnInput !== false && y.push(indentOnInput()), e6.syntaxHighlighting !== false && y.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), e6.bracketMatching !== false && y.push(bracketMatching()), e6.closeBrackets !== false && y.push(closeBrackets()), e6.autocompletion !== false && y.push(autocompletion()), e6.rectangularSelection !== false && y.push(rectangularSelection()), _ !== false && y.push(crosshairCursor()), e6.highlightActiveLine !== false && y.push(highlightActiveLine()), e6.highlightSelectionMatches !== false && y.push(highlightSelectionMatches()), e6.tabSize && typeof e6.tabSize == "number" && y.push(indentUnit.of(" ".repeat(e6.tabSize))), y.concat([keymap.of(v.flat())]).filter(Boolean);
2496
+ var { crosshairCursor: y = false } = e6, b = [];
2497
+ 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));
2498
+ var x = [];
2499
+ 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);
2458
2500
  }, minimalSetup = function(e6) {
2459
2501
  e6 === void 0 && (e6 = {});
2460
- var _ = [];
2461
- e6.defaultKeymap !== false && (_ = _.concat(defaultKeymap)), e6.historyKeymap !== false && (_ = _.concat(historyKeymap));
2462
- var v = [];
2463
- return e6.highlightSpecialChars !== false && v.push(highlightSpecialChars()), e6.history !== false && v.push(history()), e6.drawSelection !== false && v.push(drawSelection()), e6.syntaxHighlighting !== false && v.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), v.concat([keymap.of(_.flat())]).filter(Boolean);
2464
- }, 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", oneDarkTheme = /* @__PURE__ */ EditorView.theme({
2502
+ var y = [];
2503
+ e6.defaultKeymap !== false && (y = y.concat(defaultKeymap)), e6.historyKeymap !== false && (y = y.concat(historyKeymap));
2504
+ var b = [];
2505
+ 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);
2506
+ }, 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({
2465
2507
  "&": {
2466
2508
  color: ivory,
2467
2509
  backgroundColor: background
@@ -2510,7 +2552,7 @@ var basicSetup = function(e6) {
2510
2552
  backgroundColor: highlightBackground,
2511
2553
  color: ivory
2512
2554
  } }
2513
- }, { dark: true }), oneDarkHighlightStyle = /* @__PURE__ */ HighlightStyle.define([
2555
+ }, { dark: true }), /* @__PURE__ */ syntaxHighlighting(/* @__PURE__ */ HighlightStyle.define([
2514
2556
  {
2515
2557
  tag: tags.keyword,
2516
2558
  color: violet
@@ -2612,23 +2654,23 @@ var basicSetup = function(e6) {
2612
2654
  tag: tags.invalid,
2613
2655
  color: invalid
2614
2656
  }
2615
- ]), oneDark = [oneDarkTheme, /* @__PURE__ */ syntaxHighlighting(oneDarkHighlightStyle)], defaultLightThemeOption = EditorView.theme({ "&": { backgroundColor: "#fff" } }, { dark: false }), getDefaultExtensions = function(e6) {
2657
+ ]))], defaultLightThemeOption = EditorView.theme({ "&": { backgroundColor: "#fff" } }, { dark: false }), getDefaultExtensions = function(e6) {
2616
2658
  e6 === void 0 && (e6 = {});
2617
- var { indentWithTab: _ = true, editable: v = true, readOnly: y = false, theme: b = "light", placeholder: x = "", basicSetup: S = true } = e6, C = [];
2618
- switch (_ && C.unshift(keymap.of([indentWithTab])), S && (typeof S == "boolean" ? C.unshift(basicSetup()) : C.unshift(basicSetup(S))), x && C.unshift(placeholder(x)), b) {
2659
+ var { indentWithTab: y = true, editable: b = true, readOnly: x = false, theme: S = "light", placeholder: C = "", basicSetup: w = true } = e6, T = [];
2660
+ switch (y && T.unshift(keymap.of([indentWithTab])), w && (typeof w == "boolean" ? T.unshift(basicSetup()) : T.unshift(basicSetup(w))), C && T.unshift(placeholder(C)), S) {
2619
2661
  case "light":
2620
- C.push(defaultLightThemeOption);
2662
+ T.push(defaultLightThemeOption);
2621
2663
  break;
2622
2664
  case "dark":
2623
- C.push(oneDark);
2665
+ T.push(oneDark);
2624
2666
  break;
2625
2667
  case "none":
2626
2668
  break;
2627
2669
  default:
2628
- C.push(b);
2670
+ T.push(S);
2629
2671
  break;
2630
2672
  }
2631
- return v === false && C.push(EditorView.editable.of(false)), y && C.push(EditorState.readOnly.of(true)), [...C];
2673
+ return b === false && T.push(EditorView.editable.of(false)), x && T.push(EditorState.readOnly.of(true)), [...T];
2632
2674
  }, getStatistics = (e6) => ({
2633
2675
  line: e6.state.doc.lineAt(e6.state.selection.main.from),
2634
2676
  lineCount: e6.state.doc.lines,
@@ -2640,11 +2682,11 @@ var basicSetup = function(e6) {
2640
2682
  selectionAsSingle: e6.state.selection.asSingle().main,
2641
2683
  ranges: e6.state.selection.ranges,
2642
2684
  selectionCode: e6.state.sliceDoc(e6.state.selection.main.from, e6.state.selection.main.to),
2643
- selections: e6.state.selection.ranges.map((_) => e6.state.sliceDoc(_.from, _.to)),
2685
+ selections: e6.state.selection.ranges.map((y) => e6.state.sliceDoc(y.from, y.to)),
2644
2686
  selectedText: e6.state.selection.ranges.some((e7) => !e7.empty)
2645
2687
  }), TimeoutLatch = class {
2646
- constructor(e6, _) {
2647
- this.timeLeftMS = void 0, this.timeoutMS = void 0, this.isCancelled = false, this.isTimeExhausted = false, this.callbacks = [], this.timeLeftMS = _, this.timeoutMS = _, this.callbacks.push(e6);
2688
+ constructor(e6, y) {
2689
+ 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);
2648
2690
  }
2649
2691
  tick() {
2650
2692
  if (!this.isCancelled && !this.isTimeExhausted && (this.timeLeftMS--, this.timeLeftMS <= 0)) {
@@ -2690,73 +2732,66 @@ var basicSetup = function(e6) {
2690
2732
  }
2691
2733
  }, globalScheduler = null, getScheduler = () => typeof window > "u" ? new Scheduler() : (globalScheduler || (globalScheduler = new Scheduler()), globalScheduler), ExternalChange = Annotation.define(), TYPING_TIMOUT = 200, emptyExtensions = [];
2692
2734
  function useCodeMirror(e6) {
2693
- var { value: _, selection: v, onChange: y, onStatistics: b, onCreateEditor: x, onUpdate: S, extensions: C = emptyExtensions, autoFocus: w, theme: T = "light", height: E = null, minHeight: D = null, maxHeight: O = null, width: k = null, minWidth: A = null, maxWidth: j = null, placeholder: M = "", editable: N = true, readOnly: P = false, indentWithTab: F = true, basicSetup: I = true, root: R, initialState: z } = e6, [B, V] = (0, import_react.useState)(), [H, U] = (0, import_react.useState)(), [W, G] = (0, import_react.useState)(), K = (0, import_react.useState)(() => ({ current: null }))[0], Y = (0, import_react.useState)(() => ({ current: null }))[0], X = EditorView.theme({
2735
+ 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({
2694
2736
  "&": {
2695
- height: E,
2696
- minHeight: D,
2697
- maxHeight: O,
2698
- width: k,
2699
- minWidth: A,
2700
- maxWidth: j
2737
+ height: O,
2738
+ minHeight: k,
2739
+ maxHeight: A,
2740
+ width: j,
2741
+ minWidth: M,
2742
+ maxWidth: N
2701
2743
  },
2702
2744
  "& .cm-scroller": { height: "100% !important" }
2703
- }), Z = EditorView.updateListener.of((e7) => {
2704
- if (e7.docChanged && typeof y == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange))) {
2705
- K.current ? K.current.reset() : (K.current = new TimeoutLatch(() => {
2706
- if (Y.current) {
2707
- var e8 = Y.current;
2708
- Y.current = null, e8();
2709
- }
2710
- K.current = null;
2711
- }, TYPING_TIMOUT), getScheduler().add(K.current));
2712
- var _2 = e7.state.doc.toString();
2713
- y(_2, e7);
2714
- }
2715
- b && b(getStatistics(e7));
2716
- }), Q = getDefaultExtensions({
2717
- theme: T,
2718
- editable: N,
2719
- readOnly: P,
2720
- placeholder: M,
2721
- indentWithTab: F,
2722
- basicSetup: I
2723
2745
  }), $ = [
2724
- Z,
2725
- X,
2726
- ...Q
2746
+ EditorView.updateListener.of((e7) => {
2747
+ e7.docChanged && typeof x == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange)) && (Y.current ? Y.current.reset() : (Y.current = new TimeoutLatch(() => {
2748
+ if (Z.current) {
2749
+ var e8 = Z.current;
2750
+ Z.current = null, e8();
2751
+ }
2752
+ Y.current = null;
2753
+ }, TYPING_TIMOUT), getScheduler().add(Y.current)), x(e7.state.doc.toString(), e7)), S && S(getStatistics(e7));
2754
+ }),
2755
+ Q,
2756
+ ...getDefaultExtensions({
2757
+ theme: D,
2758
+ editable: F,
2759
+ readOnly: I,
2760
+ placeholder: P,
2761
+ indentWithTab: L,
2762
+ basicSetup: R
2763
+ })
2727
2764
  ];
2728
- return S && typeof S == "function" && $.push(EditorView.updateListener.of(S)), $ = $.concat(C), (0, import_react.useLayoutEffect)(() => {
2729
- if (B && !W) {
2765
+ return w && typeof w == "function" && $.push(EditorView.updateListener.of(w)), $ = $.concat(T), (0, import_react.useLayoutEffect)(() => {
2766
+ if (H && !K) {
2730
2767
  var e7 = {
2731
- doc: _,
2732
- selection: v,
2768
+ doc: y,
2769
+ selection: b,
2733
2770
  extensions: $
2734
- }, y2 = z ? EditorState.fromJSON(z.json, e7, z.fields) : EditorState.create(e7);
2735
- if (G(y2), !H) {
2736
- var b2 = new EditorView({
2737
- state: y2,
2738
- parent: B,
2739
- root: R
2771
+ }, x2 = V ? EditorState.fromJSON(V.json, e7, V.fields) : EditorState.create(e7);
2772
+ if (J(x2), !W) {
2773
+ var S2 = new EditorView({
2774
+ state: x2,
2775
+ parent: H,
2776
+ root: B
2740
2777
  });
2741
- U(b2), x && x(b2, y2);
2778
+ G(S2), C && C(S2, x2);
2742
2779
  }
2743
2780
  }
2744
2781
  return () => {
2745
- H && (G(void 0), U(void 0));
2782
+ W && (J(void 0), G(void 0));
2746
2783
  };
2747
- }, [B, W]), (0, import_react.useEffect)(() => {
2748
- e6.container && V(e6.container);
2784
+ }, [H, K]), (0, import_react.useEffect)(() => {
2785
+ e6.container && U(e6.container);
2749
2786
  }, [e6.container]), (0, import_react.useEffect)(() => () => {
2750
- H && (H.destroy(), U(void 0)), K.current && (K.current = (K.current.cancel(), null));
2751
- }, [H]), (0, import_react.useEffect)(() => {
2752
- w && H && H.focus();
2753
- }, [w, H]), (0, import_react.useEffect)(() => {
2754
- H && H.dispatch({ effects: StateEffect.reconfigure.of($) });
2787
+ W && (W.destroy(), G(void 0)), Y.current && (Y.current = (Y.current.cancel(), null));
2788
+ }, [W]), (0, import_react.useEffect)(() => {
2789
+ E && W && W.focus();
2790
+ }, [E, W]), (0, import_react.useEffect)(() => {
2791
+ W && W.dispatch({ effects: StateEffect.reconfigure.of($) });
2755
2792
  }, [
2756
- T,
2757
- C,
2758
- E,
2759
2793
  D,
2794
+ T,
2760
2795
  O,
2761
2796
  k,
2762
2797
  A,
@@ -2766,32 +2801,34 @@ function useCodeMirror(e6) {
2766
2801
  P,
2767
2802
  F,
2768
2803
  I,
2769
- y,
2770
- S
2804
+ L,
2805
+ R,
2806
+ x,
2807
+ w
2771
2808
  ]), (0, import_react.useEffect)(() => {
2772
- if (_ !== void 0) {
2773
- var e7 = H ? H.state.doc.toString() : "";
2774
- if (H && _ !== e7) {
2775
- var v2 = K.current && !K.current.isDone, y2 = () => {
2776
- H && _ !== H.state.doc.toString() && H.dispatch({
2809
+ if (y !== void 0) {
2810
+ var e7 = W ? W.state.doc.toString() : "";
2811
+ if (W && y !== e7) {
2812
+ var b2 = Y.current && !Y.current.isDone, x2 = () => {
2813
+ W && y !== W.state.doc.toString() && W.dispatch({
2777
2814
  changes: {
2778
2815
  from: 0,
2779
- to: H.state.doc.toString().length,
2780
- insert: _ || ""
2816
+ to: W.state.doc.toString().length,
2817
+ insert: y || ""
2781
2818
  },
2782
2819
  annotations: [ExternalChange.of(true)]
2783
2820
  });
2784
2821
  };
2785
- v2 ? Y.current = y2 : y2();
2822
+ b2 ? Z.current = x2 : x2();
2786
2823
  }
2787
2824
  }
2788
- }, [_, H]), {
2789
- state: W,
2790
- setState: G,
2791
- view: H,
2792
- setView: U,
2793
- container: B,
2794
- setContainer: V
2825
+ }, [y, W]), {
2826
+ state: K,
2827
+ setState: J,
2828
+ view: W,
2829
+ setView: G,
2830
+ container: H,
2831
+ setContainer: U
2795
2832
  };
2796
2833
  }
2797
2834
  var _excluded = [
@@ -2818,81 +2855,80 @@ var _excluded = [
2818
2855
  "readOnly",
2819
2856
  "root",
2820
2857
  "initialState"
2821
- ], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6, _) => {
2822
- var { className: v, value: y = "", selection: b, extensions: x = [], onChange: S, onStatistics: C, onCreateEditor: w, onUpdate: T, autoFocus: E, theme: D = "light", height: O, minHeight: k, maxHeight: A, width: j, minWidth: M, maxWidth: N, basicSetup: P, placeholder: F, indentWithTab: I, editable: L, readOnly: R, root: z, initialState: B } = e6, V = _objectWithoutPropertiesLoose(e6, _excluded), H = (0, import_react.useRef)(null), { state: U, view: W, container: G, setContainer: K } = useCodeMirror({
2823
- root: z,
2824
- value: y,
2825
- autoFocus: E,
2826
- theme: D,
2827
- height: O,
2828
- minHeight: k,
2829
- maxHeight: A,
2830
- width: j,
2831
- minWidth: M,
2832
- maxWidth: N,
2833
- basicSetup: P,
2834
- placeholder: F,
2835
- indentWithTab: I,
2836
- editable: L,
2837
- readOnly: R,
2838
- selection: b,
2839
- onChange: S,
2840
- onStatistics: C,
2841
- onCreateEditor: w,
2842
- onUpdate: T,
2843
- extensions: x,
2844
- initialState: B
2858
+ ], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6, y) => {
2859
+ 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({
2860
+ root: V,
2861
+ value: x,
2862
+ autoFocus: O,
2863
+ theme: k,
2864
+ height: A,
2865
+ minHeight: j,
2866
+ maxHeight: M,
2867
+ width: N,
2868
+ minWidth: P,
2869
+ maxWidth: F,
2870
+ basicSetup: I,
2871
+ placeholder: L,
2872
+ indentWithTab: R,
2873
+ editable: z,
2874
+ readOnly: B,
2875
+ selection: S,
2876
+ onChange: w,
2877
+ onStatistics: T,
2878
+ onCreateEditor: E,
2879
+ onUpdate: D,
2880
+ extensions: C,
2881
+ initialState: H
2845
2882
  });
2846
- (0, import_react.useImperativeHandle)(_, () => ({
2847
- editor: H.current,
2848
- state: U,
2849
- view: W
2883
+ (0, import_react.useImperativeHandle)(y, () => ({
2884
+ editor: W.current,
2885
+ state: G,
2886
+ view: K
2850
2887
  }), [
2851
- H,
2888
+ W,
2889
+ J,
2852
2890
  G,
2853
- U,
2854
- W
2891
+ K
2855
2892
  ]);
2856
- var J = (0, import_react.useCallback)((e7) => {
2857
- H.current = e7, K(e7);
2858
- }, [K]);
2859
- if (typeof y != "string") throw Error("value must be typeof string but got " + typeof y);
2860
- var Y = typeof D == "string" ? "cm-theme-" + D : "cm-theme";
2893
+ var X = (0, import_react.useCallback)((e7) => {
2894
+ W.current = e7, Y(e7);
2895
+ }, [Y]);
2896
+ if (typeof x != "string") throw Error("value must be typeof string but got " + typeof x);
2861
2897
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", _extends({
2862
- ref: J,
2863
- className: "" + Y + (v ? " " + v : "")
2864
- }, V));
2898
+ ref: X,
2899
+ className: (typeof k == "string" ? "cm-theme-" + k : "cm-theme") + (b ? " " + b : "")
2900
+ }, U));
2865
2901
  });
2866
2902
  ReactCodeMirror.displayName = "CodeMirror";
2867
2903
  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) => {
2868
- for (let _ = false, v = 0; ; v++) {
2869
- let { next: y } = e6;
2870
- if (y < 0) {
2871
- v > 0 && e6.acceptToken(strContent);
2904
+ for (let y = false, b = 0; ; b++) {
2905
+ let { next: x } = e6;
2906
+ if (x < 0) {
2907
+ b > 0 && e6.acceptToken(strContent);
2872
2908
  break;
2873
- } else if (y === quote) {
2874
- v > 0 ? e6.acceptToken(strContent) : e6.acceptToken(strEnd, 1);
2909
+ } else if (x === quote) {
2910
+ b > 0 ? e6.acceptToken(strContent) : e6.acceptToken(strEnd, 1);
2875
2911
  break;
2876
- } else if (y === braceL && _) {
2877
- v == 1 ? e6.acceptToken(strDollarBrace, 1) : e6.acceptToken(strContent, -1);
2912
+ } else if (x === braceL && y) {
2913
+ b == 1 ? e6.acceptToken(strDollarBrace, 1) : e6.acceptToken(strContent, -1);
2878
2914
  break;
2879
- } else y === backslack && (e6.advance(), e6.acceptToken(escapeSequence, 1));
2880
- _ = y === dollar, e6.advance();
2915
+ } else x === backslack && (e6.advance(), e6.acceptToken(escapeSequence, 1));
2916
+ y = x === dollar, e6.advance();
2881
2917
  }
2882
2918
  }), scanIndString = /* @__PURE__ */ new ExternalTokenizer((e6) => {
2883
- for (let _ = false, v = false, y = 0; ; y++) {
2884
- let { next: b } = e6;
2885
- if (b < 0) {
2886
- y > 0 && e6.acceptToken(indStrContent);
2919
+ for (let y = false, b = false, x = 0; ; x++) {
2920
+ let { next: S } = e6;
2921
+ if (S < 0) {
2922
+ x > 0 && e6.acceptToken(indStrContent);
2887
2923
  break;
2888
- } else if (b === apostrophe && v) {
2889
- y > 1 ? e6.acceptToken(indStrContent, -1) : e6.acceptToken(indStrEnd, 1);
2924
+ } else if (S === apostrophe && b) {
2925
+ x > 1 ? e6.acceptToken(indStrContent, -1) : e6.acceptToken(indStrEnd, 1);
2890
2926
  break;
2891
- } else if (b === braceL && _) {
2892
- y == 1 ? e6.acceptToken(indStrDollarBrace, 1) : e6.acceptToken(indStrContent, -1);
2927
+ } else if (S === braceL && y) {
2928
+ x == 1 ? e6.acceptToken(indStrDollarBrace, 1) : e6.acceptToken(indStrContent, -1);
2893
2929
  break;
2894
- } else b === backslack && (e6.advance(), e6.acceptToken(indEscapeSequence, 1));
2895
- _ = b === dollar, v = b === apostrophe, e6.advance();
2930
+ } else S === backslack && (e6.advance(), e6.acceptToken(indEscapeSequence, 1));
2931
+ y = S === dollar, b = S === apostrophe, e6.advance();
2896
2932
  }
2897
2933
  }), spec_Identifier = {
2898
2934
  __proto__: null,
@@ -2967,10 +3003,10 @@ var esm_default = ReactCodeMirror, strContent = 63, strDollarBrace = 64, strEnd
2967
3003
  AttrSet: foldInside,
2968
3004
  List: foldInside,
2969
3005
  Let(e6) {
2970
- let _ = e6.getChild("let"), v = e6.getChild("in");
2971
- return !_ || !v ? null : {
2972
- from: _.to,
2973
- to: v.from
3006
+ let y = e6.getChild("let"), b = e6.getChild("in");
3007
+ return !y || !b ? null : {
3008
+ from: y.to,
3009
+ to: b.from
2974
3010
  };
2975
3011
  }
2976
3012
  }),
@@ -3138,19 +3174,19 @@ function isSpace(e6) {
3138
3174
  return e6 == 9 || e6 == 10 || e6 == 13 || e6 == 32;
3139
3175
  }
3140
3176
  var cachedName = null, cachedInput = null, cachedPos = 0;
3141
- function tagNameAfter(e6, _) {
3142
- let v = e6.pos + _;
3143
- if (cachedPos == v && cachedInput == e6) return cachedName;
3144
- let y = e6.peek(_);
3145
- for (; isSpace(y); ) y = e6.peek(++_);
3146
- let b = "";
3147
- for (; nameChar(y); ) b += String.fromCharCode(y), y = e6.peek(++_);
3148
- return cachedInput = e6, cachedPos = v, cachedName = b ? b.toLowerCase() : y == question || y == bang ? void 0 : null;
3177
+ function tagNameAfter(e6, y) {
3178
+ let b = e6.pos + y;
3179
+ if (cachedPos == b && cachedInput == e6) return cachedName;
3180
+ let x = e6.peek(y);
3181
+ for (; isSpace(x); ) x = e6.peek(++y);
3182
+ let S = "";
3183
+ for (; nameChar(x); ) S += String.fromCharCode(x), x = e6.peek(++y);
3184
+ return cachedInput = e6, cachedPos = b, cachedName = S ? S.toLowerCase() : x == question || x == bang ? void 0 : null;
3149
3185
  }
3150
3186
  var lessThan = 60, greaterThan$1 = 62, slash$1 = 47, question = 63, bang = 33;
3151
- function ElementContext(e6, _) {
3152
- this.name = e6, this.parent = _, this.hash = _ ? _.hash : 0;
3153
- for (let _2 = 0; _2 < e6.length; _2++) this.hash += (this.hash << 4) + e6.charCodeAt(_2) + (e6.charCodeAt(_2) << 8);
3187
+ function ElementContext(e6, y) {
3188
+ this.name = e6, this.parent = y, this.hash = y ? y.hash : 0;
3189
+ for (let y2 = 0; y2 < e6.length; y2++) this.hash += (this.hash << 4) + e6.charCodeAt(y2) + (e6.charCodeAt(y2) << 8);
3154
3190
  }
3155
3191
  var startTagTerms = [
3156
3192
  StartTag,
@@ -3160,63 +3196,63 @@ var startTagTerms = [
3160
3196
  StartTextareaTag
3161
3197
  ], elementContext = /* @__PURE__ */ new ContextTracker({
3162
3198
  start: null,
3163
- shift(e6, _, v, y) {
3164
- return startTagTerms.indexOf(_) > -1 ? new ElementContext(tagNameAfter(y, 1) || "", e6) : e6;
3199
+ shift(e6, y, b, x) {
3200
+ return startTagTerms.indexOf(y) > -1 ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
3165
3201
  },
3166
- reduce(e6, _) {
3167
- return _ == Element && e6 ? e6.parent : e6;
3202
+ reduce(e6, y) {
3203
+ return y == Element && e6 ? e6.parent : e6;
3168
3204
  },
3169
- reuse(e6, _, v, y) {
3170
- let b = _.type.id;
3171
- return b == StartTag || b == OpenTag ? new ElementContext(tagNameAfter(y, 1) || "", e6) : e6;
3205
+ reuse(e6, y, b, x) {
3206
+ let S = y.type.id;
3207
+ return S == StartTag || S == OpenTag ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
3172
3208
  },
3173
3209
  hash(e6) {
3174
3210
  return e6 ? e6.hash : 0;
3175
3211
  },
3176
3212
  strict: false
3177
- }), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6, _) => {
3213
+ }), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6, y) => {
3178
3214
  if (e6.next != lessThan) {
3179
- e6.next < 0 && _.context && e6.acceptToken(missingCloseTag);
3215
+ e6.next < 0 && y.context && e6.acceptToken(missingCloseTag);
3180
3216
  return;
3181
3217
  }
3182
3218
  e6.advance();
3183
- let v = e6.next == slash$1;
3184
- v && e6.advance();
3185
- let y = tagNameAfter(e6, 0);
3186
- if (y === void 0) return;
3187
- if (!y) return e6.acceptToken(v ? IncompleteCloseTag : StartTag);
3188
- let b = _.context ? _.context.name : null;
3189
- if (v) {
3190
- if (y == b) return e6.acceptToken(StartCloseTag);
3191
- if (b && implicitlyClosed[b]) return e6.acceptToken(missingCloseTag, -2);
3192
- for (let e7 = _.context; e7; e7 = e7.parent) if (e7.name == y) return;
3219
+ let b = e6.next == slash$1;
3220
+ b && e6.advance();
3221
+ let x = tagNameAfter(e6, 0);
3222
+ if (x === void 0) return;
3223
+ if (!x) return e6.acceptToken(b ? IncompleteCloseTag : StartTag);
3224
+ let S = y.context ? y.context.name : null;
3225
+ if (b) {
3226
+ if (x == S) return e6.acceptToken(StartCloseTag);
3227
+ if (S && implicitlyClosed[S]) return e6.acceptToken(missingCloseTag, -2);
3228
+ for (let e7 = y.context; e7; e7 = e7.parent) if (e7.name == x) return;
3193
3229
  e6.acceptToken(MismatchedStartCloseTag);
3194
3230
  } else {
3195
- if (y == "script") return e6.acceptToken(StartScriptTag);
3196
- if (y == "style") return e6.acceptToken(StartStyleTag);
3197
- if (y == "textarea") return e6.acceptToken(StartTextareaTag);
3198
- if (selfClosers.hasOwnProperty(y)) return e6.acceptToken(StartSelfClosingTag);
3199
- b && closeOnOpen[b] && closeOnOpen[b][y] ? e6.acceptToken(missingCloseTag, -1) : e6.acceptToken(StartTag);
3231
+ if (x == "script") return e6.acceptToken(StartScriptTag);
3232
+ if (x == "style") return e6.acceptToken(StartStyleTag);
3233
+ if (x == "textarea") return e6.acceptToken(StartTextareaTag);
3234
+ if (selfClosers.hasOwnProperty(x)) return e6.acceptToken(StartSelfClosingTag);
3235
+ S && closeOnOpen[S] && closeOnOpen[S][x] ? e6.acceptToken(missingCloseTag, -1) : e6.acceptToken(StartTag);
3200
3236
  }
3201
3237
  }, { contextual: true });
3202
- function contentTokenizer(e6, _, v) {
3203
- let y = 2 + e6.length;
3204
- return new ExternalTokenizer((b) => {
3205
- for (let x = 0, S = 0, C = 0; ; C++) {
3206
- if (b.next < 0) {
3207
- C && b.acceptToken(_);
3238
+ function contentTokenizer(e6, y, b) {
3239
+ let x = 2 + e6.length;
3240
+ return new ExternalTokenizer((S) => {
3241
+ for (let C = 0, w = 0, T = 0; ; T++) {
3242
+ if (S.next < 0) {
3243
+ T && S.acceptToken(y);
3208
3244
  break;
3209
3245
  }
3210
- if (x == 0 && b.next == lessThan || x == 1 && b.next == slash$1 || x >= 2 && x < y && b.next == e6.charCodeAt(x - 2)) x++, S++;
3211
- else if ((x == 2 || x == y) && isSpace(b.next)) S++;
3212
- else if (x == y && b.next == greaterThan$1) {
3213
- C > S ? b.acceptToken(_, -S) : b.acceptToken(v, -(S - 2));
3246
+ if (C == 0 && S.next == lessThan || C == 1 && S.next == slash$1 || C >= 2 && C < x && S.next == e6.charCodeAt(C - 2)) C++, w++;
3247
+ else if ((C == 2 || C == x) && isSpace(S.next)) w++;
3248
+ else if (C == x && S.next == greaterThan$1) {
3249
+ T > w ? S.acceptToken(y, -w) : S.acceptToken(b, -(w - 2));
3214
3250
  break;
3215
- } else if ((b.next == 10 || b.next == 13) && C) {
3216
- b.acceptToken(_, 1);
3251
+ } else if ((S.next == 10 || S.next == 13) && T) {
3252
+ S.acceptToken(y, 1);
3217
3253
  break;
3218
- } else x = S = 0;
3219
- b.advance();
3254
+ } else C = w = 0;
3255
+ S.advance();
3220
3256
  }
3221
3257
  });
3222
3258
  }
@@ -3252,108 +3288,108 @@ var scriptTokens = /* @__PURE__ */ contentTokenizer("script", scriptText, StartC
3252
3288
  at,
3253
3289
  slash
3254
3290
  ], commentContent = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3255
- for (let _ = 0, v = 0; ; v++) {
3291
+ for (let y = 0, b = 0; ; b++) {
3256
3292
  if (e6.next < 0) {
3257
- v && e6.acceptToken(commentContent$1);
3293
+ b && e6.acceptToken(commentContent$1);
3258
3294
  break;
3259
3295
  }
3260
- if (e6.next == dash) _++;
3261
- else if (e6.next == greaterThan && _ >= 2) {
3262
- v > 3 && e6.acceptToken(commentContent$1, -2);
3296
+ if (e6.next == dash) y++;
3297
+ else if (e6.next == greaterThan && y >= 2) {
3298
+ b > 3 && e6.acceptToken(commentContent$1, -2);
3263
3299
  break;
3264
- } else _ = 0;
3300
+ } else y = 0;
3265
3301
  e6.advance();
3266
3302
  }
3267
3303
  });
3268
3304
  function createStringHandler(e6) {
3269
- let _ = false, v = null, y = false;
3270
- return () => _ ? y ? (y = false, true) : e6.next === backslash ? (y = true, true) : v === "double" && e6.next === quoteDouble || v === "single" && e6.next === quoteSingle || v === "template" && e6.next === tick ? (_ = false, v = null, true) : true : e6.next === quoteDouble ? (_ = true, v = "double", true) : e6.next === quoteSingle ? (_ = true, v = "single", true) : e6.next === tick ? (_ = true, v = "template", true) : false;
3305
+ let y = false, b = null, x = false;
3306
+ 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;
3271
3307
  }
3272
3308
  function createCommentHandler(e6) {
3273
- let _ = false, v = false;
3274
- return () => _ ? (e6.next === newline && (_ = false), true) : v ? (e6.next === asterisk && e6.peek(1) === slash && (v = false), true) : e6.next === slash && e6.peek(1) === slash ? (_ = true, true) : e6.next === slash && e6.peek(1) === asterisk ? (v = true, true) : false;
3309
+ let y = false, b = false;
3310
+ 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;
3275
3311
  }
3276
3312
  var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3277
3313
  if (prefixes.includes(e6.next)) return;
3278
- let _ = createCommentHandler(e6), v = createStringHandler(e6), y = [], b = (e7) => {
3279
- let _2 = y.lastIndexOf(e7);
3280
- if (_2 !== -1) for (; y.length > _2; ) y.pop();
3314
+ let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
3315
+ let y2 = x.lastIndexOf(e7);
3316
+ if (y2 !== -1) for (; x.length > y2; ) x.pop();
3281
3317
  };
3282
- for (let x = 0; ; x++) {
3318
+ for (let C = 0; ; C++) {
3283
3319
  if (e6.next < 0) {
3284
- x > 0 && e6.acceptToken(LongExpression);
3320
+ C > 0 && e6.acceptToken(LongExpression);
3285
3321
  break;
3286
3322
  }
3287
- if (_() || v()) {
3323
+ if (y() || b()) {
3288
3324
  e6.advance();
3289
3325
  continue;
3290
3326
  }
3291
- if (y.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose)) {
3327
+ if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose)) {
3292
3328
  e6.acceptToken(LongExpression);
3293
3329
  break;
3294
3330
  }
3295
3331
  switch (e6.next) {
3296
3332
  case parenOpen:
3297
- y.push("(");
3333
+ x.push("(");
3298
3334
  break;
3299
3335
  case parenClose:
3300
- b("(");
3336
+ S("(");
3301
3337
  break;
3302
3338
  case squareOpen:
3303
- y.push("[");
3339
+ x.push("[");
3304
3340
  break;
3305
3341
  case squareClose:
3306
- b("[");
3342
+ S("[");
3307
3343
  break;
3308
3344
  case curlyOpen:
3309
- y.push("{");
3345
+ x.push("{");
3310
3346
  break;
3311
3347
  case curlyClose:
3312
- b("{");
3348
+ S("{");
3313
3349
  break;
3314
3350
  }
3315
3351
  e6.advance();
3316
3352
  }
3317
3353
  }), shortExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3318
3354
  if (prefixes.includes(e6.peek(0))) return;
3319
- let _ = createCommentHandler(e6), v = createStringHandler(e6), y = [], b = (e7) => {
3320
- let _2 = y.lastIndexOf(e7);
3321
- if (_2 !== -1) for (; y.length > _2; ) y.pop();
3355
+ let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
3356
+ let y2 = x.lastIndexOf(e7);
3357
+ if (y2 !== -1) for (; x.length > y2; ) x.pop();
3322
3358
  };
3323
- for (let x = 0; ; x++) {
3359
+ for (let C = 0; ; C++) {
3324
3360
  if (e6.next < 0) {
3325
- x > 0 && e6.acceptToken(ShortExpression);
3361
+ C > 0 && e6.acceptToken(ShortExpression);
3326
3362
  break;
3327
3363
  }
3328
- if (_() || v()) {
3364
+ if (y() || b()) {
3329
3365
  e6.advance();
3330
3366
  continue;
3331
3367
  }
3332
- if (y.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose || e6.next === comma)) {
3368
+ if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose || e6.next === comma)) {
3333
3369
  e6.acceptToken(ShortExpression);
3334
3370
  break;
3335
3371
  }
3336
3372
  switch (e6.next) {
3337
3373
  case parenOpen:
3338
- y.push("(");
3374
+ x.push("(");
3339
3375
  break;
3340
3376
  case parenClose:
3341
- b("(");
3377
+ S("(");
3342
3378
  break;
3343
3379
  case squareOpen:
3344
- y.push("[");
3380
+ x.push("[");
3345
3381
  break;
3346
3382
  case squareClose:
3347
- b("[");
3383
+ S("[");
3348
3384
  break;
3349
3385
  case curlyOpen:
3350
- y.push("{");
3386
+ x.push("{");
3351
3387
  break;
3352
3388
  case curlyClose:
3353
- b("{");
3389
+ S("{");
3354
3390
  break;
3355
3391
  }
3356
- if (x !== 0 && y.length === 0 && space.includes(e6.next)) {
3392
+ if (C !== 0 && x.length === 0 && space.includes(e6.next)) {
3357
3393
  e6.acceptToken(ShortExpression);
3358
3394
  break;
3359
3395
  }
@@ -3629,30 +3665,30 @@ var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
3629
3665
  ],
3630
3666
  tokenPrec: 1571
3631
3667
  });
3632
- function getAttrs(e6, _) {
3633
- let v = /* @__PURE__ */ Object.create(null);
3634
- for (let y of e6.firstChild.getChildren("Attribute")) {
3635
- let e7 = y.getChild("AttributeName"), b = y.getChild("AttributeValue") || y.getChild("UnquotedAttributeValue");
3636
- e7 && (v[_.read(e7.from, e7.to)] = b ? b.name == "AttributeValue" ? _.read(b.from + 1, b.to - 1) : _.read(b.from, b.to) : "");
3668
+ function getAttrs(e6, y) {
3669
+ let b = /* @__PURE__ */ Object.create(null);
3670
+ for (let x of e6.firstChild.getChildren("Attribute")) {
3671
+ let e7 = x.getChild("AttributeName"), S = x.getChild("AttributeValue") || x.getChild("UnquotedAttributeValue");
3672
+ 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) : "");
3637
3673
  }
3638
- return v;
3674
+ return b;
3639
3675
  }
3640
- function maybeNest(e6, _, v) {
3641
- let y;
3642
- for (let b of v) if (!b.attrs || b.attrs(y || (y = getAttrs(e6.node.parent, _)))) return { parser: b.parser };
3676
+ function maybeNest(e6, y, b) {
3677
+ let x;
3678
+ for (let S of b) if (!S.attrs || S.attrs(x || (x = getAttrs(e6.node.parent, y)))) return { parser: S.parser };
3643
3679
  return null;
3644
3680
  }
3645
3681
  var expressionParser = /* @__PURE__ */ parser$1.configure({ top: "SingleExpression" });
3646
3682
  function configureNesting(e6) {
3647
- let _ = [], v = [], y = [];
3648
- for (let b of e6) {
3649
- let e7 = b.tag == "script" ? _ : b.tag == "style" ? v : b.tag == "textarea" ? y : null;
3683
+ let y = [], b = [], x = [];
3684
+ for (let S of e6) {
3685
+ let e7 = S.tag == "script" ? y : S.tag == "style" ? b : S.tag == "textarea" ? x : null;
3650
3686
  if (!e7) throw RangeError("Only script, style, and textarea tags can host nested parsers");
3651
- e7.push(b);
3687
+ e7.push(S);
3652
3688
  }
3653
- return parseMixed((e7, b) => {
3654
- let x = e7.type.id;
3655
- return x === LongExpression || x === ShortExpression ? { parser: expressionParser } : x === ScriptText ? maybeNest(e7, b, _) : x === StyleText ? maybeNest(e7, b, v) : x === TextareaText ? maybeNest(e7, b, y) : null;
3689
+ return parseMixed((e7, S) => {
3690
+ let C = e7.type.id;
3691
+ 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;
3656
3692
  });
3657
3693
  }
3658
3694
  var defaultNesting = [
@@ -3680,46 +3716,46 @@ var defaultNesting = [
3680
3716
  wrap: /* @__PURE__ */ configureNesting(defaultNesting),
3681
3717
  props: [/* @__PURE__ */ indentNodeProp.add({
3682
3718
  Element: (e6) => {
3683
- let _ = /^(\s*)(<\/)?/.exec(e6.textAfter);
3684
- return e6.node.to <= e6.pos + _[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (_[2] ? 0 : e6.unit);
3719
+ let y = /^(\s*)(<\/)?/.exec(e6.textAfter);
3720
+ return e6.node.to <= e6.pos + y[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (y[2] ? 0 : e6.unit);
3685
3721
  },
3686
3722
  Block: (e6) => {
3687
- let _ = e6.node, v = e6.textAfter.trim();
3688
- if (v.startsWith("{/")) {
3689
- let y2 = _.name;
3690
- return y2 === "IfBlock" && v.startsWith("{/if") || y2 === "EachBlock" && v.startsWith("{/each") || y2 === "AwaitBlock" && v.startsWith("{/await") || y2 === "KeyBlock" && v.startsWith("{/key") ? e6.lineIndent(e6.node.from) : null;
3723
+ let y = e6.node, b = e6.textAfter.trim();
3724
+ if (b.startsWith("{/")) {
3725
+ let x2 = y.name;
3726
+ 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;
3691
3727
  }
3692
- if (_.name === "IfBlock" || _.name === "EachBlock") {
3693
- if (v.startsWith("{:else")) return e6.lineIndent(_.from);
3694
- } else if (_.name === "AwaitBlock" && (v.startsWith("{:then") || v.startsWith("{:catch"))) return e6.lineIndent(_.from);
3695
- let y = /^(\s*)(<\/)?/.exec(e6.textAfter);
3696
- return e6.node.to <= e6.pos + y[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (y[2] ? 0 : e6.unit);
3728
+ if (y.name === "IfBlock" || y.name === "EachBlock") {
3729
+ if (b.startsWith("{:else")) return e6.lineIndent(y.from);
3730
+ } else if (y.name === "AwaitBlock" && (b.startsWith("{:then") || b.startsWith("{:catch"))) return e6.lineIndent(y.from);
3731
+ let x = /^(\s*)(<\/)?/.exec(e6.textAfter);
3732
+ return e6.node.to <= e6.pos + x[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (x[2] ? 0 : e6.unit);
3697
3733
  },
3698
3734
  "BlockOpen BlockClose BlockInline": (e6) => e6.column(e6.node.from) + e6.unit,
3699
3735
  "OpenTag CloseTag SelfClosingTag": (e6) => e6.column(e6.node.from) + e6.unit,
3700
3736
  Document: (e6) => {
3701
3737
  if (e6.pos + /\s*/.exec(e6.textAfter)[0].length < e6.node.to) return e6.continue();
3702
- let _ = null, v;
3703
- for (let v2 = e6.node; ; ) {
3704
- let e7 = v2.lastChild;
3705
- if (!e7 || e7.name != "Element" || e7.to != v2.to) break;
3706
- _ = v2 = e7;
3738
+ let y = null, b;
3739
+ for (let b2 = e6.node; ; ) {
3740
+ let e7 = b2.lastChild;
3741
+ if (!e7 || e7.name != "Element" || e7.to != b2.to) break;
3742
+ y = b2 = e7;
3707
3743
  }
3708
- return _ && !((v = _.lastChild) && (v.name === "CloseTag" || v.name === "SelfClosingTag")) ? e6.lineIndent(_.from) + e6.unit : null;
3744
+ return y && !((b = y.lastChild) && (b.name === "CloseTag" || b.name === "SelfClosingTag")) ? e6.lineIndent(y.from) + e6.unit : null;
3709
3745
  }
3710
3746
  }), /* @__PURE__ */ foldNodeProp.add({
3711
3747
  Block: (e6) => {
3712
- let _ = `${e6.name}Open`, v = `${e6.name}Close`, y = e6.firstChild, b = e6.lastChild;
3713
- return !y || y.name !== _ ? null : {
3714
- from: y.to,
3715
- to: (b == null ? void 0 : b.name) === v ? b.from : e6.to
3748
+ let y = `${e6.name}Open`, b = `${e6.name}Close`, x = e6.firstChild, S = e6.lastChild;
3749
+ return !x || x.name !== y ? null : {
3750
+ from: x.to,
3751
+ to: (S == null ? void 0 : S.name) === b ? S.from : e6.to
3716
3752
  };
3717
3753
  },
3718
3754
  Element: (e6) => {
3719
- let _ = e6.firstChild, v = e6.lastChild;
3720
- return !_ || _.name != "OpenTag" ? null : {
3721
- from: _.to,
3722
- to: v.name === "CloseTag" ? v.from : e6.to
3755
+ let y = e6.firstChild, b = e6.lastChild;
3756
+ return !y || y.name != "OpenTag" ? null : {
3757
+ from: y.to,
3758
+ to: b.name === "CloseTag" ? b.from : e6.to
3723
3759
  };
3724
3760
  }
3725
3761
  })]
@@ -3741,43 +3777,43 @@ function svelte() {
3741
3777
  autoCloseTags
3742
3778
  ]);
3743
3779
  }
3744
- function elementName(e6, _, v = e6.length) {
3745
- if (!_) return "";
3746
- let y = _.firstChild, b = y && (y.getChild("TagName") || y.getChild("ComponentName") || y.getChild("SvelteElementName"));
3747
- return b ? e6.sliceString(b.from, Math.min(b.to, v)) : "";
3780
+ function elementName(e6, y, b = e6.length) {
3781
+ if (!y) return "";
3782
+ let x = y.firstChild, S = x && (x.getChild("TagName") || x.getChild("ComponentName") || x.getChild("SvelteElementName"));
3783
+ return S ? e6.sliceString(S.from, Math.min(S.to, b)) : "";
3748
3784
  }
3749
- var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, _, v, y) => {
3750
- if (e6.composing || e6.state.readOnly || _ != v || y != ">" && y != "/" || !svelteLanguage.isActiveAt(e6.state, _, -1)) return false;
3751
- let { state: b } = e6, x = b.changeByRange((_2) => {
3785
+ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, y, b, x) => {
3786
+ if (e6.composing || e6.state.readOnly || y != b || x != ">" && x != "/" || !svelteLanguage.isActiveAt(e6.state, y, -1)) return false;
3787
+ let { state: S } = e6, C = S.changeByRange((y2) => {
3752
3788
  var _a, _b, _c;
3753
- let { head: v2 } = _2, x2 = syntaxTree(b).resolveInner(v2, -1), S;
3754
- if ((x2.name === "TagName" || x2.name === "ComponentName" || x2.name === "SvelteElementName" || x2.name === "StartTag") && (x2 = x2.parent), y === ">" && x2.name === "OpenTag") {
3755
- if (((_b = (_a = x2.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (S = elementName(b.doc, x2.parent, v2))) {
3756
- let _3 = e6.state.doc.sliceString(v2, v2 + 1) === ">", y2 = `${_3 ? "" : ">"}</${S}>`;
3789
+ let { head: b2 } = y2, C2 = syntaxTree(S).resolveInner(b2, -1), w;
3790
+ if ((C2.name === "TagName" || C2.name === "ComponentName" || C2.name === "SvelteElementName" || C2.name === "StartTag") && (C2 = C2.parent), x === ">" && C2.name === "OpenTag") {
3791
+ if (((_b = (_a = C2.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (w = elementName(S.doc, C2.parent, b2))) {
3792
+ let y3 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x2 = `${y3 ? "" : ">"}</${w}>`;
3757
3793
  return {
3758
- range: EditorSelection.cursor(v2 + 1),
3794
+ range: EditorSelection.cursor(b2 + 1),
3759
3795
  changes: {
3760
- from: v2 + (_3 ? 1 : 0),
3761
- insert: y2
3796
+ from: b2 + (y3 ? 1 : 0),
3797
+ insert: x2
3762
3798
  }
3763
3799
  };
3764
3800
  }
3765
- } else if (y === "/" && x2.name === "OpenTag") {
3766
- let _3 = x2.parent, y2 = _3 == null ? void 0 : _3.parent;
3767
- if (_3.from == v2 - 1 && ((_c = y2.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (S = elementName(b.doc, y2, v2))) {
3768
- let _4 = e6.state.doc.sliceString(v2, v2 + 1) === ">", y3 = `/${S}${_4 ? "" : ">"}`, b2 = v2 + y3.length + (_4 ? 1 : 0);
3801
+ } else if (x === "/" && C2.name === "OpenTag") {
3802
+ let y3 = C2.parent, x2 = y3 == null ? void 0 : y3.parent;
3803
+ if (y3.from == b2 - 1 && ((_c = x2.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (w = elementName(S.doc, x2, b2))) {
3804
+ let y4 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x3 = `/${w}${y4 ? "" : ">"}`, S2 = b2 + x3.length + (y4 ? 1 : 0);
3769
3805
  return {
3770
- range: EditorSelection.cursor(b2),
3806
+ range: EditorSelection.cursor(S2),
3771
3807
  changes: {
3772
- from: v2,
3773
- insert: y3
3808
+ from: b2,
3809
+ insert: x3
3774
3810
  }
3775
3811
  };
3776
3812
  }
3777
3813
  }
3778
- return { range: _2 };
3814
+ return { range: y2 };
3779
3815
  });
3780
- return x.changes.empty ? false : (e6.dispatch(x, {
3816
+ return C.changes.empty ? false : (e6.dispatch(C, {
3781
3817
  userEvent: "input.type",
3782
3818
  scrollIntoView: true
3783
3819
  }), true);
@@ -3945,123 +3981,123 @@ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, _, v, y) =>
3945
3981
  true: true,
3946
3982
  false: true
3947
3983
  }, isOperatorChar = /[+\-*&^%:=<>!|/~]/, isNegativeChar = /[-]/, curPunc;
3948
- function tokenBase(e6, _) {
3949
- let v = e6.next();
3950
- if (v === '"' || v === "'" || v === "`") return _.tokenize = tokenString(v), _.tokenize(e6, _);
3951
- if (isVersion(e6, _)) return "version";
3952
- if (v === "." && keywordsMembersOfAddressType.some(function(_2) {
3953
- return e6.match(`${_2}`);
3984
+ function tokenBase(e6, y) {
3985
+ let b = e6.next();
3986
+ if (b === '"' || b === "'" || b === "`") return y.tokenize = tokenString(b), y.tokenize(e6, y);
3987
+ if (isVersion(e6, y)) return "version";
3988
+ if (b === "." && keywordsMembersOfAddressType.some(function(y2) {
3989
+ return e6.match(`${y2}`);
3954
3990
  })) return "addressFunction";
3955
- if (typeof v == "string" && isNumber(v, e6)) return "number";
3956
- if (typeof v == "string" && /[[\]{}(),;:.]/.test(v)) return updateGarmmer(v, _);
3957
- if (v === "/") {
3958
- if (e6.eat("*")) return _.tokenize = tokenComment, tokenComment(e6, _);
3991
+ if (typeof b == "string" && isNumber(b, e6)) return "number";
3992
+ if (typeof b == "string" && /[[\]{}(),;:.]/.test(b)) return updateGarmmer(b, y);
3993
+ if (b === "/") {
3994
+ if (e6.eat("*")) return y.tokenize = tokenComment, tokenComment(e6, y);
3959
3995
  if (e6.match(/\/{2}/)) {
3960
- for (v = e6.next(); v; ) {
3961
- if (v === "@") {
3962
- e6.backUp(1), _.grammar = "doc";
3996
+ for (b = e6.next(); b; ) {
3997
+ if (b === "@") {
3998
+ e6.backUp(1), y.grammar = "doc";
3963
3999
  break;
3964
4000
  }
3965
- v = e6.next();
4001
+ b = e6.next();
3966
4002
  }
3967
4003
  return "doc";
3968
4004
  }
3969
4005
  if (e6.eat("/")) return e6.skipToEnd(), "comment";
3970
4006
  }
3971
- if (typeof v == "string" && isNegativeChar.test(v)) {
3972
- let _2 = e6.peek();
3973
- return typeof _2 == "string" && isNumber(_2, e6) ? "number" : "operator";
4007
+ if (typeof b == "string" && isNegativeChar.test(b)) {
4008
+ let y2 = e6.peek();
4009
+ return typeof y2 == "string" && isNumber(y2, e6) ? "number" : "operator";
3974
4010
  }
3975
- if (typeof v == "string" && isOperatorChar.test(v)) return e6.eatWhile(isOperatorChar), "operator";
4011
+ if (typeof b == "string" && isOperatorChar.test(b)) return e6.eatWhile(isOperatorChar), "operator";
3976
4012
  e6.eatWhile(/[\w$_\xa1-\uffff]/);
3977
- let y = e6.current();
3978
- return _.grammar === "doc" ? natSpecTags.some(function(e7) {
3979
- return y === `@${e7}`;
3980
- }) ? "docReserve" : "doc" : (y === "solidity" && _.lastToken === "pragma" && (_.lastToken = _.lastToken + " " + y), Object.prototype.propertyIsEnumerable.call(keywords, y) ? ((y === "case" || y === "default") && (curPunc = "case"), Object.prototype.propertyIsEnumerable.call(keywordsSpecial, y) && (_.lastToken = y), "keyword") : Object.prototype.propertyIsEnumerable.call(keywordsEtherUnit, y) ? "etherUnit" : Object.prototype.propertyIsEnumerable.call(keywordsContractRelated, y) ? "contractRelated" : Object.prototype.propertyIsEnumerable.call(keywordsControlStructures, y) || Object.prototype.propertyIsEnumerable.call(keywordsTypeInformation, y) || Object.prototype.propertyIsEnumerable.call(keywordsV0505NewReserve, y) ? "keyword" : Object.prototype.propertyIsEnumerable.call(keywordsValueTypes, y) || Object.prototype.propertyIsEnumerable.call(keywordsTimeUnit, y) || isValidInteger(y) || isValidBytes(y) || isValidFixed(y) ? (_.lastToken += "variable", "keyword") : Object.prototype.propertyIsEnumerable.call(atoms, y) ? "atom" : Object.prototype.propertyIsEnumerable.call(keywordsErrorHandling, y) ? "errorHandling" : Object.prototype.propertyIsEnumerable.call(keywordsMathematicalAndCryptographicFuctions, y) ? "mathematicalAndCryptographic" : Object.prototype.propertyIsEnumerable.call(keywordsMoreBlockAndTransactionProperties, y) || Object.prototype.propertyIsEnumerable.call(keywordsBlockAndTransactionProperties, y) && keywordsBlockAndTransactionProperties[y].some(function(_2) {
3981
- return e6.match(`.${_2}`);
3982
- }) ? "variable-2" : y === "abi" && keywordsAbiEncodeDecodeFunctions[y].some(function(_2) {
3983
- return e6.match(`.${_2}`);
3984
- }) ? "abi" : updateHexLiterals(y, e6) ?? ((_.lastToken === "functionName(" || _.lastToken === "returns(") && Object.prototype.propertyIsEnumerable.call(keywordsContractList, y) ? (_.lastToken += "variable", "variable") : _.lastToken === "function" ? (_.lastToken = "functionName", _.para ?? (_.para = (_.grammar = "function", "")), _.para += "functionName", "functionName") : _.lastToken === "functionName(variable" ? (_.lastToken = "functionName(", "parameterValue") : _.lastToken === "returns(variable" ? (_.lastToken = "returns(", "parameterValue") : (_.lastToken === "address" && y === "payable" && (_.lastToken = "address payable"), (_.lastToken === "contract" || _.lastToken === "struct") && (keywordsContractList[y] = true, _.lastToken = null), _.grammar === "function" ? "parameterValue" : "variable")));
4013
+ let x = e6.current();
4014
+ return y.grammar === "doc" ? natSpecTags.some(function(e7) {
4015
+ return x === `@${e7}`;
4016
+ }) ? "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) {
4017
+ return e6.match(`.${y2}`);
4018
+ }) ? "variable-2" : x === "abi" && keywordsAbiEncodeDecodeFunctions[x].some(function(y2) {
4019
+ return e6.match(`.${y2}`);
4020
+ }) ? "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")));
3985
4021
  }
3986
4022
  function tokenString(e6) {
3987
- return function(_, v) {
3988
- let y = false, b, x = false;
3989
- for (b = _.next(); b != null; ) {
3990
- if (b === e6 && !y) {
3991
- x = true;
4023
+ return function(y, b) {
4024
+ let x = false, S, C = false;
4025
+ for (S = y.next(); S != null; ) {
4026
+ if (S === e6 && !x) {
4027
+ C = true;
3992
4028
  break;
3993
4029
  }
3994
- y = !y && e6 !== "`" && b === "\\", b = _.next();
4030
+ x = !x && e6 !== "`" && S === "\\", S = y.next();
3995
4031
  }
3996
- return (x || !(y || e6 === "`")) && (v.tokenize = tokenBase), "string";
4032
+ return (C || !(x || e6 === "`")) && (b.tokenize = tokenBase), "string";
3997
4033
  };
3998
4034
  }
3999
- function tokenComment(e6, _) {
4000
- let v = false, y = e6.next();
4001
- for (; y; ) {
4002
- if (y === "/" && v) {
4003
- _.tokenize = tokenBase;
4035
+ function tokenComment(e6, y) {
4036
+ let b = false, x = e6.next();
4037
+ for (; x; ) {
4038
+ if (x === "/" && b) {
4039
+ y.tokenize = tokenBase;
4004
4040
  break;
4005
4041
  }
4006
- v = y === "*", y = e6.next();
4042
+ b = x === "*", x = e6.next();
4007
4043
  }
4008
4044
  return "comment";
4009
4045
  }
4010
- function isVersion(e6, _) {
4011
- if (_.lastToken === "pragma solidity") return _.lastToken = null, !_.startOfLine && (e6.match(/[\^{0}][0-9.]+/) || e6.match(/[>=]+?[\s]*[0-9.]+[\s]*[<]?[\s]*[0-9.]+/));
4046
+ function isVersion(e6, y) {
4047
+ 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.]+/));
4012
4048
  }
4013
- function isNumber(e6, _) {
4014
- if (/[\d.]/.test(e6)) return e6 === "." ? _.match(/^[0-9]+([eE][-+]?[0-9]+)?/) : e6 === "0" ? _.match(/^[xX][0-9a-fA-F]+/) || _.match(/^0[0-7]+/) : _.match(/^[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?/), true;
4049
+ function isNumber(e6, y) {
4050
+ 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;
4015
4051
  }
4016
4052
  function isValidInteger(e6) {
4017
4053
  if (e6.match(/^[u]?int/)) {
4018
4054
  if (e6.indexOf("t") + 1 === e6.length) return true;
4019
- let _ = Number(e6.substr(e6.indexOf("t") + 1, e6.length));
4020
- return _ % 8 == 0 && _ <= 256;
4055
+ let y = Number(e6.substr(e6.indexOf("t") + 1, e6.length));
4056
+ return y % 8 == 0 && y <= 256;
4021
4057
  }
4022
4058
  }
4023
4059
  function isValidBytes(e6) {
4024
4060
  if (e6.match(/^bytes/)) {
4025
4061
  if (e6.indexOf("s") + 1 === e6.length) return true;
4026
- let _ = e6.substr(e6.indexOf("s") + 1, e6.length);
4027
- return Number(_) <= 32;
4062
+ let y = e6.substr(e6.indexOf("s") + 1, e6.length);
4063
+ return Number(y) <= 32;
4028
4064
  }
4029
4065
  }
4030
4066
  function isValidFixed(e6) {
4031
4067
  if (e6.match(/^[u]?fixed([0-9]+x[0-9]+)?/)) {
4032
4068
  if (e6.indexOf("d") + 1 === e6.length) return true;
4033
- let _ = e6.substr(e6.indexOf("d") + 1, e6.length).split("x").map(Number);
4034
- return _[0] % 8 == 0 && _[0] <= 256 && _[1] <= 80;
4069
+ let y = e6.substr(e6.indexOf("d") + 1, e6.length).split("x").map(Number);
4070
+ return y[0] % 8 == 0 && y[0] <= 256 && y[1] <= 80;
4035
4071
  }
4036
4072
  }
4037
- function updateHexLiterals(e6, _) {
4038
- if (e6.match(/^hex/) && _.peek() === '"') {
4039
- let e7 = false, v, y = "", b = "";
4040
- for (v = _.next(); v; ) {
4041
- if (b += v, v === '"' && e7) {
4042
- if (y = b.substring(1, b.length - 1), y.match(/^[0-9a-fA-F]+$/)) return "number";
4043
- _.backUp(b.length);
4073
+ function updateHexLiterals(e6, y) {
4074
+ if (e6.match(/^hex/) && y.peek() === '"') {
4075
+ let e7 = false, b, x = "", S = "";
4076
+ for (b = y.next(); b; ) {
4077
+ if (S += b, b === '"' && e7) {
4078
+ if (x = S.substring(1, S.length - 1), x.match(/^[0-9a-fA-F]+$/)) return "number";
4079
+ y.backUp(S.length);
4044
4080
  break;
4045
4081
  }
4046
- e7 || (e7 = v === '"'), v = _.next();
4082
+ e7 || (e7 = b === '"'), b = y.next();
4047
4083
  }
4048
4084
  }
4049
4085
  }
4050
- function updateGarmmer(e6, _) {
4051
- return e6 === "," && _.para === "functionName(variable" && (_.para = "functionName("), _.para != null && _.para.startsWith("functionName") && (e6 === ")" ? _.para.endsWith("(") && (_.para = _.para.substr(0, _.para.length - 1), _.para === "functionName" && (_.grammar = "")) : e6 === "(" && (_.para += e6)), e6 === "(" && _.lastToken === "functionName" ? _.lastToken += e6 : e6 === ")" && _.lastToken === "functionName(" ? _.lastToken = null : e6 === "(" && _.lastToken === "returns" ? _.lastToken += e6 : e6 === ")" && (_.lastToken === "returns(" || _.lastToken === "returns(variable") && (_.lastToken = null), e6 === "(" && _.lastToken === "address" && (_.lastToken += e6), curPunc = e6, null;
4086
+ function updateGarmmer(e6, y) {
4087
+ 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;
4052
4088
  }
4053
4089
  var Context = class {
4054
- constructor(e6, _, v, y, b) {
4055
- this.indented = e6, this.column = _, this.type = v, this.align = y, this.prev = b;
4090
+ constructor(e6, y, b, x, S) {
4091
+ this.indented = e6, this.column = y, this.type = b, this.align = x, this.prev = S;
4056
4092
  }
4057
4093
  };
4058
- function pushContext(e6, _, v) {
4059
- return e6.context = new Context(e6.indented, _, v, null, e6.context), e6.context;
4094
+ function pushContext(e6, y, b) {
4095
+ return e6.context = new Context(e6.indented, y, b, null, e6.context), e6.context;
4060
4096
  }
4061
4097
  function popContext(e6) {
4062
4098
  if (!e6.context.prev) return;
4063
- let _ = e6.context.type;
4064
- return (_ === ")" || _ === "]" || _ === "}") && (e6.indented = e6.context.indented), e6.context = e6.context.prev;
4099
+ let y = e6.context.type;
4100
+ return (y === ")" || y === "]" || y === "}") && (e6.indented = e6.context.indented), e6.context = e6.context.prev;
4065
4101
  }
4066
4102
  var parser = {
4067
4103
  startState(e6) {
@@ -4075,19 +4111,19 @@ var parser = {
4075
4111
  para: null
4076
4112
  };
4077
4113
  },
4078
- token(e6, _) {
4079
- let v = _.context;
4080
- if (e6.sol() && (v.align ?? (v.align = false), _.indented = e6.indentation(), _.startOfLine = true, v.type === "case" && (v.type = "}"), _.grammar === "doc" && (_.grammar = null)), e6.eatSpace()) return null;
4114
+ token(e6, y) {
4115
+ let b = y.context;
4116
+ 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;
4081
4117
  curPunc = null;
4082
- let y = (_.tokenize || tokenBase)(e6, _);
4083
- return y === "comment" ? y : (v.align ?? (v.align = true), curPunc === "{" ? pushContext(_, e6.column(), "}") : curPunc === "[" ? pushContext(_, e6.column(), "]") : curPunc === "(" ? pushContext(_, e6.column(), ")") : curPunc === "case" ? v.type = "case" : (curPunc === "}" && v.type === "}" || curPunc === v.type) && popContext(_), _.startOfLine = false, y);
4118
+ let x = (y.tokenize || tokenBase)(e6, y);
4119
+ 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);
4084
4120
  },
4085
- indent(e6, _, v) {
4121
+ indent(e6, y, b) {
4086
4122
  if (e6.tokenize !== tokenBase && e6.tokenize != null) return null;
4087
- let y = e6.context, b = _ && _.charAt(0);
4088
- if (y.type === "case" && /^(?:case|default)\b/.test(_)) return e6.context.type = "}", y.indented;
4089
- let x = b === y.type;
4090
- return y.align ? y.column + (x ? 0 : 1) : y.indented + (x ? 0 : v.unit);
4123
+ let x = e6.context, S = y && y.charAt(0);
4124
+ if (x.type === "case" && /^(?:case|default)\b/.test(y)) return e6.context.type = "}", x.indented;
4125
+ let C = S === x.type;
4126
+ return x.align ? x.column + (C ? 0 : 1) : x.indented + (C ? 0 : b.unit);
4091
4127
  },
4092
4128
  electricChars: "{}):",
4093
4129
  closeBrackets: "()[]{}''\"\"``",