@mdn/fred 2.2.0 → 2.2.1

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 (222) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/components/content-section/server.css +1 -1
  3. package/components/curriculum/layout.css +2 -77
  4. package/components/curriculum/sidebar.css +0 -4
  5. package/components/curriculum/toc.css +1 -3
  6. package/components/curriculum-about/server.js +15 -6
  7. package/components/curriculum-default/server.js +15 -6
  8. package/components/curriculum-module/server.js +15 -6
  9. package/components/curriculum-overview/server.js +15 -36
  10. package/components/generic-layout/server.css +4 -60
  11. package/components/generic-layout/server.js +9 -4
  12. package/components/generic-sidebar/server.css +1 -3
  13. package/components/generic-toc/server.css +0 -3
  14. package/components/homepage-contributor-spotlight/server.css +5 -1
  15. package/components/html/global.css +2 -1
  16. package/components/layout/2-sidebars.css +141 -0
  17. package/components/layout/README.md +52 -10
  18. package/components/layout/global.css +5 -6
  19. package/components/left-sidebar/server.css +2 -12
  20. package/components/page-layout/server.css +1 -1
  21. package/components/play-console/element.css +15 -0
  22. package/components/print/global.css +2 -2
  23. package/components/reference-layout/server.css +2 -80
  24. package/components/reference-layout/server.js +6 -6
  25. package/out/service-worker.js +1 -1
  26. package/out/service-worker.js.map +1 -1
  27. package/out/static/client/{198.edf1fdf142c21fb8.css → 198.f743d603d3fa74b7.css} +2 -2
  28. package/out/static/client/{198.edf1fdf142c21fb8.css.map → 198.f743d603d3fa74b7.css.map} +1 -1
  29. package/out/static/client/270.66bae6059a1c23f9.css +2 -0
  30. package/out/static/client/270.66bae6059a1c23f9.css.map +1 -0
  31. package/out/static/client/5408.a0622390fa1726dc.css +2 -0
  32. package/out/static/client/5408.a0622390fa1726dc.css.map +1 -0
  33. package/out/static/client/6216.91b6560dce4c40eb.js +2 -0
  34. package/out/static/client/6216.91b6560dce4c40eb.js.map +1 -0
  35. package/out/static/client/6760.d97440f1ca6690c6.js +6 -0
  36. package/out/static/client/6760.d97440f1ca6690c6.js.map +1 -0
  37. package/out/static/client/{749.f46b8d04d93e42db.js → 749.15180d605dd9d7e9.js} +2 -2
  38. package/out/static/client/749.15180d605dd9d7e9.js.map +1 -0
  39. package/out/static/client/{index.a66b5a087a738e61.js → index.a845f20de1913b16.js} +3 -3
  40. package/out/static/client/{index.a66b5a087a738e61.js.map → index.a845f20de1913b16.js.map} +1 -1
  41. package/out/static/client/{runtime.149f3caaca6b394a.js → runtime.b11a359ec0a4abb0.js} +2 -2
  42. package/out/static/client/{runtime.149f3caaca6b394a.js.map → runtime.b11a359ec0a4abb0.js.map} +1 -1
  43. package/out/static/client/stats.json +740 -686
  44. package/out/static/client/styles-a11y-menu.7b49a1a7289a65dd.js +1 -0
  45. package/out/static/client/styles-advertising.ee901de4f53dfcfb.js +1 -0
  46. package/out/static/client/styles-article-footer.e9f7514e3e96e55e.js +1 -0
  47. package/out/static/client/styles-banner.d39b1822c276b7a1.js +1 -0
  48. package/out/static/client/styles-baseline-indicator.b0124633d8959185.js +1 -0
  49. package/out/static/client/styles-blog-index.a6463d0111bfa84b.js +1 -0
  50. package/out/static/client/styles-blog-post.226761d5090b01f6.js +1 -0
  51. package/out/static/client/{styles-blog-post.23b8b3e8e0ec1e69.css → styles-blog-post.c03ec8a22f8d4ff6.css} +2 -2
  52. package/out/static/client/{styles-blog-post.23b8b3e8e0ec1e69.css.map → styles-blog-post.c03ec8a22f8d4ff6.css.map} +1 -1
  53. package/out/static/client/styles-breadcrumbs-bar.9539fa2e37251d88.js +1 -0
  54. package/out/static/client/{styles-breadcrumbs-bar.02910e49bb8b2372.css → styles-breadcrumbs-bar.9a51a3c76a6231d0.css} +2 -2
  55. package/out/static/client/{styles-breadcrumbs-bar.02910e49bb8b2372.css.map → styles-breadcrumbs-bar.9a51a3c76a6231d0.css.map} +1 -1
  56. package/out/static/client/styles-breadcrumbs.73650619944b4ea9.js +1 -0
  57. package/out/static/client/styles-button.63c03050fb25b8ce.js +1 -0
  58. package/out/static/client/{styles-content-section.302cd1e445138b77.css → styles-content-section.01ee04d014688a05.css} +2 -2
  59. package/out/static/client/{styles-content-section.302cd1e445138b77.css.map → styles-content-section.01ee04d014688a05.css.map} +1 -1
  60. package/out/static/client/styles-content-section.4ebcf9edf977159a.js +1 -0
  61. package/out/static/client/styles-contributor-spotlight.f585c3be560baa36.js +1 -0
  62. package/out/static/client/styles-curriculum-about.df2a58fdc99668aa.js +1 -0
  63. package/out/static/client/styles-curriculum-default.87a662ae2e005fdc.js +1 -0
  64. package/out/static/client/styles-curriculum-landing.9af582d4a3e0692e.js +1 -0
  65. package/out/static/client/styles-curriculum-module.f87720da3b256bba.js +1 -0
  66. package/out/static/client/styles-curriculum-overview.16cdc5cb80128597.js +1 -0
  67. package/out/static/client/styles-featured-articles.950585abbd167c3f.js +1 -0
  68. package/out/static/client/styles-footer.f49c80542ef1fffb.js +1 -0
  69. package/out/static/client/styles-generic-about.b208cb4d9b62f6c5.js +1 -0
  70. package/out/static/client/styles-generic-community.264a7b11b708e2ae.js +1 -0
  71. package/out/static/client/styles-generic-content.bd4990121f075489.js +1 -0
  72. package/out/static/client/styles-generic-layout.1bc69c25775219ab.css +2 -0
  73. package/out/static/client/styles-generic-layout.1bc69c25775219ab.css.map +1 -0
  74. package/out/static/client/styles-generic-layout.518d8e7529d6d1e8.js +1 -0
  75. package/out/static/client/styles-generic-sidebar.a304a0ae4ff5d9d0.css +2 -0
  76. package/out/static/client/styles-generic-sidebar.a304a0ae4ff5d9d0.css.map +1 -0
  77. package/out/static/client/styles-generic-sidebar.a6ddb6ad375b6dea.js +1 -0
  78. package/out/static/client/styles-generic-toc.25a47b5903329e13.js +1 -0
  79. package/out/static/client/styles-generic-toc.b6981465a649e2b6.css +2 -0
  80. package/out/static/client/styles-generic-toc.b6981465a649e2b6.css.map +1 -0
  81. package/out/static/client/styles-global.b5c1c00652883917.js +1 -0
  82. package/out/static/client/{styles-global.2db431c11b66274e.css → styles-global.d24cf1d2734970c9.css} +2 -2
  83. package/out/static/client/{styles-global.2db431c11b66274e.css.map → styles-global.d24cf1d2734970c9.css.map} +1 -1
  84. package/out/static/client/styles-heading-anchor.a68e3e0eb0044a98.js +1 -0
  85. package/out/static/client/styles-homepage-body.04efe05e01579005.js +1 -0
  86. package/out/static/client/styles-homepage-contributor-spotlight.2bcbb1476c70410c.css +2 -0
  87. package/out/static/client/styles-homepage-contributor-spotlight.2bcbb1476c70410c.css.map +1 -0
  88. package/out/static/client/styles-homepage-contributor-spotlight.2da6fde81ab2e03a.js +1 -0
  89. package/out/static/client/styles-homepage-footer.d85ee198521b0417.js +1 -0
  90. package/out/static/client/styles-homepage-header.5c911fca0afedc7b.js +1 -0
  91. package/out/static/client/styles-homepage-hero.84542c123063331a.js +1 -0
  92. package/out/static/client/styles-homepage.6e3908e268226cfc.js +1 -0
  93. package/out/static/client/styles-latest-news.44b2cf830a3df3ba.js +1 -0
  94. package/out/static/client/styles-left-sidebar.81864a1b1af13cdc.css +2 -0
  95. package/out/static/client/styles-left-sidebar.81864a1b1af13cdc.css.map +1 -0
  96. package/out/static/client/styles-left-sidebar.c2ccc5982e4f4ec0.js +1 -0
  97. package/out/static/client/styles-logo.0e5223b5ca6c5c86.js +1 -0
  98. package/out/static/client/styles-mandala.5c6c0f84ff4bc09b.js +1 -0
  99. package/out/static/client/styles-menu.649d9e554d19dacb.js +1 -0
  100. package/out/static/client/styles-navigation.1bb818a8993b53bb.js +1 -0
  101. package/out/static/client/styles-not-found.5548da6ee760df5e.js +1 -0
  102. package/out/static/client/{styles-observatory-landing.7b47ee0004877825.css → styles-observatory-landing.55565f28f568d9fe.css} +2 -2
  103. package/out/static/client/{styles-observatory-landing.7b47ee0004877825.css.map → styles-observatory-landing.55565f28f568d9fe.css.map} +1 -1
  104. package/out/static/client/styles-observatory-landing.7b756d84bfd1f4a5.js +1 -0
  105. package/out/static/client/{styles-observatory-results.d8a2bea1fbfd4b2b.css → styles-observatory-results.8a6dcd7f335b94cc.css} +2 -2
  106. package/out/static/client/{styles-observatory-results.d8a2bea1fbfd4b2b.css.map → styles-observatory-results.8a6dcd7f335b94cc.css.map} +1 -1
  107. package/out/static/client/styles-observatory-results.a50f31e31fe5ce13.js +1 -0
  108. package/out/static/client/{styles-page-layout.e9b295138adbd4bc.css → styles-page-layout.5a4354f33e894319.css} +2 -2
  109. package/out/static/client/{styles-page-layout.e9b295138adbd4bc.css.map → styles-page-layout.5a4354f33e894319.css.map} +1 -1
  110. package/out/static/client/styles-page-layout.9a6bdcc133e4e481.js +1 -0
  111. package/out/static/client/styles-pagination.5b25c72cc0556f24.js +1 -0
  112. package/out/static/client/styles-playground.090bda8c12a63ec0.js +1 -0
  113. package/out/static/client/styles-recent-contributions.e713ba28ab0b7bc3.js +1 -0
  114. package/out/static/client/styles-reference-layout.e853d0ede90ff6ff.js +1 -0
  115. package/out/static/client/styles-reference-layout.f17861486ef2423f.css +2 -0
  116. package/out/static/client/styles-reference-layout.f17861486ef2423f.css.map +1 -0
  117. package/out/static/client/styles-reference-toc.dcf148c129d92975.js +1 -0
  118. package/out/static/client/styles-sandbox.dcb6dce1120b594d.js +1 -0
  119. package/out/static/client/{styles-site-search.ec3b6780533a8750.css → styles-site-search.3177bb12b1f83bf7.css} +2 -2
  120. package/out/static/client/{styles-site-search.ec3b6780533a8750.css.map → styles-site-search.3177bb12b1f83bf7.css.map} +1 -1
  121. package/out/static/client/styles-site-search.acc899abcd2a7645.js +1 -0
  122. package/out/static/client/styles-social-image.65fa265c06411ba3.js +1 -0
  123. package/out/static/client/styles-translation-banner.261e19907fee981b.js +1 -0
  124. package/out/static/client/styles-writer-toolbar.16afb45c733053cc.js +1 -0
  125. package/out/static/client/styles.298615289719f0aa.js +2 -0
  126. package/out/static/client/styles.298615289719f0aa.js.map +1 -0
  127. package/out/static/legacy/{2569.9f096bac448374bd.js → 2569.39ecdf7fe2d20c17.js} +2 -2
  128. package/out/static/legacy/{2569.9f096bac448374bd.js.map → 2569.39ecdf7fe2d20c17.js.map} +1 -1
  129. package/out/static/legacy/6753.9fefb8415a5a449e.js +27 -0
  130. package/out/static/legacy/6753.9fefb8415a5a449e.js.map +1 -0
  131. package/out/static/legacy/asset-manifest.json +8 -8
  132. package/out/static/legacy/{index.7ddac90f21db9f4e.html → index.5b77e00ea8d6df0b.html} +1 -1
  133. package/out/static/legacy/{index.6c7371784b8345e6.js → index.def60ac10a95218f.js} +3 -3
  134. package/out/static/legacy/{index.6c7371784b8345e6.js.map → index.def60ac10a95218f.js.map} +1 -1
  135. package/out/static/legacy/stats.json +13 -13
  136. package/out/static/legacy/{yari.74e397a2236facc5.js → yari.c9b6c25e48cbb380.js} +4 -4
  137. package/out/static/legacy/yari.c9b6c25e48cbb380.js.map +1 -0
  138. package/out/static/ssr/index.js +78 -37
  139. package/out/static/ssr/index.js.map +1 -1
  140. package/out/static/ssr/stats.json +4 -4
  141. package/package.json +18 -18
  142. package/out/static/client/5408.4bc756c440135b62.css +0 -2
  143. package/out/static/client/5408.4bc756c440135b62.css.map +0 -1
  144. package/out/static/client/6216.1bfd3cf0b0a6c7df.js +0 -2
  145. package/out/static/client/6216.1bfd3cf0b0a6c7df.js.map +0 -1
  146. package/out/static/client/6760.6ac3b2b3affbbe00.js +0 -6
  147. package/out/static/client/6760.6ac3b2b3affbbe00.js.map +0 -1
  148. package/out/static/client/749.f46b8d04d93e42db.js.map +0 -1
  149. package/out/static/client/styles-a11y-menu.b09c6038ee60691b.js +0 -1
  150. package/out/static/client/styles-advertising.8a72634ac33967b3.js +0 -1
  151. package/out/static/client/styles-article-footer.2008e05e900132bf.js +0 -1
  152. package/out/static/client/styles-banner.1588da63ad451f94.js +0 -1
  153. package/out/static/client/styles-baseline-indicator.045ce266c0388ff2.js +0 -1
  154. package/out/static/client/styles-blog-index.af7e5efac0463be9.js +0 -1
  155. package/out/static/client/styles-blog-post.21543a25c5d0c820.js +0 -1
  156. package/out/static/client/styles-breadcrumbs-bar.4e50455c81d9f236.js +0 -1
  157. package/out/static/client/styles-breadcrumbs.3272f39f147fdb26.js +0 -1
  158. package/out/static/client/styles-button.93e42cbce83fe9f8.js +0 -1
  159. package/out/static/client/styles-content-section.b38423c0dca8e3e4.js +0 -1
  160. package/out/static/client/styles-contributor-spotlight.efe854e18205bd6c.js +0 -1
  161. package/out/static/client/styles-curriculum-about.eb719efa09eab2e3.js +0 -1
  162. package/out/static/client/styles-curriculum-default.648a02845551d4a6.js +0 -1
  163. package/out/static/client/styles-curriculum-landing.f3af2ff9b3815ed8.js +0 -1
  164. package/out/static/client/styles-curriculum-module.284687a631bdb6c0.js +0 -1
  165. package/out/static/client/styles-curriculum-overview.81d25abdbb43b369.js +0 -1
  166. package/out/static/client/styles-featured-articles.1390540e6554e233.js +0 -1
  167. package/out/static/client/styles-footer.15153a4030e38f8f.js +0 -1
  168. package/out/static/client/styles-generic-about.f0afaa2db7066430.js +0 -1
  169. package/out/static/client/styles-generic-community.ff945b87102835f8.js +0 -1
  170. package/out/static/client/styles-generic-content.d0e560a0506475b1.js +0 -1
  171. package/out/static/client/styles-generic-layout.42a5e62407bd0066.css +0 -2
  172. package/out/static/client/styles-generic-layout.42a5e62407bd0066.css.map +0 -1
  173. package/out/static/client/styles-generic-layout.ca2cef837e24e7df.js +0 -1
  174. package/out/static/client/styles-generic-sidebar.b2b48d0d08f8bae7.js +0 -1
  175. package/out/static/client/styles-generic-sidebar.db43d8c5c4748aca.css +0 -2
  176. package/out/static/client/styles-generic-sidebar.db43d8c5c4748aca.css.map +0 -1
  177. package/out/static/client/styles-generic-toc.109e07ffeb20bc67.css +0 -2
  178. package/out/static/client/styles-generic-toc.109e07ffeb20bc67.css.map +0 -1
  179. package/out/static/client/styles-generic-toc.e8887bbe84a31d72.js +0 -1
  180. package/out/static/client/styles-global.efc5040b727dfca4.js +0 -1
  181. package/out/static/client/styles-heading-anchor.d7e14184517a1d3e.js +0 -1
  182. package/out/static/client/styles-homepage-body.1196a061fab22906.js +0 -1
  183. package/out/static/client/styles-homepage-contributor-spotlight.09a6993f73166d63.js +0 -1
  184. package/out/static/client/styles-homepage-contributor-spotlight.edc39a3f01eb964e.css +0 -2
  185. package/out/static/client/styles-homepage-contributor-spotlight.edc39a3f01eb964e.css.map +0 -1
  186. package/out/static/client/styles-homepage-footer.472132358e452a8b.js +0 -1
  187. package/out/static/client/styles-homepage-header.e6423ccb0a814f99.js +0 -1
  188. package/out/static/client/styles-homepage-hero.1c106d7a3adb970a.js +0 -1
  189. package/out/static/client/styles-homepage.843ab43d3f720fb6.js +0 -1
  190. package/out/static/client/styles-latest-news.986caae0711fbfe3.js +0 -1
  191. package/out/static/client/styles-left-sidebar.4d5208e5cb72af05.css +0 -2
  192. package/out/static/client/styles-left-sidebar.4d5208e5cb72af05.css.map +0 -1
  193. package/out/static/client/styles-left-sidebar.5a4d56fc21aab182.js +0 -1
  194. package/out/static/client/styles-logo.9cf3aa133bae8020.js +0 -1
  195. package/out/static/client/styles-mandala.b9822fc945abee39.js +0 -1
  196. package/out/static/client/styles-menu.97e048a6ffc666ce.js +0 -1
  197. package/out/static/client/styles-navigation.58a2a0a1f8d4487b.js +0 -1
  198. package/out/static/client/styles-not-found.a5c00a725a178969.js +0 -1
  199. package/out/static/client/styles-observatory-landing.c729a3523c37df23.js +0 -1
  200. package/out/static/client/styles-observatory-results.d4d142541bf683e1.js +0 -1
  201. package/out/static/client/styles-page-layout.baa1dac2402744c9.js +0 -1
  202. package/out/static/client/styles-pagination.04e3a505f4e789a6.js +0 -1
  203. package/out/static/client/styles-playground.7de5e497e2ebfa83.js +0 -1
  204. package/out/static/client/styles-recent-contributions.f1ab270b54c7e8de.js +0 -1
  205. package/out/static/client/styles-reference-layout.2c2d031dc83d605a.css +0 -2
  206. package/out/static/client/styles-reference-layout.2c2d031dc83d605a.css.map +0 -1
  207. package/out/static/client/styles-reference-layout.5c4b832bc9420f51.js +0 -1
  208. package/out/static/client/styles-reference-toc.afd507fb6d5ef895.js +0 -1
  209. package/out/static/client/styles-sandbox.3de7bd2afac30c66.js +0 -1
  210. package/out/static/client/styles-site-search.05f228cb7ac309b2.js +0 -1
  211. package/out/static/client/styles-social-image.dbdccf6b8d9258f2.js +0 -1
  212. package/out/static/client/styles-translation-banner.7698ddb14a70d0e5.js +0 -1
  213. package/out/static/client/styles-writer-toolbar.f161f8bd86e23a2a.js +0 -1
  214. package/out/static/client/styles.a182af71488aad03.js +0 -2
  215. package/out/static/client/styles.a182af71488aad03.js.map +0 -1
  216. package/out/static/legacy/6753.c44647828e8b4816.js +0 -27
  217. package/out/static/legacy/6753.c44647828e8b4816.js.map +0 -1
  218. package/out/static/legacy/yari.74e397a2236facc5.js.map +0 -1
  219. /package/out/static/client/{index.a66b5a087a738e61.js.LICENSE.txt → index.a845f20de1913b16.js.LICENSE.txt} +0 -0
  220. /package/out/static/legacy/{6753.c44647828e8b4816.js.LICENSE.txt → 6753.9fefb8415a5a449e.js.LICENSE.txt} +0 -0
  221. /package/out/static/legacy/{index.6c7371784b8345e6.js.LICENSE.txt → index.def60ac10a95218f.js.LICENSE.txt} +0 -0
  222. /package/out/static/legacy/{yari.74e397a2236facc5.js.LICENSE.txt → yari.c9b6c25e48cbb380.js.LICENSE.txt} +0 -0
@@ -0,0 +1,6 @@
1
+ export const __rspack_esm_id="6760";export const __rspack_esm_ids=["6760"];export const __webpack_modules__={47105(e,r,t){t.d(r,{A:()=>a});var o=t(97825),s=t(31601),n=t.n(s),i=t(76314),l=t.n(i)()(n());l.push([e.id,':host{background-color:var(--color-background-secondary);box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--font-size-small);margin:0;overflow:auto;width:100%}ul{list-style:none;margin:0;padding:0}li{padding:0 .5em;white-space:nowrap}li:before{content:"> ";vertical-align:top;width:.75rem}code,li:before{display:inline-block}code{font-family:var(--font-family-code);margin:0;tab-size:4;white-space:pre-wrap;width:calc(100% - .75rem)}',""]);let a=(0,o.AH)([l.toString()])},71787(e,r,t){t.r(r),t.d(r,{MDNPlayConsole:()=>MDNPlayConsole});var o=t(97825),s=t(47105);function n(e){let r="";for(let t=0,o=e.length;t<o;t++){if("string"==typeof e[t])r+='"'+e[t]+'"';else if(Array.isArray(e[t]))r+="Array [",r+=n(e[t]),r+="]";else if(Object.prototype.hasOwnProperty.call(e,t))r+=i(e[t]);else{let s=1;for(;t+1<o&&!Object.prototype.hasOwnProperty.call(e,t+1);)s++,t++;r+=1===s?"<1 empty slot>":`<${s} empty slots>`}t<e.length-1&&(r+=", ")}return r}function i(e){if(null==e||"boolean"==typeof e)return String(e);if("number"==typeof e)return Object.is(e,-0)?"-0":String(e);if("bigint"==typeof e)return String(e)+"n";if("string"==typeof e)return e.includes('"')?"'"+e+"'":'"'+e+'"';if(Array.isArray(e))return"Array ["+n(e)+"]";else return function(e){let r=e.constructor?e.constructor.name:e;if("String"===r)return`String { "${e.valueOf()}" }`;if(e===JSON)return"JSON {}";if(r.match&&/^(ArrayBuffer|SharedArrayBuffer|DataView)$/.test(r))return r+" {}";if(r.match&&/^(Int8Array|Int16Array|Int32Array|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|Float32Array|Float64Array|BigInt64Array|BigUint64Array)$/.test(r))return e.length>0?r+" ["+n(e)+"]":r+" []";if("Symbol"===r&&void 0!==e)return e.toString();if("Object"===r){if(e?._MDNPlaySerializedObject)return e._MDNPlaySerializedObject;let t="",o=!0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(o?o=!1:t+=", ",t=t+r+": "+i(e[r]));return r+" { "+t+" }"}if(!e.constructor&&!e.prototype){let r="",t=!0;for(let o in e)t?t=!1:r+=", ",r=r+o+": "+i(e[o]);return"Object { "+r+" }"}return e}(e)}let VirtualConsole=class VirtualConsole{#e;constructor(e){this.#e=e}clear(){this.#e._messages=[]}debug(...e){return this.log(...e)}error(...e){return this.log(...e)}info(...e){return this.log(...e)}log(...e){e.length>1&&"string"==typeof e[0]&&(e[0]=e[0].replaceAll(/%(?:\.([0-9]+))?(.)/g,(r,t,o)=>{switch(o){case"o":case"O":return i(e.splice(1,1)[0]);case"d":case"i":return Math.trunc(e.splice(1,1)[0]).toFixed(0).padStart(t,"0");case"s":return e.splice(1,1)[0].toString();case"f":{let r=e.splice(1,1)[0];return("number"==typeof r?r:Number.parseFloat(r)).toFixed(t??6)}case"c":return e.splice(1,1),"";case"%":return"%";default:return r}})),this.#e._messages=[...this.#e._messages,e.map(e=>i(e)).join(" ")]}warn(...e){return this.log(...e)}};let MDNPlayConsole=class MDNPlayConsole extends o.WF{static properties={_messages:{state:!0}};static styles=s.A;constructor(){super(),this.vconsole=new VirtualConsole(this),this._messages=[]}onConsole({detail:e}){if(e.prop in this.vconsole){let r=e.prop;e.args?this.vconsole[r](...e.args):this.vconsole[r]()}else this.vconsole.warn("[Playground] Unsupported console message (see browser console)")}render(){return(0,o.qy)`
2
+ <ul aria-live="polite">
3
+ ${this._messages.map(e=>(0,o.qy)`<li><code>${e}</code></li>`)}
4
+ </ul>
5
+ `}updated(){this.scrollTo({top:this.scrollHeight})}};customElements.define("mdn-play-console",MDNPlayConsole)}};
6
+ //# sourceMappingURL=6760.d97440f1ca6690c6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"6760.d97440f1ca6690c6.js","sources":["webpack://@mdn/fred/./components/play-console/element.css","webpack://@mdn/fred/./components/play-console/utils.js","webpack://@mdn/fred/./components/play-console/element.js"],"sourcesContent":["import { css } from \"lit\";\n// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{background-color:var(--color-background-secondary);box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--font-size-small);margin:0;overflow:auto;width:100%}ul{list-style:none;margin:0;padding:0}li{padding:0 .5em;white-space:nowrap}li:before{content:\"> \";vertical-align:top;width:.75rem}code,li:before{display:inline-block}code{font-family:var(--font-family-code);margin:0;tab-size:4;white-space:pre-wrap;width:calc(100% - .75rem)}`, \"\"]);\n// Exports\nexport default css([___CSS_LOADER_EXPORT___.toString()]);\n","// Copied from https://github.com/mdn/bob/blob/9da42cd641d7f2a9796bf3406e74cad411ce9438/editor/js/editor-libs/console-utils.ts\n/**\n * Formats arrays:\n * - quotes around strings in arrays\n * - square brackets around arrays\n * - adds commas appropriately (with spacing)\n * - identifies empty slots\n * designed to be used recursively\n * @param {any} input - The output to log.\n * @returns Formatted output as a string.\n */\nexport function formatArray(input) {\n let output = \"\";\n for (let i = 0, l = input.length; i < l; i++) {\n if (typeof input[i] === \"string\") {\n output += '\"' + input[i] + '\"';\n } else if (Array.isArray(input[i])) {\n output += \"Array [\";\n output += formatArray(input[i]);\n output += \"]\";\n } else if (Object.prototype.hasOwnProperty.call(input, i)) {\n output += formatOutput(input[i]);\n } else {\n let emptyCount = 1;\n while (i + 1 < l && !Object.prototype.hasOwnProperty.call(input, i + 1)) {\n emptyCount++;\n i++;\n }\n output +=\n emptyCount === 1 ? \"<1 empty slot>\" : `<${emptyCount} empty slots>`;\n }\n\n if (i < input.length - 1) {\n output += \", \";\n }\n }\n return output;\n}\n\n/**\n * Formats objects:\n * ArrayBuffer, DataView, SharedArrayBuffer,\n * Int8Array, Int16Array, Int32Array,\n * Uint8Array, Uint16Array, Uint32Array,\n * Uint8ClampedArray, Float32Array, Float64Array\n * Symbol\n * @param {any} input - The output to log.\n * @returns Formatted output as a string.\n */\nexport function formatObject(input) {\n const bufferDataViewRegExp = /^(ArrayBuffer|SharedArrayBuffer|DataView)$/;\n const complexArrayRegExp =\n /^(Int8Array|Int16Array|Int32Array|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|Float32Array|Float64Array|BigInt64Array|BigUint64Array)$/;\n\n const objectName = input.constructor ? input.constructor.name : input;\n\n if (objectName === \"String\") {\n // String object\n return `String { \"${input.valueOf()}\" }`;\n }\n\n if (input === JSON) {\n // console.log(JSON) is output as \"JSON {}\" in browser console\n return `JSON {}`;\n }\n\n if (objectName.match && bufferDataViewRegExp.test(objectName)) {\n return objectName + \" {}\";\n }\n\n if (objectName.match && complexArrayRegExp.test(objectName)) {\n const arrayLength = input.length;\n\n return arrayLength > 0\n ? objectName + \" [\" + formatArray(input) + \"]\"\n : objectName + \" []\";\n }\n\n if (objectName === \"Symbol\" && input !== undefined) {\n return input.toString();\n }\n\n if (objectName === \"Object\") {\n if (input?._MDNPlaySerializedObject) {\n return input._MDNPlaySerializedObject;\n }\n let formattedChild = \"\";\n let start = true;\n for (const key in input) {\n if (Object.prototype.hasOwnProperty.call(input, key)) {\n if (start) {\n start = false;\n } else {\n formattedChild = formattedChild + \", \";\n }\n formattedChild = formattedChild + key + \": \" + formatOutput(input[key]);\n }\n }\n return objectName + \" { \" + formattedChild + \" }\";\n }\n\n // Special object created with `OrdinaryObjectCreate(null)` returned by, for\n // example, named capture groups in https://mzl.la/2RERfQL\n // @see https://github.com/mdn/bob/issues/574#issuecomment-858213621\n if (!input.constructor && !input.prototype) {\n let formattedChild = \"\";\n let start = true;\n for (const key in input) {\n if (start) {\n start = false;\n } else {\n formattedChild = formattedChild + \", \";\n }\n formattedChild = formattedChild + key + \": \" + formatOutput(input[key]);\n }\n return \"Object { \" + formattedChild + \" }\";\n }\n\n return input;\n}\n\n/**\n * Formats output to indicate its type:\n * - quotes around strings\n * - single quotes around strings containing double quotes\n * - square brackets around arrays\n * (also copes with arrays of arrays)\n * does NOT detect Int32Array etc\n * @param {any} input - The output to log.\n * @returns Formatted output as a string.\n */\nexport function formatOutput(input) {\n if (input === undefined || input === null || typeof input === \"boolean\") {\n return String(input);\n } else if (typeof input === \"number\") {\n // Negative zero\n if (Object.is(input, -0)) {\n return \"-0\";\n }\n return String(input);\n } else if (typeof input === \"bigint\") {\n return String(input) + \"n\";\n } else if (typeof input === \"string\") {\n // string literal\n return input.includes('\"') ? \"'\" + input + \"'\" : '\"' + input + '\"';\n } else if (Array.isArray(input)) {\n // check the contents of the array\n return \"Array [\" + formatArray(input) + \"]\";\n } else {\n return formatObject(input);\n }\n}\n","import { LitElement, html } from \"lit\";\n\nimport styles from \"./element.css?lit\";\nimport { formatOutput } from \"./utils.js\";\n\n/** @import { VConsole } from \"./types.js\" */\n\n/** @implements {Partial<Console>} */\nclass VirtualConsole {\n #host;\n\n /** @param {MDNPlayConsole} host */\n constructor(host) {\n this.#host = host;\n }\n\n clear() {\n this.#host._messages = [];\n }\n\n /** @param {...any} args */\n debug(...args) {\n return this.log(...args);\n }\n\n /** @param {...any} args */\n error(...args) {\n return this.log(...args);\n }\n\n /** @param {...any} args */\n info(...args) {\n return this.log(...args);\n }\n\n /** @param {...any} args */\n log(...args) {\n if (args.length > 1 && typeof args[0] === \"string\") {\n // https://developer.mozilla.org/en-US/docs/Web/API/console#using_string_substitutions\n // TODO: add unit testing of this\n args[0] = args[0].replaceAll(\n /%(?:\\.([0-9]+))?(.)/g,\n (match, formatArg, format) => {\n switch (format) {\n case \"o\":\n case \"O\": {\n const O = args.splice(1, 1)[0];\n return formatOutput(O);\n }\n case \"d\":\n case \"i\": {\n const i = args.splice(1, 1)[0];\n return Math.trunc(i).toFixed(0).padStart(formatArg, \"0\");\n }\n case \"s\": {\n const s = args.splice(1, 1)[0];\n return s.toString();\n }\n case \"f\": {\n const f = args.splice(1, 1)[0];\n return (typeof f === \"number\" ? f : Number.parseFloat(f)).toFixed(\n formatArg ?? 6,\n );\n }\n case \"c\":\n // TODO: Not implemented yet, so just remove the argument\n args.splice(1, 1);\n return \"\";\n case \"%\":\n return \"%\";\n default:\n return match;\n }\n },\n );\n }\n this.#host._messages = [\n ...this.#host._messages,\n args.map((x) => formatOutput(x)).join(\" \"),\n ];\n }\n\n /** @param {...any} args */\n warn(...args) {\n return this.log(...args);\n }\n}\n\nexport class MDNPlayConsole extends LitElement {\n static properties = {\n _messages: { state: true },\n };\n\n static styles = styles;\n\n constructor() {\n super();\n this.vconsole = new VirtualConsole(this);\n /** @type {string[]} */\n this._messages = [];\n }\n\n /** @param {CustomEvent<VConsole>} e */\n onConsole({ detail }) {\n if (detail.prop in this.vconsole) {\n const prop = /** @type {keyof typeof this.vconsole} */ (detail.prop);\n detail.args ? this.vconsole[prop](...detail.args) : this.vconsole[prop]();\n } else {\n this.vconsole.warn(\n \"[Playground] Unsupported console message (see browser console)\",\n );\n }\n }\n\n render() {\n return html`\n <ul aria-live=\"polite\">\n ${this._messages.map(\n (message) => html`<li><code>${message}</code></li>`,\n )}\n </ul>\n `;\n }\n\n updated() {\n this.scrollTo({ top: this.scrollHeight });\n }\n}\n\ncustomElements.define(\"mdn-play-console\", MDNPlayConsole);\n"],"names":["Array","Object","String","JSON","VirtualConsole","Math","Number","MDNPlayConsole","s","customElements"],"mappings":"yLAII,EAA0B,A,SAA4B,KAE1D,EAAwB,IAAI,CAAC,CAAC,EAAO,EAAE,CAAE,0cAA2c,GAAG,EAEvf,MAAe,SAAI,CAAC,EAAwB,QAAQ,GAAG,C,2FCGhD,SAAS,EAAY,CAAK,EAC/B,IAAI,EAAS,GACb,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,MAAM,CAAE,EAAI,EAAG,IAAK,CAC5C,GAAI,AAAoB,UAApB,OAAO,CAAK,CAAC,EAAE,CACjB,GAAU,IAAM,CAAK,CAAC,EAAE,CAAG,SACtB,GAAIA,MAAM,OAAO,CAAC,CAAK,CAAC,EAAE,EAC/B,GAAU,UACV,GAAU,EAAY,CAAK,CAAC,EAAE,EAC9B,GAAU,SACL,GAAIC,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAO,GACrD,GAAU,EAAa,CAAK,CAAC,EAAE,MAC1B,CACL,IAAI,EAAa,EACjB,KAAO,EAAI,EAAI,GAAK,CAACA,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAO,EAAI,IACnE,IACA,IAEF,GACE,AAAe,IAAf,EAAmB,iBAAmB,CAAC,CAAC,EAAE,EAAW,aAAa,CAAC,AACvE,CAEI,EAAI,EAAM,MAAM,CAAG,GACrB,IAAU,IAAG,CAEjB,CACA,OAAO,CACT,CA8FO,SAAS,EAAa,CAAK,EAChC,GAAI,SAAyC,AAAiB,WAAjB,OAAO,EAClD,OAAOC,OAAO,GACT,GAAI,AAAiB,UAAjB,OAAO,SAEhB,AAAID,OAAO,EAAE,CAAC,EAAO,IACZ,KAEFC,OAAO,GACT,GAAI,AAAiB,UAAjB,OAAO,EAChB,OAAOA,OAAO,GAAS,IAClB,GAAI,AAAiB,UAAjB,OAAO,EAEhB,OAAO,EAAM,QAAQ,CAAC,KAAO,IAAM,EAAQ,IAAM,IAAM,EAAQ,IAC1D,GAAIF,MAAM,OAAO,CAAC,GAEvB,MAAO,UAAY,EAAY,GAAS,SAExC,OAAO,AApGJ,SAAsB,CAAK,EAKhC,IAAM,EAAa,EAAM,WAAW,CAAG,EAAM,WAAW,CAAC,IAAI,CAAG,EAEhE,GAAI,AAAe,WAAf,EAEF,MAAO,CAAC,UAAU,EAAE,EAAM,OAAO,GAAG,GAAG,CAAC,CAG1C,GAAI,IAAUG,KAEZ,MAAO,UAGT,GAAI,EAAW,KAAK,EAAI,AAhBK,6CAgBgB,IAAI,CAAC,GAChD,OAAO,EAAa,MAGtB,GAAI,EAAW,KAAK,EAAI,AAlBtB,kJAkByC,IAAI,CAAC,GAG9C,OAAO,AAFa,EAAM,MAAM,CAEX,EACjB,EAAa,KAAO,EAAY,GAAS,IACzC,EAAa,MAGnB,GAAI,AAAe,WAAf,GAA2B,AAAU,SAAV,EAC7B,OAAO,EAAM,QAAQ,GAGvB,GAAI,AAAe,WAAf,EAAyB,CAC3B,GAAI,GAAO,yBACT,OAAO,EAAM,wBAAwB,CAEvC,IAAI,EAAiB,GACjB,EAAQ,GACZ,IAAK,IAAM,KAAO,EACZF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAO,KAC1C,EACF,EAAQ,GAER,GAAkC,KAEpC,EAAiB,EAAiB,EAAM,KAAO,EAAa,CAAK,CAAC,EAAI,GAG1E,OAAO,EAAa,MAAQ,EAAiB,IAC/C,CAKA,GAAI,CAAC,EAAM,WAAW,EAAI,CAAC,EAAM,SAAS,CAAE,CAC1C,IAAI,EAAiB,GACjB,EAAQ,GACZ,IAAK,IAAM,KAAO,EACZ,EACF,EAAQ,GAER,GAAkC,KAEpC,EAAiB,EAAiB,EAAM,KAAO,EAAa,CAAK,CAAC,EAAI,EAExE,MAAO,YAAc,EAAiB,IACxC,CAEA,OAAO,CACT,EA8BwB,EAExB,CC/IA,IAAMG,eAAN,MAAMA,eACJ,EAAK,AAAC,AAGN,aAAY,CAAI,CAAE,CAChB,IAAI,CAAC,EAAK,CAAG,CACf,CAEA,OAAQ,CACN,IAAI,CAAC,EAAK,CAAC,SAAS,CAAG,EAAE,AAC3B,CAGA,MAAM,GAAG,CAAI,CAAE,CACb,OAAO,IAAI,CAAC,GAAG,IAAI,EACrB,CAGA,MAAM,GAAG,CAAI,CAAE,CACb,OAAO,IAAI,CAAC,GAAG,IAAI,EACrB,CAGA,KAAK,GAAG,CAAI,CAAE,CACZ,OAAO,IAAI,CAAC,GAAG,IAAI,EACrB,CAGA,IAAI,GAAG,CAAI,CAAE,CACP,EAAK,MAAM,CAAG,GAAK,AAAmB,UAAnB,OAAO,CAAI,CAAC,EAAE,EAGnC,EAAI,CAAC,EAAE,CAAG,CAAI,CAAC,EAAE,CAAC,UAAU,CAC1B,uBACA,CAAC,EAAO,EAAW,KACjB,OAAQ,GACN,IAAK,IACL,IAAK,IAEH,OAAO,EADG,EAAK,MAAM,CAAC,EAAG,EAAE,CAAC,EAAE,CAGhC,KAAK,IACL,IAAK,IAEH,OAAOC,KAAK,KAAK,CADP,EAAK,MAAM,CAAC,EAAG,EAAE,CAAC,EAAE,EACT,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAW,IAEtD,KAAK,IAEH,OAAO,AADG,EAAK,MAAM,CAAC,EAAG,EAAE,CAAC,EAAE,CACrB,QAAQ,EAEnB,KAAK,IAAK,CACR,IAAM,EAAI,EAAK,MAAM,CAAC,EAAG,EAAE,CAAC,EAAE,CAC9B,MAAO,AAAC,CAAa,UAAb,OAAO,EAAiB,EAAIC,OAAO,UAAU,CAAC,EAAC,EAAG,OAAO,CAC/D,GAAa,EAEjB,CACA,IAAK,IAGH,OADA,EAAK,MAAM,CAAC,EAAG,GACR,EACT,KAAK,IACH,MAAO,GACT,SACE,OAAO,CACX,CACF,EACF,EAEF,IAAI,CAAC,EAAK,CAAC,SAAS,CAAG,IAClB,IAAI,CAAC,EAAK,CAAC,SAAS,CACvB,EAAK,GAAG,CAAC,AAAC,GAAM,EAAa,IAAI,IAAI,CAAC,KACvC,AACH,CAGA,KAAK,GAAG,CAAI,CAAE,CACZ,OAAO,IAAI,CAAC,GAAG,IAAI,EACrB,CACF,EAEO,IAAMC,eAAN,MAAMA,uBAAuB,IAAU,CAC5C,OAAO,WAAa,CAClB,UAAW,CAAE,MAAO,EAAK,CAC3B,CAAE,AAEF,QAAO,OAASC,EAAA,CAAM,AAAC,AAEvB,cAAc,CACZ,KAAK,GACL,IAAI,CAAC,QAAQ,CAAG,IAAIJ,eAAe,IAAI,EAEvC,IAAI,CAAC,SAAS,CAAG,EAAE,AACrB,CAGA,UAAU,CAAE,QAAM,CAAE,CAAE,CACpB,GAAI,EAAO,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAE,CAChC,IAAM,EAAkD,EAAO,IAAI,AACnE,GAAO,IAAI,CAAG,IAAI,CAAC,QAAQ,CAAC,EAAK,IAAI,EAAO,IAAI,EAAI,IAAI,CAAC,QAAQ,CAAC,EAAK,EACzE,MACE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,iEAGN,CAEA,QAAS,CACP,MAAO,QAAI,CAAC;;QAER,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAClB,AAAC,GAAY,QAAI,CAAC,UAAU,EAAE,EAAQ,YAAY,CAAC,EACnD;;IAEN,CAAC,AACH,CAEA,SAAU,CACR,IAAI,CAAC,QAAQ,CAAC,CAAE,IAAK,IAAI,CAAC,YAAY,AAAC,EACzC,CACF,EAEAK,eAAe,MAAM,CAAC,mBAAoBF,e"}
@@ -1,2 +1,2 @@
1
- export const __rspack_esm_id="749";export const __rspack_esm_ids=["749"];export const __webpack_modules__={47404(e,t,n){n.d(t,{Ar:()=>a,Bc:()=>er,Gw:()=>K,OO:()=>ef,et:()=>l,wm:()=>X,yU:()=>eh});var o=n(6585),i=n(1371),r=n(15874);let CompletionContext=class CompletionContext{constructor(e,t,n,o){this.state=e,this.pos=t,this.explicit=n,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,r.mv)(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),i=o.search(h(e,!1));return i<0?null:{from:n+i,to:this.pos,text:o.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function s(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function l(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,o]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:o}of e){t[o[0]]=!0;for(let e=1;e<o.length;e++)n[o[e]]=!0}let o=s(t)+s(n)+"*$";return[RegExp("^"+o),new RegExp(o)]}(t);return e=>{let i=e.matchBefore(o);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function a(e,t){return n=>{for(let t=(0,r.mv)(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}let Option=class Option{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}};function c(e){return e.selection.main.from}function h(e,t){var n;let{source:o}=e,i=t&&"^"!=o[0],r="$"!=o[o.length-1];return i||r?RegExp(`${i?"^":""}(?:${o})${r?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let f=o.YH.define(),u=new WeakMap;function p(e){if(!Array.isArray(e))return e;let t=u.get(e);return t||u.set(e,t=l(e)),t}let d=o.Pe.define(),m=o.Pe.define();let FuzzyMatcher=class FuzzyMatcher{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=(0,o.vS)(e,t),i=(0,o.Fh)(n);this.chars.push(n);let r=e.slice(t,t+i),s=r.toUpperCase();this.folded.push((0,o.vS)(s==r?r.toLowerCase():s,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:s}=this;if(1==t.length){let i=(0,o.vS)(e,0),r=(0,o.Fh)(i),s=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;s+=-200}return this.ret(s,[0,r])}let l=e.indexOf(this.pattern);if(0==l)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,c=0;if(l<0){for(let r=0,s=Math.min(e.length,200);r<s&&c<a;){let s=(0,o.vS)(e,r);(s==t[c]||s==n[c])&&(i[c++]=r),r+=(0,o.Fh)(s)}if(c<a)return null}let h=0,f=0,u=!1,p=0,d=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let i=0,c=Math.min(e.length,200),y=0;i<c&&f<a;){let c=(0,o.vS)(e,i);l<0&&(h<a&&c==t[h]&&(r[h++]=i),p<a&&(c==t[p]||c==n[p]?(0==p&&(d=i),m=i+1,p++):p=0));let w,b=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(w=(0,o.MK)(c))!=w.toLowerCase()?1:2*(w!=w.toUpperCase());(!i||1==b&&g||0==y&&0!=b)&&(t[f]==c||n[f]==c&&(u=!0)?s[f++]=i:s.length&&(v=!1)),y=b,i+=(0,o.Fh)(c)}return f==a&&0==s[0]&&v?this.result(-100+(u?-200:0),s,e):p==a&&0==d?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[d,m]):f==a?this.result(-100+(u?-200:0)+-700+(v?0:-1100),s,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?(0,o.Fh)((0,o.vS)(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}};let StrictMatcher=class StrictMatcher{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}};let g=o.sj.define({combine:e=>(0,o.QR)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:y,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>v(e(n),t(n)),optionClass:(e,t)=>n=>v(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function v(e,t){return e?t?e+" "+t:e:t}function y(e,t,n,o,r,s){let l=e.textDirection==i.OP.RTL,a=l,c=!1,h="top",f,u,p=t.left-r.left,d=r.right-t.right,m=o.right-o.left,g=o.bottom-o.top;if(a&&p<Math.min(m,d)?a=!1:!a&&d<Math.min(m,p)&&(a=!0),m<=(a?p:d))f=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,u=Math.min(400,a?p:d);else{c=!0,u=Math.min(400,(l?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?f=n.bottom-t.top:(h="bottom",f=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${h}: ${f/v}px; max-width: ${u/y}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":a?"left":"right")}}function w(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}let CompletionTooltip=class CompletionTooltip{constructor(e,t,n){let o;this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:s}=i.open,l=e.state.facet(g);this.optionContent=(o=l.addToOptions.slice(),l.icons&&o.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),o.push({render(e,t,n,o){let i=document.createElement("span");i.className="cm-completionLabel";let r=e.displayLabel||e.label,s=0;for(let e=0;e<o.length;){let t=o[e++],n=o[e++];t>s&&i.appendChild(document.createTextNode(r.slice(s,t)));let l=i.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(r.slice(t,n))),l.className="cm-completionMatchedText",s=n}return s<r.length&&i.appendChild(document.createTextNode(r.slice(s))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),o.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=w(r.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:o}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<o.length){this.applyCompletion(e,o[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(g).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:m.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:i,selected:r,disabled:s}=n.open;o.open&&o.open.options==i||(this.range=w(i.length,r,e.state.facet(g).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),s!=(null==(t=o.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=w(t.options.length,t.selected,this.view.state.facet(g).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:o}=t.options[t.selected],{info:r}=o;if(!r)return;let s="string"==typeof r?document.createTextNode(r):r(o);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,o)}).catch(e=>(0,i.c_)(this.view.state,e,"completion info")):(this.addInfoPane(s,o),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let o,i,r,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,o=t.getBoundingClientRect(),i=n.getBoundingClientRect(),r=o.height/t.offsetHeight,i.top<o.top?t.scrollTop-=(o.top-i.top)/r:i.bottom>o.bottom&&(t.scrollTop+=(i.bottom-o.bottom)/r)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return o.top>Math.min(i.bottom,t.bottom)-10||o.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(g).positionInfo(this.view,t,o,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let o=document.createElement("ul");o.id=t,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",e=>{e.target==o&&e.preventDefault()});let i=null;for(let r=n.from;r<n.to;r++){let{completion:s,match:l}=e[r],{section:a}=s;if(a){let e="string"==typeof a?a:a.name;e!=i&&(r>n.from||0==n.from)&&(i=e,"string"!=typeof a&&a.header?o.appendChild(a.header(a)):o.appendChild(document.createElement("completion-section")).textContent=e)}let c=o.appendChild(document.createElement("li"));c.id=t+"-"+r,c.setAttribute("role","option");let h=this.optionClass(s);for(let e of(h&&(c.className=h),this.optionContent)){let t=e(s,this.view.state,this.view,l);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function b(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}let CompletionDialog=class CompletionDialog{constructor(e,t,n,o,i,r){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=i,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,k(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,i,r){if(o&&!r&&e.some(e=>e.isPending))return o.setDisabled();let s=function(e,t){let n=[],o=null,i=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some(t=>t.name==e)||o.push("string"==typeof t?{name:e}:t)}},s=t.facet(g);for(let o of e)if(o.hasResult()){let e=o.result.getMatch;if(!1===o.result.filter)for(let t of o.result.options)r(new Option(t,o.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(o.from,o.to),l,a=s.filterStrict?new StrictMatcher(n):new FuzzyMatcher(n);for(let t of o.result.options)if(l=a.match(t.label)){let n=t.displayLabel?e?e(t,l.matched):[]:l.matched,s=l.score+(t.boost||0);if(r(new Option(t,o.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(s,i[e]||-1e9)}}}}if(o){let e=Object.create(null),t=0;for(let n of o.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let l=[],a=null,c=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;a&&a.label==t.label&&a.detail==t.detail&&(null==a.type||null==t.type||a.type==t.type)&&a.apply==t.apply&&a.boost==t.boost?b(e.completion)>b(a)&&(l[l.length-1]=e):l.push(e),a=e.completion}return l}(e,t);if(!s.length)return o&&e.some(e=>e.isPending)?o.setDisabled():null;let l=t.facet(g).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){l=t;break}}return new CompletionDialog(s,k(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:I,above:i.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new CompletionDialog(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};let CompletionState=class CompletionState{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new CompletionState(S,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(g),o=(n.override||t.languageDataAt("autocomplete",c(t)).map(p)).map(t=>(this.active.find(e=>e.source==t)||new ActiveSource(t,+!!this.active.some(e=>0!=e.state))).update(e,n));o.length==this.active.length&&o.every((e,t)=>e==this.active[t])&&(o=this.active);let i=this.open,r=e.effects.some(e=>e.is(O));for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||o.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;o<t.length&&!t[o].hasResult();)o++;let i=n==e.length,r=o==t.length;if(i||r)return i==r;if(e[n++].result!=t[o++].result)return!1}}(o,this.active)||r?i=CompletionDialog.build(o,t,this.id,i,n,r):i&&i.disabled&&!o.some(e=>e.isPending)&&(i=null),!i&&o.every(e=>!e.isPending)&&o.some(e=>e.hasResult())&&(o=o.map(e=>e.hasResult()?new ActiveSource(e.source,0):e)),e.effects))s.is(D)&&(i=i&&i.setSelected(s.value,this.id));return o==this.active&&i==this.open?this:new CompletionState(o,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?A:x}};let A={"aria-autocomplete":"list"},x={};function k(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let S=[];function C(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(f);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}let ActiveSource=class ActiveSource{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=C(e,t),o=this;for(let t of((8&n||16&n&&this.touches(e))&&(o=new ActiveSource(o.source,0)),4&n&&0==o.state&&(o=new ActiveSource(this.source,1)),o=o.updateFor(e,n),e.effects))if(t.is(d))o=new ActiveSource(o.source,1,t.value);else if(t.is(m))o=new ActiveSource(o.source,0);else if(t.is(O))for(let e of t.value)e.source==o.source&&(o=e);return o}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(c(e.state))}};let ActiveResult=class ActiveResult extends ActiveSource{constructor(e,t,n,o,i,r){super(e,3,t),this.limit=n,this.result=o,this.from=i,this.to=r}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let i=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),s=c(e.state);if(s>r||!o||2&t&&(c(e.startState)==this.from||s<this.limit))return new ActiveSource(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return!function(e,t,n,o){if(!e)return!1;let i=t.sliceDoc(n,o);return"function"==typeof e?e(i,n,o,t):h(e,!0).test(i)}(o.validFor,e.state,i,r)?o.update&&(o=o.update(o,i,r,new CompletionContext(e.state,s,!1)))?new ActiveResult(this.source,this.explicit,l,o,o.from,null!=(n=o.to)?n:c(e.state)):new ActiveSource(this.source,1,this.explicit):new ActiveResult(this.source,this.explicit,l,o,i,r)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ActiveResult(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};let O=o.Pe.define({map:(e,t)=>e.map(e=>e.map(t))}),D=o.Pe.define(),M=o.sU.define({create:()=>CompletionState.start(),update:(e,t)=>e.update(t),provide:e=>[i.DK.from(e,e=>e.tooltip),i.Lz.contentAttributes.from(e,e=>e.attrs)]});function E(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(M).active.find(e=>e.source==t.source);return i instanceof ActiveResult&&("string"==typeof n?e.dispatch({...function(e,t,n,i){let{main:r}=e.selection,s=n-r.from,l=i-r.from;return{...e.changeByRange(a=>{if(a!=r&&n!=i&&e.sliceDoc(a.from+s,a.from+l)!=e.sliceDoc(n,i))return{range:a};let c=e.toText(t);return{changes:{from:a.from+s,to:i==r.from?a.to:a.from+l,insert:c},range:o.OF.cursor(a.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:f.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let I=e=>new CompletionTooltip(e,M,E);function F(e,t="option"){return n=>{let o=n.state.field(M,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp<n.state.facet(g).interactionDelay)return!1;let r=1,s;"page"==t&&(s=(0,i.Eg)(n,o.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=o.open.options,a=o.open.selected>-1?o.open.selected+r*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:D.of(a)}),!0}}let T=e=>!!e.state.field(M,!1)&&(e.dispatch({effects:d.of(!0)}),!0);let RunningQuery=class RunningQuery{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}};let R=i.Z9.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(M).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(M),n=e.state.facet(g);if(!e.selectionSet&&!e.docChanged&&e.startState.field(M)==t)return;let o=e.transactions.some(e=>{let t=C(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(o||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){(0,i.c_)(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(d)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(M);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=c(t),o=new CompletionContext(t,n,e.explicit,this.view),r=new RunningQuery(e,o);this.running.push(r),Promise.resolve(e.source(o)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:m.of(null)}),(0,i.c_)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(g),o=this.view.state.field(M);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(void 0===r.done)continue;if(this.running.splice(i--,1),r.done){let o=c(r.updates.length?r.updates[0].startState:this.view.state),i=Math.min(o,r.done.from+ +!r.active.explicit),s=new ActiveResult(r.active.source,r.active.explicit,i,r.done,r.done.from,null!=(e=r.done.to)?e:o);for(let e of r.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=o.active.find(e=>e.source==r.active.source);if(s&&s.isPending)if(null==r.done){let e=new ActiveSource(r.active.source,0);for(let t of r.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||o.open&&o.open.disabled)&&this.view.dispatch({effects:O.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(M,!1);if(t&&t.tooltip&&this.view.state.facet(g).closeOnBlur){let n=t.open&&(0,i.Eg)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:m.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:d.of(!1)}),20),this.composing=0}}}),B="object"==typeof navigator&&/Win/.test(navigator.platform),L=o.Nb.highest(i.Lz.domEventHandlers({keydown(e,t){let n=t.state.field(M,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(B&&e.altKey)||e.metaKey)return!1;let o=n.open.options[n.open.selected],i=n.active.find(e=>e.source==o.source),r=o.completion.commitCharacters||i.result.commitCharacters;return r&&r.indexOf(e.key)>-1&&E(t,o),!1}})),P=i.Lz.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});let FieldPos=class FieldPos{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}};let FieldRange=class FieldRange{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,o.iR.TrackDel),n=e.mapPos(this.to,1,o.iR.TrackDel);return null==t||null==n?null:new FieldRange(this.field,t,n)}};let Snippet=class Snippet{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],i=e.doc.lineAt(t),s=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=s,l=/^\t*/.exec(i)[0].length;for(let t=0;t<l;t++)n+=e.facet(r.Xt);o.push(t+n.length-l),i=n+i.slice(l)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new FieldRange(e.field,o[e.line]+e.from,o[e.line]+e.to))}}static parse(e){let t=[],n=[],o=[],i;for(let r of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(r);){let e=i[1]?+i[1]:null,s=i[2]||i[3]||"",l=-1,a=s.replace(/\\[{}]/g,e=>e[1]);for(let n=0;n<t.length;n++)(null!=e?t[n].seq==e:a&&t[n].name==a)&&(l=n);if(l<0){let n=0;for(;n<t.length&&(null==e||null!=t[n].seq&&t[n].seq<e);)n++;for(let i of(t.splice(n,0,{seq:e,name:a}),l=n,o))i.field>=l&&i.field++}for(let e of o)if(e.line==n.length&&e.from>i.index){let t=i[2]?3+(i[1]||"").length:2;e.from-=t,e.to-=t}o.push(new FieldPos(l,n.length,i.index,i.index+a.length)),r=r.slice(0,i.index)+s+r.slice(i.index+i[0].length)}r=r.replace(/\\([{}])/g,(e,t,i)=>{for(let e of o)e.line==n.length&&e.from>i&&(e.from--,e.to--);return t}),n.push(r)}return new Snippet(n,o)}};let H=i.NZ.widget({widget:new class extends i.xO{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),N=i.NZ.mark({class:"cm-snippetField"});let ActiveSnippet=class ActiveSnippet{constructor(e,t){this.ranges=e,this.active=t,this.deco=i.NZ.set(e.map(e=>(e.from==e.to?H:N).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new ActiveSnippet(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}};let U=o.Pe.define({map:(e,t)=>e&&e.map(t)}),z=o.Pe.define(),V=o.sU.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(U))return n.value;if(n.is(z)&&e)return new ActiveSnippet(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>i.Lz.decorations.from(e,e=>e?e.deco:i.NZ.none)});function $(e,t){return o.OF.create(e.filter(e=>e.field==t).map(e=>o.OF.range(e.from,e.to)))}function j(e){return({state:t,dispatch:n})=>{let o=t.field(V,!1);if(!o||e<0&&0==o.active)return!1;let i=o.active+e,r=e>0&&!o.ranges.some(t=>t.field==i+e);return n(t.update({selection:$(o.ranges,i),effects:U.of(r?null:new ActiveSnippet(o.ranges,i)),scrollIntoView:!0})),!0}}let J=[{key:"Tab",run:j(1),shift:j(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(V,!1)&&(t(e.update({effects:U.of(null)})),!0)}],_=o.sj.define({combine:e=>e.length?e[0]:J}),q=o.Nb.highest(i.w4.compute([_],e=>e.facet(_)));function K(e,t){let n;return{...t,apply:(n=Snippet.parse(e),(e,t,i,r)=>{let{text:s,ranges:l}=n.instantiate(e.state,i),{main:a}=e.state.selection,c={changes:{from:i,to:r==a.from?a.to:r,insert:o.EY.of(s)},scrollIntoView:!0,annotations:t?[f.of(t),o.ZX.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=$(l,0)),l.some(e=>e.field>0)){let t=new ActiveSnippet(l,0),n=c.effects=[U.of(t)];void 0===e.state.field(V,!1)&&n.push(o.Pe.appendConfig.of([V,q,W,P]))}e.dispatch(e.state.update(c))})}}let W=i.Lz.domEventHandlers({mousedown(e,t){let n=t.state.field(V,!1),o;if(!n||null==(o=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let i=n.ranges.find(e=>e.from<=o&&e.to>=o);return!!i&&i.field!=n.active&&(t.dispatch({selection:$(n.ranges,i.field),effects:U.of(n.ranges.some(e=>e.field>i.field)?new ActiveSnippet(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Y={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Z=o.Pe.define({map(e,t){let n=t.mapPos(e,-1,o.iR.TrackAfter);return null==n?void 0:n}}),G=new class extends o.FB{};G.startSide=1,G.endSide=-1;let Q=o.sU.define({create:()=>o.om.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Z)&&(e=e.update({add:[G.range(n.value,n.value+1)]}));return e}});function X(){return[ei,Q]}let ee="()[]{}<>\xab\xbb\xbb\xab[]{}";function et(e){for(let t=0;t<ee.length;t+=2)if(ee.charCodeAt(t)==e)return ee.charAt(t+1);return(0,o.MK)(e<128?e:e+1)}function en(e,t){return e.languageDataAt("closeBrackets",t)[0]||Y}let eo="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ei=i.Lz.inputHandler.of((e,t,n,i)=>{if((eo?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let s=e.state.selection.main;if(i.length>2||2==i.length&&1==(0,o.Fh)((0,o.vS)(i,0))||t!=s.from||n!=s.to)return!1;let l=function(e,t){let n=en(e,e.selection.main.head),i=n.brackets||Y.brackets;for(let s of i){let l=et((0,o.vS)(s,0));if(t==s)return l==s?function(e,t,n,i){let s=i.stringPrefixes||Y.stringPrefixes,l=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Z.of(i.to+t.length),range:o.OF.range(i.anchor+t.length,i.head+t.length)};let a=i.head,c=el(e.doc,a),h;if(c==t){if(ea(e,a))return{changes:{insert:t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};else if(es(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:o.OF.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(h=ec(e,a-2*t.length,s))>-1&&ea(e,h))return{changes:{insert:t+t+t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};else if(e.charCategorizer(a)(c)!=o.Je.Word&&ec(e,a,s)>-1&&!function(e,t,n,o){let i=(0,r.mv)(e).resolveInner(t,-1),s=o.reduce((e,t)=>Math.max(e,t.length),0);for(let r=0;r<5;r++){let r=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=r.indexOf(n);if(!l||l>-1&&o.indexOf(r.slice(0,l))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let a=i.to==t&&i.parent;if(!a)break;i=a}return!1}(e,a,t,s))return{changes:{insert:t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};return{range:l=i}});return l?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,s,i.indexOf(s+s+s)>-1,n):function(e,t,n,i){let r=null,s=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:Z.of(s.to+t.length),range:o.OF.range(s.anchor+t.length,s.head+t.length)};let l=el(e.doc,s.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:s.head},effects:Z.of(s.head+t.length),range:o.OF.cursor(s.head+t.length)}:{range:r=s}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,s,l,n.before||Y.before);if(t==l&&es(e,e.selection.main.from))return function(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&el(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:o.OF.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,l)}return null}(e.state,i);return!!l&&(e.dispatch(l),!0)}),er=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=en(e,e.selection.main.head).brackets||Y.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,s;let i,l=(r=e.doc,s=t.head,i=r.sliceString(s-2,s),(0,o.Fh)((0,o.vS)(i,0))==i.length?i:i.slice(1));for(let i of n)if(i==l&&el(e.doc,t.head)==et((0,o.vS)(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:o.OF.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function es(e,t){let n=!1;return e.field(Q).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function el(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,o.Fh)((0,o.vS)(n,0)))}function ea(e,t){let n=(0,r.mv)(e).resolveInner(t+1);return n.parent&&n.from==t}function ec(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=o.Je.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=o.Je.Word)return n}return -1}function eh(e={}){return[L,M,g.of(e),R,eu,P]}let ef=[{key:"Ctrl-Space",run:T},{mac:"Alt-`",run:T},{mac:"Alt-i",run:T},{key:"Escape",run:e=>{let t=e.state.field(M,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:m.of(null)}),!0)}},{key:"ArrowDown",run:F(!0)},{key:"ArrowUp",run:F(!1)},{key:"PageDown",run:F(!0,"page")},{key:"PageUp",run:F(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(M,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(g).interactionDelay)&&E(e,t.open.options[t.open.selected])}}],eu=o.Nb.highest(i.w4.computeN([g],e=>e.facet(g).defaultKeymap?[ef]:[]))},45230(e,t,n){n.d(t,{Yc:()=>eE,b6:()=>y,cL:()=>I,pw:()=>eM});var o=n(6585),i=n(1371),r=n(15874),s=n(90365);function l(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(o(n.update(i)),!0)}}let a=l(function(e,t,n=t.selection.ranges){let o=[],i=-1;for(let{from:e,to:r}of n){let n=o.length,s=1e9,l=f(t,e).line;if(l){for(let n=e;n<=r;){let a=t.doc.lineAt(n);if(a.from>i&&(e==r||r>a.from)){i=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<s&&(s=e),o.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(s<1e9)for(let e=n;e<o.length;e++)o[e].indent<o[e].line.text.length&&(o[e].indent=s);o.length==n+1&&(o[n].single=!0)}}if(2!=e&&o.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:r,single:s}of o)(s||!r)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of o)if(n>=0){let o=t.from+n,r=o+i.length;" "==t.text[r-t.from]&&r++,e.push({from:o,to:r})}return{changes:e}}return null},0),c=l(u,0),h=l((e,t)=>u(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),i=n.to<=o.to?o:e.doc.lineAt(n.to);i.from>o.from&&i.from==n.to&&(i=n.to==o.to+1?o:e.doc.lineAt(n.to-1));let r=t.length-1;r>=0&&t[r].to>o.from?t[r].to=i.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:i.to})}return t}(t)),0);function f(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function u(e,t,n=t.selection.ranges){let o=n.map(e=>f(t,e.from).block);if(!o.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},o,i){let r,s,l=e.sliceDoc(o-50,o),a=e.sliceDoc(i,i+50),c=/\s*$/.exec(l)[0].length,h=/^\s*/.exec(a)[0].length,f=l.length-c;if(l.slice(f-t.length,f)==t&&a.slice(h,h+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:i+h,margin:h&&1}};i-o<=100?r=s=e.sliceDoc(o,i):(r=e.sliceDoc(o,o+50),s=e.sliceDoc(i-50,i));let u=/^\s*/.exec(r)[0].length,p=/\s*$/.exec(s)[0].length,d=s.length-p-n.length;return r.slice(u,u+t.length)==t&&s.slice(d,d+n.length)==n?{open:{pos:o+u+t.length,margin:+!!/\s/.test(r.charAt(u+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(s.charAt(d-1))}}:null})(t,o[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=o[t],{open:r,close:s}=n;e.push({from:r.pos-i.open.length,to:r.pos+r.margin},{from:s.pos-s.margin,to:s.pos+i.close.length})}return{changes:e}}return null}let p=o.YH.define(),d=o.YH.define(),m=o.sj.define(),g=o.sj.define({combine:e=>(0,o.QR)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),v=o.sU.define({create:()=>HistoryState.empty,update(e,t){let n=t.state.facet(g),i=t.annotation(p);if(i){let o=HistEvent.fromTransaction(t,i.selection),r=i.side,s=0==r?e.undone:e.done;return s=o?S(s,s.length,n.minDepth,o):D(s,t.startState.selection),new HistoryState(0==r?i.rest:s,0==r?s:i.rest)}let r=t.annotation(d);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(o.ZX.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=HistEvent.fromTransaction(t),l=t.annotation(o.ZX.time),a=t.annotation(o.ZX.userEvent);return s?e=e.addChanges(s,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new HistoryState(e.done.map(HistEvent.fromJSON),e.undone.map(HistEvent.fromJSON))});function y(e={}){return[v,g.of(e),i.Lz.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?b:"historyRedo"==e.inputType?A:null;return!!n&&(e.preventDefault(),n(t))}})]}function w(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let i=n.field(v,!1);if(!i)return!1;let r=i.pop(e,n,t);return!!r&&(o(r),!0)}}let b=w(0,!1),A=w(1,!1),x=w(0,!0),k=w(1,!0);let HistEvent=class HistEvent{constructor(e,t,n,o,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=i}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&o.VR.fromJSON(e.changes),[],e.mapped&&o.Gu.fromJSON(e.mapped),e.startSelection&&o.OF.fromJSON(e.startSelection),e.selectionsAfter.map(o.OF.fromJSON))}static fromTransaction(e,t){let n=O;for(let t of e.startState.facet(m)){let o=t(e);o.length&&(n=n.concat(o))}return!n.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,O)}static selection(e){return new HistEvent(void 0,O,void 0,void 0,e)}};function S(e,t,n,o){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(o),i}function C(e,t){return e.length?t.length?e.concat(t):e:t}let O=[];function D(e,t){if(!e.length)return[HistEvent.selection([t])];{let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),S(e,e.length-1,1e9,n.setSelAfter(o)))}}function M(e,t){if(!e.length)return e;let n=e.length,i=O;for(;n;){let r=function(e,t,n){let i=C(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):O,n);if(!e.changes)return HistEvent.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(s):s;return new HistEvent(r,o.Pe.mapEffects(e.effects,t),l,e.startSelection.map(s),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[HistEvent.selection(i)]:O}let E=/^(input\.type|delete)($|\.)/;let HistoryState=class HistoryState{constructor(e,t,n=0,o){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,t,n,i,r){var s,l;let a,c,h=this.done,f=h[h.length-1];return new HistoryState(h=f&&f.changes&&!f.changes.empty&&e.changes&&(!n||E.test(n))&&(!f.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(s=f.changes,l=e.changes,a=[],c=!1,s.iterChangedRanges((e,t)=>a.push(e,t)),l.iterChangedRanges((e,t,n,o)=>{for(let e=0;e<a.length;){let t=a[e++],i=a[e++];o>=t&&n<=i&&(c=!0)}}),c))||"input.type.compose"==n)?S(h,h.length-1,i.minDepth,new HistEvent(e.changes.compose(f.changes),C(o.Pe.mapEffects(e.effects,f.changes),f.effects),f.mapped,f.startSelection,O)):S(h,h.length,i.minDepth,e),O,t,n)}addSelection(e,t,n,o){var i;let r=this.done.length?this.done[this.done.length-1].selectionsAfter:O;return r.length>0&&t-this.prevTime<o&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=r[r.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new HistoryState(D(this.done,e),this.undone,t,n)}addMapping(e){return new HistoryState(M(this.done,e),M(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let i=o[o.length-1],r=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,s;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:p.of({side:e,rest:(n=o[o.length-1],(s=o.slice())[o.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:r}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==o.length?O:o.slice(0,o.length-1);return i.mapped&&(n=M(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:p.of({side:e,rest:n,selection:r}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}};HistoryState.empty=new HistoryState(O,O);let I=[{key:"Mod-z",run:b,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:A,preventDefault:!0},{linux:"Ctrl-Shift-z",run:A,preventDefault:!0},{key:"Mod-u",run:x,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:k,preventDefault:!0}];function F(e,t){return o.OF.create(e.ranges.map(t),e.mainIndex)}function T(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function R({state:e,dispatch:t},n){let o=F(e.selection,n);return!o.eq(e.selection,!0)&&(t(T(e,o)),!0)}function B(e,t){return o.OF.cursor(t?e.to:e.from)}function L(e,t){return R(e,n=>n.empty?e.moveByChar(n,t):B(n,t))}function P(e){return e.textDirectionAt(e.state.selection.main.head)==i.OP.LTR}let H=e=>L(e,!P(e)),N=e=>L(e,P(e));function U(e,t){return R(e,n=>n.empty?e.moveByGroup(n,t):B(n,t))}function z(e,t,n){let i,l,a=(0,r.mv)(e).resolveInner(t.head),c=n?s.uY.closedBy:s.uY.openedBy;for(let o=t.head;;){let t=n?a.childAfter(o):a.childBefore(o);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,c)?o=n?t.to:t.from:a=t}return l=a.type.prop(c)&&(i=n?(0,r.jU)(e,a.from,1):(0,r.jU)(e,a.to,-1))&&i.matched?n?i.end.to:i.end.from:n?a.to:a.from,o.OF.cursor(l,n?-1:1)}function V(e,t){return R(e,n=>{if(!n.empty)return B(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let $=e=>V(e,!1),j=e=>V(e,!0);function J(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,o=0,r;if(t){for(let t of e.state.facet(i.Lz.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(o=Math.max(null==i?void 0:i.bottom,o))}r=e.scrollDOM.clientHeight-n-o}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function _(e,t){let n,o=J(e),{state:r}=e,s=F(r.selection,n=>n.empty?e.moveVertically(n,t,o.height):B(n,t));if(s.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,c=l.bottom-o.marginBottom;t&&t.top>a&&t.bottom<c&&(n=i.Lz.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(T(r,s),{effects:n}),!0}let q=e=>_(e,!1),K=e=>_(e,!0);function W(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=o.OF.cursor(i.from+n))}return r}function Y(e,t){let n=F(e.state.selection,e=>{let n=t(e);return o.OF.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(T(e.state,n)),!0)}function Z(e,t){return Y(e,n=>e.moveByChar(n,t))}let G=e=>Z(e,!P(e)),Q=e=>Z(e,P(e));function X(e,t){return Y(e,n=>e.moveByGroup(n,t))}function ee(e,t){return Y(e,n=>e.moveVertically(n,t))}let et=e=>ee(e,!1),en=e=>ee(e,!0);function eo(e,t){return Y(e,n=>e.moveVertically(n,t,J(e).height))}let ei=e=>eo(e,!1),er=e=>eo(e,!0),es=({state:e,dispatch:t})=>(t(T(e,{anchor:0})),!0),el=({state:e,dispatch:t})=>(t(T(e,{anchor:e.doc.length})),!0),ea=({state:e,dispatch:t})=>(t(T(e,{anchor:e.selection.main.anchor,head:0})),!0),ec=({state:e,dispatch:t})=>(t(T(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function eh(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let o of n.selection.ranges){let i=n.doc.lineAt(o.head);if(t?i.to<e.state.doc.length:i.from>0)for(let n=o;;){let o=e.moveVertically(n,t);if(o.head<i.from||o.head>i.to){r.some(e=>e.head==o.head)||r.push(o);break}if(o.head==n.head)break;n=o}}return r.length!=i.ranges.length&&(e.dispatch(T(n,o.OF.create(r,r.length-1))),!0)}function ef(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let o=t(i);o<r?(n="delete.backward",o=eu(e,o,!1)):o>r&&(n="delete.forward",o=eu(e,o,!0)),r=Math.min(r,o),s=Math.max(s,o)}else r=eu(e,r,!1),s=eu(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.OF.cursor(r,r<i.head?-1:1)}});return!s.changes.empty&&(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?i.Lz.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function eu(e,t,n){if(e instanceof i.Lz)for(let o of e.state.facet(i.Lz.atomicRanges).map(t=>t(e)))o.between(t,t,(e,o)=>{e<t&&o>t&&(t=n?o:e)});return t}let ep=(e,t,n)=>ef(e,i=>{let s=i.from,{state:l}=e,a=l.doc.lineAt(s),c,h;if(n&&!t&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,s-a.from))){if(" "==c[c.length-1])return s-1;let e=(0,o.y$)(c,l.tabSize)%(0,r.tp)(l)||(0,r.tp)(l);for(let t=0;t<e&&" "==c[c.length-1-t];t++)s--;h=s}else(h=(0,o.zK)(a.text,s-a.from,t,t)+a.from)==s&&a.number!=(t?l.doc.lines:1)?h+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(h-a.from,s-a.from))&&(h=(0,o.zK)(a.text,h-a.from,!1,!1)+a.from);return h}),ed=e=>ep(e,!1,!0),em=e=>ep(e,!0,!1),eg=(e,t)=>ef(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let a=(0,o.zK)(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(null!=e&&h!=e)break;(" "!=c||i!=n.head)&&(e=h),i=a}return i}),ev=e=>eg(e,!1);function ey(e){let t=[],n=-1;for(let o of e.selection.ranges){let i=e.doc.lineAt(o.from),r=e.doc.lineAt(o.to);if(o.empty||o.to!=r.from||(r=e.doc.lineAt(o.to-1)),n>=i.number){let e=t[t.length-1];e.to=r.to,e.ranges.push(o)}else t.push({from:i.from,to:r.to,ranges:[o]});n=r.number+1}return t}function ew(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of ey(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),l=s.length+1;if(n)for(let n of(i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))r.push(o.OF.range(Math.min(e.doc.length,n.anchor+l),Math.min(e.doc.length,n.head+l)));else for(let n of(i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))r.push(o.OF.range(n.anchor-l,n.head-l))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.OF.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function eb(e,t,n){if(e.readOnly)return!1;let o=[];for(let t of ey(e))n?o.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):o.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(o);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let eA=ek(!1),ex=ek(!0);function ek(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:l}=n,a=t.doc.lineAt(i),c=!e&&i==l&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,r.mv)(e).resolveInner(t),o=n.childBefore(t),i=n.childAfter(t),l;return o&&i&&o.to<=t&&i.from>=t&&(l=o.type.prop(s.uY.closedBy))&&l.indexOf(i.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(o.to,i.from))?{from:o.to,to:i.from}:null}(t,i);e&&(i=l=(l<=a.to?a:t.doc.lineAt(l)).to);let h=new r.KB(t,{simulateBreak:i,simulateDoubleBreak:!!c}),f=(0,r._v)(h,i);for(null==f&&(f=(0,o.y$)(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));l<a.to&&/\s/.test(a.text[l-a.from]);)l++;c?{from:i,to:l}=c:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let u=["",(0,r.EI)(t,f)];return c&&u.push((0,r.EI)(t,h.lineIndent(a.from,-1))),{changes:{from:i,to:l,insert:o.EY.of(u)},range:o.OF.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function eS(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let s=e.changes(r);return{changes:r,range:o.OF.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}let eC=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eS(e,(t,n)=>{n.push({from:t.from,insert:e.facet(r.Xt)})}),{userEvent:"input.indent"})),!0),eO=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eS(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=(0,o.y$)(i,e.tabSize),l=0,a=(0,r.EI)(e,Math.max(0,s-(0,r.tp)(e)));for(;l<i.length&&l<a.length&&i.charCodeAt(l)==a.charCodeAt(l);)l++;n.push({from:t.from+l,to:t.from+i.length,insert:a.slice(l)})}),{userEvent:"delete.dedent"})),!0),eD=[{key:"Ctrl-b",run:H,shift:G,preventDefault:!0},{key:"Ctrl-f",run:N,shift:Q},{key:"Ctrl-p",run:$,shift:et},{key:"Ctrl-n",run:j,shift:en},{key:"Ctrl-a",run:e=>R(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Y(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>R(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Y(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:em},{key:"Ctrl-h",run:ed},{key:"Ctrl-k",run:e=>ef(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:ev},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.EY.of(["",""])},range:o.OF.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.zK)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.zK)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.OF.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:K}],eM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>R(e,t=>z(e.state,t,!P(e))),shift:e=>Y(e,t=>z(e.state,t,!P(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>R(e,t=>z(e.state,t,P(e))),shift:e=>Y(e,t=>z(e.state,t,P(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>ew(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>eb(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>ew(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>eb(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>eh(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>eh(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.OF.create([n.main]):n.main.empty||(i=o.OF.create([o.OF.cursor(n.main.head)])),!!i&&(t(T(e,i)),!0)}},{key:"Mod-Enter",run:ex},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=ey(e).map(({from:t,to:n})=>o.OF.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.OF.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=F(e.selection,t=>{let n=(0,r.mv)(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return o.OF.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(T(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:eO},{key:"Mod-]",run:eC},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new r.KB(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=eS(e,(t,i,s)=>{let l=(0,r._v)(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],c=(0,r.EI)(e,l);(a!=c||s.from<t.from+a.length)&&(n[t.from]=l,i.push({from:t.from,to:t.from+a.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ey(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),o=F(t.selection,t=>{let n;if(e.lineWrapping){let o=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=o.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=F(e.selection,t=>{let i=(0,r.jU)(e,t.head,-1)||(0,r.jU)(e,t.head,1)||t.head>0&&(0,r.jU)(e,t.head-1,1)||t.head<e.doc.length&&(0,r.jU)(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let s=i.start.from==t.head?i.end.to:i.end.from;return o.OF.cursor(s)}),!!n&&(t(T(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=f(e.state,n.from);return o.line?a(e):!!o.block&&h(e)}},{key:"Alt-A",run:c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:H,shift:G,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>U(e,!P(e)),shift:e=>X(e,!P(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>R(e,t=>W(e,t,!P(e))),shift:e=>Y(e,t=>W(e,t,!P(e))),preventDefault:!0},{key:"ArrowRight",run:N,shift:Q,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>U(e,P(e)),shift:e=>X(e,P(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>R(e,t=>W(e,t,P(e))),shift:e=>Y(e,t=>W(e,t,P(e))),preventDefault:!0},{key:"ArrowUp",run:$,shift:et,preventDefault:!0},{mac:"Cmd-ArrowUp",run:es,shift:ea},{mac:"Ctrl-ArrowUp",run:q,shift:ei},{key:"ArrowDown",run:j,shift:en,preventDefault:!0},{mac:"Cmd-ArrowDown",run:el,shift:ec},{mac:"Ctrl-ArrowDown",run:K,shift:er},{key:"PageUp",run:q,shift:ei},{key:"PageDown",run:K,shift:er},{key:"Home",run:e=>R(e,t=>W(e,t,!1)),shift:e=>Y(e,t=>W(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:es,shift:ea},{key:"End",run:e=>R(e,t=>W(e,t,!0)),shift:e=>Y(e,t=>W(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:el,shift:ec},{key:"Enter",run:eA,shift:eA},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ed,shift:ed,preventDefault:!0},{key:"Delete",run:em,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ev,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>eg(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>ef(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>ef(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(eD.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),eE={key:"Tab",run:eC,shift:eO}},6363(e,t,n){n.d(t,{V0:()=>s});var o=n(1371),i=n(15874),r=n(45230);let s=[(0,o.N$)(),(0,r.b6)(),(0,o.VH)(),(0,i.y9)(i.Zt,{fallback:!0}),o.w4.of([...r.pw,...r.cL])]}};
2
- //# sourceMappingURL=749.f46b8d04d93e42db.js.map
1
+ export const __rspack_esm_id="749";export const __rspack_esm_ids=["749"];export const __webpack_modules__={47404(e,t,n){n.d(t,{Ar:()=>a,Bc:()=>er,Gw:()=>K,OO:()=>ef,et:()=>l,wm:()=>X,yU:()=>eh});var o=n(6585),i=n(1371),r=n(15874);let CompletionContext=class CompletionContext{constructor(e,t,n,o){this.state=e,this.pos=t,this.explicit=n,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,r.mv)(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),i=o.search(h(e,!1));return i<0?null:{from:n+i,to:this.pos,text:o.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function s(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function l(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,o]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:o}of e){t[o[0]]=!0;for(let e=1;e<o.length;e++)n[o[e]]=!0}let o=s(t)+s(n)+"*$";return[RegExp("^"+o),new RegExp(o)]}(t);return e=>{let i=e.matchBefore(o);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function a(e,t){return n=>{for(let t=(0,r.mv)(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}let Option=class Option{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}};function c(e){return e.selection.main.from}function h(e,t){var n;let{source:o}=e,i=t&&"^"!=o[0],r="$"!=o[o.length-1];return i||r?RegExp(`${i?"^":""}(?:${o})${r?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let f=o.YH.define(),u=new WeakMap;function p(e){if(!Array.isArray(e))return e;let t=u.get(e);return t||u.set(e,t=l(e)),t}let d=o.Pe.define(),m=o.Pe.define();let FuzzyMatcher=class FuzzyMatcher{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=(0,o.vS)(e,t),i=(0,o.Fh)(n);this.chars.push(n);let r=e.slice(t,t+i),s=r.toUpperCase();this.folded.push((0,o.vS)(s==r?r.toLowerCase():s,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:s}=this;if(1==t.length){let i=(0,o.vS)(e,0),r=(0,o.Fh)(i),s=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;s+=-200}return this.ret(s,[0,r])}let l=e.indexOf(this.pattern);if(0==l)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,c=0;if(l<0){for(let r=0,s=Math.min(e.length,200);r<s&&c<a;){let s=(0,o.vS)(e,r);(s==t[c]||s==n[c])&&(i[c++]=r),r+=(0,o.Fh)(s)}if(c<a)return null}let h=0,f=0,u=!1,p=0,d=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let i=0,c=Math.min(e.length,200),y=0;i<c&&f<a;){let c=(0,o.vS)(e,i);l<0&&(h<a&&c==t[h]&&(r[h++]=i),p<a&&(c==t[p]||c==n[p]?(0==p&&(d=i),m=i+1,p++):p=0));let w,b=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(w=(0,o.MK)(c))!=w.toLowerCase()?1:2*(w!=w.toUpperCase());(!i||1==b&&g||0==y&&0!=b)&&(t[f]==c||n[f]==c&&(u=!0)?s[f++]=i:s.length&&(v=!1)),y=b,i+=(0,o.Fh)(c)}return f==a&&0==s[0]&&v?this.result(-100+(u?-200:0),s,e):p==a&&0==d?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[d,m]):f==a?this.result(-100+(u?-200:0)+-700+(v?0:-1100),s,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?(0,o.Fh)((0,o.vS)(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}};let StrictMatcher=class StrictMatcher{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}};let g=o.sj.define({combine:e=>(0,o.QR)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:y,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>v(e(n),t(n)),optionClass:(e,t)=>n=>v(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function v(e,t){return e?t?e+" "+t:e:t}function y(e,t,n,o,r,s){let l=e.textDirection==i.OP.RTL,a=l,c=!1,h="top",f,u,p=t.left-r.left,d=r.right-t.right,m=o.right-o.left,g=o.bottom-o.top;if(a&&p<Math.min(m,d)?a=!1:!a&&d<Math.min(m,p)&&(a=!0),m<=(a?p:d))f=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,u=Math.min(400,a?p:d);else{c=!0,u=Math.min(400,(l?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?f=n.bottom-t.top:(h="bottom",f=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${h}: ${f/v}px; max-width: ${u/y}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":a?"left":"right")}}function w(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}let CompletionTooltip=class CompletionTooltip{constructor(e,t,n){let o;this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:s}=i.open,l=e.state.facet(g);this.optionContent=(o=l.addToOptions.slice(),l.icons&&o.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),o.push({render(e,t,n,o){let i=document.createElement("span");i.className="cm-completionLabel";let r=e.displayLabel||e.label,s=0;for(let e=0;e<o.length;){let t=o[e++],n=o[e++];t>s&&i.appendChild(document.createTextNode(r.slice(s,t)));let l=i.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(r.slice(t,n))),l.className="cm-completionMatchedText",s=n}return s<r.length&&i.appendChild(document.createTextNode(r.slice(s))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),o.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=w(r.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:o}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<o.length){this.applyCompletion(e,o[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(g).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:m.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:i,selected:r,disabled:s}=n.open;o.open&&o.open.options==i||(this.range=w(i.length,r,e.state.facet(g).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),s!=(null==(t=o.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=w(t.options.length,t.selected,this.view.state.facet(g).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:o}=t.options[t.selected],{info:r}=o;if(!r)return;let s="string"==typeof r?document.createTextNode(r):r(o);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,o)}).catch(e=>(0,i.c_)(this.view.state,e,"completion info")):(this.addInfoPane(s,o),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let o,i,r,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,o=t.getBoundingClientRect(),i=n.getBoundingClientRect(),r=o.height/t.offsetHeight,i.top<o.top?t.scrollTop-=(o.top-i.top)/r:i.bottom>o.bottom&&(t.scrollTop+=(i.bottom-o.bottom)/r)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return o.top>Math.min(i.bottom,t.bottom)-10||o.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(g).positionInfo(this.view,t,o,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let o=document.createElement("ul");o.id=t,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",e=>{e.target==o&&e.preventDefault()});let i=null;for(let r=n.from;r<n.to;r++){let{completion:s,match:l}=e[r],{section:a}=s;if(a){let e="string"==typeof a?a:a.name;e!=i&&(r>n.from||0==n.from)&&(i=e,"string"!=typeof a&&a.header?o.appendChild(a.header(a)):o.appendChild(document.createElement("completion-section")).textContent=e)}let c=o.appendChild(document.createElement("li"));c.id=t+"-"+r,c.setAttribute("role","option");let h=this.optionClass(s);for(let e of(h&&(c.className=h),this.optionContent)){let t=e(s,this.view.state,this.view,l);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function b(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}let CompletionDialog=class CompletionDialog{constructor(e,t,n,o,i,r){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=i,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,k(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,i,r){if(o&&!r&&e.some(e=>e.isPending))return o.setDisabled();let s=function(e,t){let n=[],o=null,i=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some(t=>t.name==e)||o.push("string"==typeof t?{name:e}:t)}},s=t.facet(g);for(let o of e)if(o.hasResult()){let e=o.result.getMatch;if(!1===o.result.filter)for(let t of o.result.options)r(new Option(t,o.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(o.from,o.to),l,a=s.filterStrict?new StrictMatcher(n):new FuzzyMatcher(n);for(let t of o.result.options)if(l=a.match(t.label)){let n=t.displayLabel?e?e(t,l.matched):[]:l.matched,s=l.score+(t.boost||0);if(r(new Option(t,o.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(s,i[e]||-1e9)}}}}if(o){let e=Object.create(null),t=0;for(let n of o.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let l=[],a=null,c=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;a&&a.label==t.label&&a.detail==t.detail&&(null==a.type||null==t.type||a.type==t.type)&&a.apply==t.apply&&a.boost==t.boost?b(e.completion)>b(a)&&(l[l.length-1]=e):l.push(e),a=e.completion}return l}(e,t);if(!s.length)return o&&e.some(e=>e.isPending)?o.setDisabled():null;let l=t.facet(g).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){l=t;break}}return new CompletionDialog(s,k(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:I,above:i.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new CompletionDialog(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};let CompletionState=class CompletionState{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new CompletionState(S,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(g),o=(n.override||t.languageDataAt("autocomplete",c(t)).map(p)).map(t=>(this.active.find(e=>e.source==t)||new ActiveSource(t,+!!this.active.some(e=>0!=e.state))).update(e,n));o.length==this.active.length&&o.every((e,t)=>e==this.active[t])&&(o=this.active);let i=this.open,r=e.effects.some(e=>e.is(O));for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||o.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;o<t.length&&!t[o].hasResult();)o++;let i=n==e.length,r=o==t.length;if(i||r)return i==r;if(e[n++].result!=t[o++].result)return!1}}(o,this.active)||r?i=CompletionDialog.build(o,t,this.id,i,n,r):i&&i.disabled&&!o.some(e=>e.isPending)&&(i=null),!i&&o.every(e=>!e.isPending)&&o.some(e=>e.hasResult())&&(o=o.map(e=>e.hasResult()?new ActiveSource(e.source,0):e)),e.effects))s.is(D)&&(i=i&&i.setSelected(s.value,this.id));return o==this.active&&i==this.open?this:new CompletionState(o,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?A:x}};let A={"aria-autocomplete":"list"},x={};function k(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let S=[];function C(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(f);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}let ActiveSource=class ActiveSource{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=C(e,t),o=this;for(let t of((8&n||16&n&&this.touches(e))&&(o=new ActiveSource(o.source,0)),4&n&&0==o.state&&(o=new ActiveSource(this.source,1)),o=o.updateFor(e,n),e.effects))if(t.is(d))o=new ActiveSource(o.source,1,t.value);else if(t.is(m))o=new ActiveSource(o.source,0);else if(t.is(O))for(let e of t.value)e.source==o.source&&(o=e);return o}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(c(e.state))}};let ActiveResult=class ActiveResult extends ActiveSource{constructor(e,t,n,o,i,r){super(e,3,t),this.limit=n,this.result=o,this.from=i,this.to=r}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let i=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),s=c(e.state);if(s>r||!o||2&t&&(c(e.startState)==this.from||s<this.limit))return new ActiveSource(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return!function(e,t,n,o){if(!e)return!1;let i=t.sliceDoc(n,o);return"function"==typeof e?e(i,n,o,t):h(e,!0).test(i)}(o.validFor,e.state,i,r)?o.update&&(o=o.update(o,i,r,new CompletionContext(e.state,s,!1)))?new ActiveResult(this.source,this.explicit,l,o,o.from,null!=(n=o.to)?n:c(e.state)):new ActiveSource(this.source,1,this.explicit):new ActiveResult(this.source,this.explicit,l,o,i,r)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ActiveResult(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};let O=o.Pe.define({map:(e,t)=>e.map(e=>e.map(t))}),D=o.Pe.define(),M=o.sU.define({create:()=>CompletionState.start(),update:(e,t)=>e.update(t),provide:e=>[i.DK.from(e,e=>e.tooltip),i.Lz.contentAttributes.from(e,e=>e.attrs)]});function E(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(M).active.find(e=>e.source==t.source);return i instanceof ActiveResult&&("string"==typeof n?e.dispatch({...function(e,t,n,i){let{main:r}=e.selection,s=n-r.from,l=i-r.from;return{...e.changeByRange(a=>{if(a!=r&&n!=i&&e.sliceDoc(a.from+s,a.from+l)!=e.sliceDoc(n,i))return{range:a};let c=e.toText(t);return{changes:{from:a.from+s,to:i==r.from?a.to:a.from+l,insert:c},range:o.OF.cursor(a.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:f.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let I=e=>new CompletionTooltip(e,M,E);function F(e,t="option"){return n=>{let o=n.state.field(M,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp<n.state.facet(g).interactionDelay)return!1;let r=1,s;"page"==t&&(s=(0,i.Eg)(n,o.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=o.open.options,a=o.open.selected>-1?o.open.selected+r*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:D.of(a)}),!0}}let T=e=>!!e.state.field(M,!1)&&(e.dispatch({effects:d.of(!0)}),!0);let RunningQuery=class RunningQuery{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}};let R=i.Z9.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(M).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(M),n=e.state.facet(g);if(!e.selectionSet&&!e.docChanged&&e.startState.field(M)==t)return;let o=e.transactions.some(e=>{let t=C(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(o||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){(0,i.c_)(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(d)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(M);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=c(t),o=new CompletionContext(t,n,e.explicit,this.view),r=new RunningQuery(e,o);this.running.push(r),Promise.resolve(e.source(o)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:m.of(null)}),(0,i.c_)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(g),o=this.view.state.field(M);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(void 0===r.done)continue;if(this.running.splice(i--,1),r.done){let o=c(r.updates.length?r.updates[0].startState:this.view.state),i=Math.min(o,r.done.from+ +!r.active.explicit),s=new ActiveResult(r.active.source,r.active.explicit,i,r.done,r.done.from,null!=(e=r.done.to)?e:o);for(let e of r.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=o.active.find(e=>e.source==r.active.source);if(s&&s.isPending)if(null==r.done){let e=new ActiveSource(r.active.source,0);for(let t of r.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||o.open&&o.open.disabled)&&this.view.dispatch({effects:O.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(M,!1);if(t&&t.tooltip&&this.view.state.facet(g).closeOnBlur){let n=t.open&&(0,i.Eg)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:m.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:d.of(!1)}),20),this.composing=0}}}),B="object"==typeof navigator&&/Win/.test(navigator.platform),L=o.Nb.highest(i.Lz.domEventHandlers({keydown(e,t){let n=t.state.field(M,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(B&&e.altKey)||e.metaKey)return!1;let o=n.open.options[n.open.selected],i=n.active.find(e=>e.source==o.source),r=o.completion.commitCharacters||i.result.commitCharacters;return r&&r.indexOf(e.key)>-1&&E(t,o),!1}})),P=i.Lz.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});let FieldPos=class FieldPos{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}};let FieldRange=class FieldRange{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,o.iR.TrackDel),n=e.mapPos(this.to,1,o.iR.TrackDel);return null==t||null==n?null:new FieldRange(this.field,t,n)}};let Snippet=class Snippet{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],i=e.doc.lineAt(t),s=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=s,l=/^\t*/.exec(i)[0].length;for(let t=0;t<l;t++)n+=e.facet(r.Xt);o.push(t+n.length-l),i=n+i.slice(l)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new FieldRange(e.field,o[e.line]+e.from,o[e.line]+e.to))}}static parse(e){let t=[],n=[],o=[],i;for(let r of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(r);){let e=i[1]?+i[1]:null,s=i[2]||i[3]||"",l=-1,a=s.replace(/\\[{}]/g,e=>e[1]);for(let n=0;n<t.length;n++)(null!=e?t[n].seq==e:a&&t[n].name==a)&&(l=n);if(l<0){let n=0;for(;n<t.length&&(null==e||null!=t[n].seq&&t[n].seq<e);)n++;for(let i of(t.splice(n,0,{seq:e,name:a}),l=n,o))i.field>=l&&i.field++}for(let e of o)if(e.line==n.length&&e.from>i.index){let t=i[2]?3+(i[1]||"").length:2;e.from-=t,e.to-=t}o.push(new FieldPos(l,n.length,i.index,i.index+a.length)),r=r.slice(0,i.index)+s+r.slice(i.index+i[0].length)}r=r.replace(/\\([{}])/g,(e,t,i)=>{for(let e of o)e.line==n.length&&e.from>i&&(e.from--,e.to--);return t}),n.push(r)}return new Snippet(n,o)}};let H=i.NZ.widget({widget:new class extends i.xO{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),N=i.NZ.mark({class:"cm-snippetField"});let ActiveSnippet=class ActiveSnippet{constructor(e,t){this.ranges=e,this.active=t,this.deco=i.NZ.set(e.map(e=>(e.from==e.to?H:N).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new ActiveSnippet(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}};let U=o.Pe.define({map:(e,t)=>e&&e.map(t)}),z=o.Pe.define(),V=o.sU.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(U))return n.value;if(n.is(z)&&e)return new ActiveSnippet(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>i.Lz.decorations.from(e,e=>e?e.deco:i.NZ.none)});function $(e,t){return o.OF.create(e.filter(e=>e.field==t).map(e=>o.OF.range(e.from,e.to)))}function j(e){return({state:t,dispatch:n})=>{let o=t.field(V,!1);if(!o||e<0&&0==o.active)return!1;let i=o.active+e,r=e>0&&!o.ranges.some(t=>t.field==i+e);return n(t.update({selection:$(o.ranges,i),effects:U.of(r?null:new ActiveSnippet(o.ranges,i)),scrollIntoView:!0})),!0}}let J=[{key:"Tab",run:j(1),shift:j(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(V,!1)&&(t(e.update({effects:U.of(null)})),!0)}],_=o.sj.define({combine:e=>e.length?e[0]:J}),q=o.Nb.highest(i.w4.compute([_],e=>e.facet(_)));function K(e,t){let n;return{...t,apply:(n=Snippet.parse(e),(e,t,i,r)=>{let{text:s,ranges:l}=n.instantiate(e.state,i),{main:a}=e.state.selection,c={changes:{from:i,to:r==a.from?a.to:r,insert:o.EY.of(s)},scrollIntoView:!0,annotations:t?[f.of(t),o.ZX.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=$(l,0)),l.some(e=>e.field>0)){let t=new ActiveSnippet(l,0),n=c.effects=[U.of(t)];void 0===e.state.field(V,!1)&&n.push(o.Pe.appendConfig.of([V,q,W,P]))}e.dispatch(e.state.update(c))})}}let W=i.Lz.domEventHandlers({mousedown(e,t){let n=t.state.field(V,!1),o;if(!n||null==(o=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let i=n.ranges.find(e=>e.from<=o&&e.to>=o);return!!i&&i.field!=n.active&&(t.dispatch({selection:$(n.ranges,i.field),effects:U.of(n.ranges.some(e=>e.field>i.field)?new ActiveSnippet(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Y={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Z=o.Pe.define({map(e,t){let n=t.mapPos(e,-1,o.iR.TrackAfter);return null==n?void 0:n}}),G=new class extends o.FB{};G.startSide=1,G.endSide=-1;let Q=o.sU.define({create:()=>o.om.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Z)&&(e=e.update({add:[G.range(n.value,n.value+1)]}));return e}});function X(){return[ei,Q]}let ee="()[]{}<>\xab\xbb\xbb\xab[]{}";function et(e){for(let t=0;t<ee.length;t+=2)if(ee.charCodeAt(t)==e)return ee.charAt(t+1);return(0,o.MK)(e<128?e:e+1)}function en(e,t){return e.languageDataAt("closeBrackets",t)[0]||Y}let eo="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ei=i.Lz.inputHandler.of((e,t,n,i)=>{if((eo?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let s=e.state.selection.main;if(i.length>2||2==i.length&&1==(0,o.Fh)((0,o.vS)(i,0))||t!=s.from||n!=s.to)return!1;let l=function(e,t){let n=en(e,e.selection.main.head),i=n.brackets||Y.brackets;for(let s of i){let l=et((0,o.vS)(s,0));if(t==s)return l==s?function(e,t,n,i){let s=i.stringPrefixes||Y.stringPrefixes,l=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Z.of(i.to+t.length),range:o.OF.range(i.anchor+t.length,i.head+t.length)};let a=i.head,c=el(e.doc,a),h;if(c==t){if(ea(e,a))return{changes:{insert:t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};else if(es(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:o.OF.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(h=ec(e,a-2*t.length,s))>-1&&ea(e,h))return{changes:{insert:t+t+t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};else if(e.charCategorizer(a)(c)!=o.Je.Word&&ec(e,a,s)>-1&&!function(e,t,n,o){let i=(0,r.mv)(e).resolveInner(t,-1),s=o.reduce((e,t)=>Math.max(e,t.length),0);for(let r=0;r<5;r++){let r=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=r.indexOf(n);if(!l||l>-1&&o.indexOf(r.slice(0,l))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let a=i.to==t&&i.parent;if(!a)break;i=a}return!1}(e,a,t,s))return{changes:{insert:t+t,from:a},effects:Z.of(a+t.length),range:o.OF.cursor(a+t.length)};return{range:l=i}});return l?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,s,i.indexOf(s+s+s)>-1,n):function(e,t,n,i){let r=null,s=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:Z.of(s.to+t.length),range:o.OF.range(s.anchor+t.length,s.head+t.length)};let l=el(e.doc,s.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:s.head},effects:Z.of(s.head+t.length),range:o.OF.cursor(s.head+t.length)}:{range:r=s}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,s,l,n.before||Y.before);if(t==l&&es(e,e.selection.main.from))return function(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&el(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:o.OF.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,l)}return null}(e.state,i);return!!l&&(e.dispatch(l),!0)}),er=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=en(e,e.selection.main.head).brackets||Y.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,s;let i,l=(r=e.doc,s=t.head,i=r.sliceString(s-2,s),(0,o.Fh)((0,o.vS)(i,0))==i.length?i:i.slice(1));for(let i of n)if(i==l&&el(e.doc,t.head)==et((0,o.vS)(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:o.OF.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function es(e,t){let n=!1;return e.field(Q).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function el(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,o.Fh)((0,o.vS)(n,0)))}function ea(e,t){let n=(0,r.mv)(e).resolveInner(t+1);return n.parent&&n.from==t}function ec(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=o.Je.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=o.Je.Word)return n}return -1}function eh(e={}){return[L,M,g.of(e),R,eu,P]}let ef=[{key:"Ctrl-Space",run:T},{mac:"Alt-`",run:T},{mac:"Alt-i",run:T},{key:"Escape",run:e=>{let t=e.state.field(M,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:m.of(null)}),!0)}},{key:"ArrowDown",run:F(!0)},{key:"ArrowUp",run:F(!1)},{key:"PageDown",run:F(!0,"page")},{key:"PageUp",run:F(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(M,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(g).interactionDelay)&&E(e,t.open.options[t.open.selected])}}],eu=o.Nb.highest(i.w4.computeN([g],e=>e.facet(g).defaultKeymap?[ef]:[]))},45230(e,t,n){n.d(t,{Yc:()=>eE,b6:()=>y,cL:()=>I,pw:()=>eM});var o=n(6585),i=n(1371),r=n(15874),s=n(90365);function l(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(o(n.update(i)),!0)}}let a=l(function(e,t,n=t.selection.ranges){let o=[],i=-1;e:for(let{from:e,to:r}of n){let n=o.length,s=1e9,l;for(let n=e;n<=r;){let a=t.doc.lineAt(n);if(void 0==l&&!(l=f(t,a.from).line))continue e;if(a.from>i&&(e==r||r>a.from)){i=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<s&&(s=e),o.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(s<1e9)for(let e=n;e<o.length;e++)o[e].indent<o[e].line.text.length&&(o[e].indent=s);o.length==n+1&&(o[n].single=!0)}if(2!=e&&o.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:r,single:s}of o)(s||!r)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of o)if(n>=0){let o=t.from+n,r=o+i.length;" "==t.text[r-t.from]&&r++,e.push({from:o,to:r})}return{changes:e}}return null},0),c=l(u,0),h=l((e,t)=>u(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),i=n.to<=o.to?o:e.doc.lineAt(n.to);i.from>o.from&&i.from==n.to&&(i=n.to==o.to+1?o:e.doc.lineAt(n.to-1));let r=t.length-1;r>=0&&t[r].to>o.from?t[r].to=i.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:i.to})}return t}(t)),0);function f(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function u(e,t,n=t.selection.ranges){let o=n.map(e=>f(t,e.from).block);if(!o.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},o,i){let r,s,l=e.sliceDoc(o-50,o),a=e.sliceDoc(i,i+50),c=/\s*$/.exec(l)[0].length,h=/^\s*/.exec(a)[0].length,f=l.length-c;if(l.slice(f-t.length,f)==t&&a.slice(h,h+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:i+h,margin:h&&1}};i-o<=100?r=s=e.sliceDoc(o,i):(r=e.sliceDoc(o,o+50),s=e.sliceDoc(i-50,i));let u=/^\s*/.exec(r)[0].length,p=/\s*$/.exec(s)[0].length,d=s.length-p-n.length;return r.slice(u,u+t.length)==t&&s.slice(d,d+n.length)==n?{open:{pos:o+u+t.length,margin:+!!/\s/.test(r.charAt(u+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(s.charAt(d-1))}}:null})(t,o[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=o[t],{open:r,close:s}=n;e.push({from:r.pos-i.open.length,to:r.pos+r.margin},{from:s.pos-s.margin,to:s.pos+i.close.length})}return{changes:e}}return null}let p=o.YH.define(),d=o.YH.define(),m=o.sj.define(),g=o.sj.define({combine:e=>(0,o.QR)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),v=o.sU.define({create:()=>HistoryState.empty,update(e,t){let n=t.state.facet(g),i=t.annotation(p);if(i){let o=HistEvent.fromTransaction(t,i.selection),r=i.side,s=0==r?e.undone:e.done;return s=o?S(s,s.length,n.minDepth,o):D(s,t.startState.selection),new HistoryState(0==r?i.rest:s,0==r?s:i.rest)}let r=t.annotation(d);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(o.ZX.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=HistEvent.fromTransaction(t),l=t.annotation(o.ZX.time),a=t.annotation(o.ZX.userEvent);return s?e=e.addChanges(s,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new HistoryState(e.done.map(HistEvent.fromJSON),e.undone.map(HistEvent.fromJSON))});function y(e={}){return[v,g.of(e),i.Lz.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?b:"historyRedo"==e.inputType?A:null;return!!n&&(e.preventDefault(),n(t))}})]}function w(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let i=n.field(v,!1);if(!i)return!1;let r=i.pop(e,n,t);return!!r&&(o(r),!0)}}let b=w(0,!1),A=w(1,!1),x=w(0,!0),k=w(1,!0);let HistEvent=class HistEvent{constructor(e,t,n,o,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=i}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&o.VR.fromJSON(e.changes),[],e.mapped&&o.Gu.fromJSON(e.mapped),e.startSelection&&o.OF.fromJSON(e.startSelection),e.selectionsAfter.map(o.OF.fromJSON))}static fromTransaction(e,t){let n=O;for(let t of e.startState.facet(m)){let o=t(e);o.length&&(n=n.concat(o))}return!n.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,O)}static selection(e){return new HistEvent(void 0,O,void 0,void 0,e)}};function S(e,t,n,o){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(o),i}function C(e,t){return e.length?t.length?e.concat(t):e:t}let O=[];function D(e,t){if(!e.length)return[HistEvent.selection([t])];{let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),S(e,e.length-1,1e9,n.setSelAfter(o)))}}function M(e,t){if(!e.length)return e;let n=e.length,i=O;for(;n;){let r=function(e,t,n){let i=C(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):O,n);if(!e.changes)return HistEvent.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(s):s;return new HistEvent(r,o.Pe.mapEffects(e.effects,t),l,e.startSelection.map(s),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[HistEvent.selection(i)]:O}let E=/^(input\.type|delete)($|\.)/;let HistoryState=class HistoryState{constructor(e,t,n=0,o){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,t,n,i,r){var s,l;let a,c,h=this.done,f=h[h.length-1];return new HistoryState(h=f&&f.changes&&!f.changes.empty&&e.changes&&(!n||E.test(n))&&(!f.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(s=f.changes,l=e.changes,a=[],c=!1,s.iterChangedRanges((e,t)=>a.push(e,t)),l.iterChangedRanges((e,t,n,o)=>{for(let e=0;e<a.length;){let t=a[e++],i=a[e++];o>=t&&n<=i&&(c=!0)}}),c))||"input.type.compose"==n)?S(h,h.length-1,i.minDepth,new HistEvent(e.changes.compose(f.changes),C(o.Pe.mapEffects(e.effects,f.changes),f.effects),f.mapped,f.startSelection,O)):S(h,h.length,i.minDepth,e),O,t,n)}addSelection(e,t,n,o){var i;let r=this.done.length?this.done[this.done.length-1].selectionsAfter:O;return r.length>0&&t-this.prevTime<o&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=r[r.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new HistoryState(D(this.done,e),this.undone,t,n)}addMapping(e){return new HistoryState(M(this.done,e),M(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let i=o[o.length-1],r=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length){let n,s;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:p.of({side:e,rest:(n=o[o.length-1],(s=o.slice())[o.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:r}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==o.length?O:o.slice(0,o.length-1);return i.mapped&&(n=M(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:p.of({side:e,rest:n,selection:r}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}};HistoryState.empty=new HistoryState(O,O);let I=[{key:"Mod-z",run:b,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:A,preventDefault:!0},{linux:"Ctrl-Shift-z",run:A,preventDefault:!0},{key:"Mod-u",run:x,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:k,preventDefault:!0}];function F(e,t){return o.OF.create(e.ranges.map(t),e.mainIndex)}function T(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function R({state:e,dispatch:t},n){let o=F(e.selection,n);return!o.eq(e.selection,!0)&&(t(T(e,o)),!0)}function B(e,t){return o.OF.cursor(t?e.to:e.from)}function L(e,t){return R(e,n=>n.empty?e.moveByChar(n,t):B(n,t))}function P(e){return e.textDirectionAt(e.state.selection.main.head)==i.OP.LTR}let H=e=>L(e,!P(e)),N=e=>L(e,P(e));function U(e,t){return R(e,n=>n.empty?e.moveByGroup(n,t):B(n,t))}function z(e,t,n){let i,l,a=(0,r.mv)(e).resolveInner(t.head),c=n?s.uY.closedBy:s.uY.openedBy;for(let o=t.head;;){let t=n?a.childAfter(o):a.childBefore(o);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,c)?o=n?t.to:t.from:a=t}return l=a.type.prop(c)&&(i=n?(0,r.jU)(e,a.from,1):(0,r.jU)(e,a.to,-1))&&i.matched?n?i.end.to:i.end.from:n?a.to:a.from,o.OF.cursor(l,n?-1:1)}function V(e,t){return R(e,n=>{if(!n.empty)return B(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let $=e=>V(e,!1),j=e=>V(e,!0);function J(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,o=0,r;if(t){for(let t of e.state.facet(i.Lz.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(o=Math.max(null==i?void 0:i.bottom,o))}r=e.scrollDOM.clientHeight-n-o}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function _(e,t){let n,o=J(e),{state:r}=e,s=F(r.selection,n=>n.empty?e.moveVertically(n,t,o.height):B(n,t));if(s.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,c=l.bottom-o.marginBottom;t&&t.top>a&&t.bottom<c&&(n=i.Lz.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(T(r,s),{effects:n}),!0}let q=e=>_(e,!1),K=e=>_(e,!0);function W(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=o.OF.cursor(i.from+n))}return r}function Y(e,t){let n=F(e.state.selection,e=>{let n=t(e);return o.OF.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(T(e.state,n)),!0)}function Z(e,t){return Y(e,n=>e.moveByChar(n,t))}let G=e=>Z(e,!P(e)),Q=e=>Z(e,P(e));function X(e,t){return Y(e,n=>e.moveByGroup(n,t))}function ee(e,t){return Y(e,n=>e.moveVertically(n,t))}let et=e=>ee(e,!1),en=e=>ee(e,!0);function eo(e,t){return Y(e,n=>e.moveVertically(n,t,J(e).height))}let ei=e=>eo(e,!1),er=e=>eo(e,!0),es=({state:e,dispatch:t})=>(t(T(e,{anchor:0})),!0),el=({state:e,dispatch:t})=>(t(T(e,{anchor:e.doc.length})),!0),ea=({state:e,dispatch:t})=>(t(T(e,{anchor:e.selection.main.anchor,head:0})),!0),ec=({state:e,dispatch:t})=>(t(T(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function eh(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let o of n.selection.ranges){let i=n.doc.lineAt(o.head);if(t?i.to<e.state.doc.length:i.from>0)for(let n=o;;){let o=e.moveVertically(n,t);if(o.head<i.from||o.head>i.to){r.some(e=>e.head==o.head)||r.push(o);break}if(o.head==n.head)break;n=o}}return r.length!=i.ranges.length&&(e.dispatch(T(n,o.OF.create(r,r.length-1))),!0)}function ef(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let o=t(i);o<r?(n="delete.backward",o=eu(e,o,!1)):o>r&&(n="delete.forward",o=eu(e,o,!0)),r=Math.min(r,o),s=Math.max(s,o)}else r=eu(e,r,!1),s=eu(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.OF.cursor(r,r<i.head?-1:1)}});return!s.changes.empty&&(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?i.Lz.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function eu(e,t,n){if(e instanceof i.Lz)for(let o of e.state.facet(i.Lz.atomicRanges).map(t=>t(e)))o.between(t,t,(e,o)=>{e<t&&o>t&&(t=n?o:e)});return t}let ep=(e,t,n)=>ef(e,i=>{let s=i.from,{state:l}=e,a=l.doc.lineAt(s),c,h;if(n&&!t&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,s-a.from))){if(" "==c[c.length-1])return s-1;let e=(0,o.y$)(c,l.tabSize)%(0,r.tp)(l)||(0,r.tp)(l);for(let t=0;t<e&&" "==c[c.length-1-t];t++)s--;h=s}else(h=(0,o.zK)(a.text,s-a.from,t,t)+a.from)==s&&a.number!=(t?l.doc.lines:1)?h+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(h-a.from,s-a.from))&&(h=(0,o.zK)(a.text,h-a.from,!1,!1)+a.from);return h}),ed=e=>ep(e,!1,!0),em=e=>ep(e,!0,!1),eg=(e,t)=>ef(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let a=(0,o.zK)(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(null!=e&&h!=e)break;(" "!=c||i!=n.head)&&(e=h),i=a}return i}),ev=e=>eg(e,!1);function ey(e){let t=[],n=-1;for(let o of e.selection.ranges){let i=e.doc.lineAt(o.from),r=e.doc.lineAt(o.to);if(o.empty||o.to!=r.from||(r=e.doc.lineAt(o.to-1)),n>=i.number){let e=t[t.length-1];e.to=r.to,e.ranges.push(o)}else t.push({from:i.from,to:r.to,ranges:[o]});n=r.number+1}return t}function ew(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of ey(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),l=s.length+1;if(n)for(let n of(i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))r.push(o.OF.range(Math.min(e.doc.length,n.anchor+l),Math.min(e.doc.length,n.head+l)));else for(let n of(i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))r.push(o.OF.range(n.anchor-l,n.head-l))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.OF.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function eb(e,t,n){if(e.readOnly)return!1;let o=[];for(let t of ey(e))n?o.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):o.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(o);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let eA=ek(!1),ex=ek(!0);function ek(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:l}=n,a=t.doc.lineAt(i),c=!e&&i==l&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,r.mv)(e).resolveInner(t),o=n.childBefore(t),i=n.childAfter(t),l;return o&&i&&o.to<=t&&i.from>=t&&(l=o.type.prop(s.uY.closedBy))&&l.indexOf(i.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(o.to,i.from))?{from:o.to,to:i.from}:null}(t,i);e&&(i=l=(l<=a.to?a:t.doc.lineAt(l)).to);let h=new r.KB(t,{simulateBreak:i,simulateDoubleBreak:!!c}),f=(0,r._v)(h,i);for(null==f&&(f=(0,o.y$)(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));l<a.to&&/\s/.test(a.text[l-a.from]);)l++;c?{from:i,to:l}=c:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let u=["",(0,r.EI)(t,f)];return c&&u.push((0,r.EI)(t,h.lineIndent(a.from,-1))),{changes:{from:i,to:l,insert:o.EY.of(u)},range:o.OF.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function eS(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let s=e.changes(r);return{changes:r,range:o.OF.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}let eC=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eS(e,(t,n)=>{n.push({from:t.from,insert:e.facet(r.Xt)})}),{userEvent:"input.indent"})),!0),eO=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eS(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=(0,o.y$)(i,e.tabSize),l=0,a=(0,r.EI)(e,Math.max(0,s-(0,r.tp)(e)));for(;l<i.length&&l<a.length&&i.charCodeAt(l)==a.charCodeAt(l);)l++;n.push({from:t.from+l,to:t.from+i.length,insert:a.slice(l)})}),{userEvent:"delete.dedent"})),!0),eD=[{key:"Ctrl-b",run:H,shift:G,preventDefault:!0},{key:"Ctrl-f",run:N,shift:Q},{key:"Ctrl-p",run:$,shift:et},{key:"Ctrl-n",run:j,shift:en},{key:"Ctrl-a",run:e=>R(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Y(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>R(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Y(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:em},{key:"Ctrl-h",run:ed},{key:"Ctrl-k",run:e=>ef(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:ev},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.EY.of(["",""])},range:o.OF.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.zK)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.zK)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.OF.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:K}],eM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>R(e,t=>z(e.state,t,!P(e))),shift:e=>Y(e,t=>z(e.state,t,!P(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>R(e,t=>z(e.state,t,P(e))),shift:e=>Y(e,t=>z(e.state,t,P(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>ew(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>eb(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>ew(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>eb(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>eh(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>eh(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.OF.create([n.main]):n.main.empty||(i=o.OF.create([o.OF.cursor(n.main.head)])),!!i&&(t(T(e,i)),!0)}},{key:"Mod-Enter",run:ex},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=ey(e).map(({from:t,to:n})=>o.OF.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.OF.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=F(e.selection,t=>{let n=(0,r.mv)(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return o.OF.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(T(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:eO},{key:"Mod-]",run:eC},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new r.KB(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=eS(e,(t,i,s)=>{let l=(0,r._v)(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],c=(0,r.EI)(e,l);(a!=c||s.from<t.from+a.length)&&(n[t.from]=l,i.push({from:t.from,to:t.from+a.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ey(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),o=F(t.selection,t=>{let n;if(e.lineWrapping){let o=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=o.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=F(e.selection,t=>{let i=(0,r.jU)(e,t.head,-1)||(0,r.jU)(e,t.head,1)||t.head>0&&(0,r.jU)(e,t.head-1,1)||t.head<e.doc.length&&(0,r.jU)(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let s=i.start.from==t.head?i.end.to:i.end.from;return o.OF.cursor(s)}),!!n&&(t(T(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=f(e.state,n.from);return o.line?a(e):!!o.block&&h(e)}},{key:"Alt-A",run:c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:H,shift:G,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>U(e,!P(e)),shift:e=>X(e,!P(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>R(e,t=>W(e,t,!P(e))),shift:e=>Y(e,t=>W(e,t,!P(e))),preventDefault:!0},{key:"ArrowRight",run:N,shift:Q,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>U(e,P(e)),shift:e=>X(e,P(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>R(e,t=>W(e,t,P(e))),shift:e=>Y(e,t=>W(e,t,P(e))),preventDefault:!0},{key:"ArrowUp",run:$,shift:et,preventDefault:!0},{mac:"Cmd-ArrowUp",run:es,shift:ea},{mac:"Ctrl-ArrowUp",run:q,shift:ei},{key:"ArrowDown",run:j,shift:en,preventDefault:!0},{mac:"Cmd-ArrowDown",run:el,shift:ec},{mac:"Ctrl-ArrowDown",run:K,shift:er},{key:"PageUp",run:q,shift:ei},{key:"PageDown",run:K,shift:er},{key:"Home",run:e=>R(e,t=>W(e,t,!1)),shift:e=>Y(e,t=>W(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:es,shift:ea},{key:"End",run:e=>R(e,t=>W(e,t,!0)),shift:e=>Y(e,t=>W(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:el,shift:ec},{key:"Enter",run:eA,shift:eA},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ed,shift:ed,preventDefault:!0},{key:"Delete",run:em,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ev,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>eg(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>ef(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>ef(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(eD.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),eE={key:"Tab",run:eC,shift:eO}},6363(e,t,n){n.d(t,{V0:()=>s});var o=n(1371),i=n(15874),r=n(45230);let s=[(0,o.N$)(),(0,r.b6)(),(0,o.VH)(),(0,i.y9)(i.Zt,{fallback:!0}),o.w4.of([...r.pw,...r.cL])]}};
2
+ //# sourceMappingURL=749.15180d605dd9d7e9.js.map