@mdn/fred 1.6.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/.env-dist +4 -0
  2. package/CHANGELOG.md +66 -0
  3. package/CONTRIBUTING.md +2 -2
  4. package/README.md +31 -2
  5. package/build/eslint-fred.js +6 -4
  6. package/build/plugins/generate-element-map.js +3 -2
  7. package/build/utils.js +0 -23
  8. package/components/breadcrumbs-bar/server.css +12 -0
  9. package/components/color-theme/element.js +1 -0
  10. package/components/content-feedback/element.js +58 -22
  11. package/components/content-section/server.css +15 -2
  12. package/components/curriculum/module.css +1 -0
  13. package/components/curriculum-module/server.css +1 -0
  14. package/components/env/index.js +6 -0
  15. package/components/footer/server.js +1 -1
  16. package/components/heading-anchor/server.js +0 -2
  17. package/components/issues-table/element.js +6 -4
  18. package/components/language-switcher/element.js +1 -0
  19. package/components/live-sample-result/element.js +1 -0
  20. package/components/menu/base.css +2 -1
  21. package/components/menu/constants.js +438 -147
  22. package/components/menu/missing-docs.json +133 -0
  23. package/components/menu/server.js +78 -657
  24. package/components/menu/types.d.ts +50 -0
  25. package/components/menu/update-missing-docs.js +66 -0
  26. package/components/modal/element.js +3 -2
  27. package/components/navigation/server.js +1 -1
  28. package/components/observatory-tests-and-scores/element.js +13 -7
  29. package/components/outer-layout/utils.js +2 -2
  30. package/components/play-runner/element.js +14 -6
  31. package/components/playground/element.js +11 -5
  32. package/components/recently-visited/element.js +4 -2
  33. package/components/scrim-inline/element.js +11 -5
  34. package/components/search-modal/element.js +1 -0
  35. package/components/writer-reload/element.js +10 -2
  36. package/entry.client.js +1 -0
  37. package/hooks/ga-init.js +31 -0
  38. package/hooks/glean-init.js +2 -6
  39. package/l10n/en-US.ftl +6 -0
  40. package/l10n/fr.ftl +145 -1
  41. package/out/service-worker.js +1 -1
  42. package/out/service-worker.js.map +1 -1
  43. package/out/static/client/{1231.84c230e0fa92f2d4.js → 1231.6a66b96b566b2cca.js} +14 -10
  44. package/out/static/client/1231.6a66b96b566b2cca.js.map +1 -0
  45. package/out/static/client/{2190.7995f19655987265.js → 2190.a21d8b0d7b75a20d.js} +5 -5
  46. package/out/static/client/2190.a21d8b0d7b75a20d.js.map +1 -0
  47. package/out/static/client/{2319.2034183eaacce69a.js → 2319.a419f6d93c814f50.js} +12 -8
  48. package/out/static/client/2319.a419f6d93c814f50.js.map +1 -0
  49. package/out/static/client/{3092.94a3edc866458ab7.js → 3092.54b703ff89ccdaf7.js} +6 -6
  50. package/out/static/client/3092.54b703ff89ccdaf7.js.map +1 -0
  51. package/out/static/client/{3200.024a6b1d06d80026.js → 3200.dc89d9709a81e853.js} +2 -1
  52. package/out/static/client/{3200.024a6b1d06d80026.js.map → 3200.dc89d9709a81e853.js.map} +1 -1
  53. package/out/static/client/{486.bb14d2f437221509.js → 486.b6950b0a4cfb9116.js} +2 -2
  54. package/out/static/client/{486.bb14d2f437221509.js.map → 486.b6950b0a4cfb9116.js.map} +1 -1
  55. package/out/static/client/{5446.3e0ac5aa93616c6f.js → 5446.2e663885069b1680.js} +4 -2
  56. package/out/static/client/5446.2e663885069b1680.js.map +1 -0
  57. package/out/static/client/{603.775311ee1356e86f.js → 603.45bf3e185d1b890d.js} +7 -7
  58. package/out/static/client/603.45bf3e185d1b890d.js.map +1 -0
  59. package/out/static/client/{6465.08012ddcd4597c76.js → 6465.2dc41017ae6abc34.js} +2 -1
  60. package/out/static/client/6465.2dc41017ae6abc34.js.map +1 -0
  61. package/out/static/client/{6480.09f744cd2fb69ed8.js → 6480.c839ead24f125a7e.js} +3 -2
  62. package/out/static/client/{6480.09f744cd2fb69ed8.js.map → 6480.c839ead24f125a7e.js.map} +1 -1
  63. package/out/static/client/7185.278701dcd05fcd30.js +2 -0
  64. package/out/static/client/7185.278701dcd05fcd30.js.map +1 -0
  65. package/out/static/client/9379.edc05ee9f550804e.js +2 -0
  66. package/out/static/client/9379.edc05ee9f550804e.js.map +1 -0
  67. package/out/static/client/{9784.3c73a0debfcca553.js → 9784.1c8d6e465137fd58.js} +13 -9
  68. package/out/static/client/{9784.3c73a0debfcca553.js.map → 9784.1c8d6e465137fd58.js.map} +1 -1
  69. package/out/static/client/{9804.d9ffbe6b7c44eab3.js → 9804.ba52ea55253eca7b.js} +2 -2
  70. package/out/static/client/{9804.d9ffbe6b7c44eab3.js.map → 9804.ba52ea55253eca7b.js.map} +1 -1
  71. package/out/static/client/9914.021220acc0d3e777.js +11 -0
  72. package/out/static/client/9914.021220acc0d3e777.js.map +1 -0
  73. package/out/static/client/index.0f05d4ac6b3b88a1.js +419 -0
  74. package/out/static/client/index.0f05d4ac6b3b88a1.js.map +1 -0
  75. package/out/static/client/{runtime.b178b9749f31202a.js → runtime.c323b9d2153b4ebf.js} +2 -2
  76. package/out/static/client/{runtime.b178b9749f31202a.js.map → runtime.c323b9d2153b4ebf.js.map} +1 -1
  77. package/out/static/client/stats.json +200 -200
  78. package/out/static/client/styles-breadcrumbs-bar.02910e49bb8b2372.css +2 -0
  79. package/out/static/client/styles-breadcrumbs-bar.02910e49bb8b2372.css.map +1 -0
  80. package/out/static/client/{styles-content-section.d18f07ab3d79a1d2.css → styles-content-section.6dc04fb9b3f3d595.css} +2 -2
  81. package/out/static/client/{styles-content-section.d18f07ab3d79a1d2.css.map → styles-content-section.6dc04fb9b3f3d595.css.map} +1 -1
  82. package/out/static/client/styles-curriculum-landing.cbaf6ff367369a26.css.map +1 -1
  83. package/out/static/client/styles-curriculum-module.c7ec78d3e724cf64.css.map +1 -1
  84. package/out/static/client/{styles-global.fb7afecd89ca2dff.js → styles-global.01d60465c4584631.js} +1 -1
  85. package/out/static/client/styles-global.4031cdde644ed6ce.css +2 -0
  86. package/out/static/client/{styles-global.684fd2c5254c94b8.css.map → styles-global.4031cdde644ed6ce.css.map} +1 -1
  87. package/out/static/client/styles-menu.c41c14be9597dcd9.css +2 -0
  88. package/out/static/client/styles-menu.c41c14be9597dcd9.css.map +1 -0
  89. package/out/static/client/watify_bg.c5a182c47876cd2b.wasm +0 -0
  90. package/out/static/legacy/{1539.ad5e9bc68ca36ebd.js → 1539.f16c6732d55f64b7.js} +3 -3
  91. package/out/static/legacy/{1539.ad5e9bc68ca36ebd.js.map → 1539.f16c6732d55f64b7.js.map} +1 -1
  92. package/out/static/legacy/7185.278701dcd05fcd30.js +2 -0
  93. package/out/static/legacy/7185.278701dcd05fcd30.js.map +1 -0
  94. package/out/static/legacy/asset-manifest.json +9 -9
  95. package/out/static/legacy/{index.ad3600b01e18974e.html → index.19cded28f6c1e506.html} +1 -1
  96. package/out/static/legacy/{index.5592b02d966df8ba.js → index.e979e65eb8758f6f.js} +3 -3
  97. package/out/static/legacy/{index.5592b02d966df8ba.js.map → index.e979e65eb8758f6f.js.map} +1 -1
  98. package/out/static/legacy/stats.json +13 -13
  99. package/out/static/legacy/watify_bg.c5a182c47876cd2b.wasm +0 -0
  100. package/out/static/legacy/{yari.8ce0be252d1ae155.js → yari.7f26dc58679ef833.js} +3 -3
  101. package/out/static/legacy/{yari.8ce0be252d1ae155.js.map → yari.7f26dc58679ef833.js.map} +1 -1
  102. package/out/static/ssr/7185.js +1 -1
  103. package/out/static/ssr/7185.js.map +1 -1
  104. package/out/static/ssr/index.js +369 -620
  105. package/out/static/ssr/index.js.map +1 -1
  106. package/out/static/ssr/stats.json +4 -4
  107. package/out/static/ssr/watify_bg.c5a182c47876cd2b.wasm +0 -0
  108. package/package.json +20 -20
  109. package/scripts/npm-test.js +22 -0
  110. package/server.js +22 -4
  111. package/utils/dnt-helper.js +59 -0
  112. package/utils/name-transformation.js +40 -0
  113. package/utils/telemetry-opt-out.js +12 -0
  114. package/wdio.conf.js +4 -2
  115. package/components/menu/check-missing-docs.js +0 -44
  116. package/out/static/client/1231.84c230e0fa92f2d4.js.map +0 -1
  117. package/out/static/client/2190.7995f19655987265.js.map +0 -1
  118. package/out/static/client/2319.2034183eaacce69a.js.map +0 -1
  119. package/out/static/client/3092.94a3edc866458ab7.js.map +0 -1
  120. package/out/static/client/5446.3e0ac5aa93616c6f.js.map +0 -1
  121. package/out/static/client/603.775311ee1356e86f.js.map +0 -1
  122. package/out/static/client/6465.08012ddcd4597c76.js.map +0 -1
  123. package/out/static/client/7185.a014a928e9a39779.js +0 -2
  124. package/out/static/client/7185.a014a928e9a39779.js.map +0 -1
  125. package/out/static/client/9379.7cdf58b4fb5efa66.js +0 -2
  126. package/out/static/client/9379.7cdf58b4fb5efa66.js.map +0 -1
  127. package/out/static/client/9914.251fe19f0038e97b.js +0 -11
  128. package/out/static/client/9914.251fe19f0038e97b.js.map +0 -1
  129. package/out/static/client/index.26176fe4ab13dce5.js +0 -268
  130. package/out/static/client/index.26176fe4ab13dce5.js.map +0 -1
  131. package/out/static/client/styles-breadcrumbs-bar.e2fa6dfb04a38166.css +0 -2
  132. package/out/static/client/styles-breadcrumbs-bar.e2fa6dfb04a38166.css.map +0 -1
  133. package/out/static/client/styles-global.684fd2c5254c94b8.css +0 -2
  134. package/out/static/client/styles-menu.5193bf2642ae7d64.css +0 -2
  135. package/out/static/client/styles-menu.5193bf2642ae7d64.css.map +0 -1
  136. package/out/static/client/watify_bg.9877982a693ec402.wasm +0 -0
  137. package/out/static/legacy/7185.a014a928e9a39779.js +0 -2
  138. package/out/static/legacy/7185.a014a928e9a39779.js.map +0 -1
  139. package/out/static/legacy/watify_bg.9877982a693ec402.wasm +0 -0
  140. package/out/static/ssr/watify_bg.9877982a693ec402.wasm +0 -0
  141. /package/out/static/client/{2190.7995f19655987265.js.LICENSE.txt → 2190.a21d8b0d7b75a20d.js.LICENSE.txt} +0 -0
  142. /package/out/static/client/{2319.2034183eaacce69a.js.LICENSE.txt → 2319.a419f6d93c814f50.js.LICENSE.txt} +0 -0
  143. /package/out/static/client/{603.775311ee1356e86f.js.LICENSE.txt → 603.45bf3e185d1b890d.js.LICENSE.txt} +0 -0
  144. /package/out/static/client/{6480.09f744cd2fb69ed8.js.LICENSE.txt → 6480.c839ead24f125a7e.js.LICENSE.txt} +0 -0
  145. /package/out/static/client/{9784.3c73a0debfcca553.js.LICENSE.txt → 9784.1c8d6e465137fd58.js.LICENSE.txt} +0 -0
  146. /package/out/static/client/{index.26176fe4ab13dce5.js.LICENSE.txt → index.0f05d4ac6b3b88a1.js.LICENSE.txt} +0 -0
  147. /package/out/static/legacy/{1539.ad5e9bc68ca36ebd.js.LICENSE.txt → 1539.f16c6732d55f64b7.js.LICENSE.txt} +0 -0
  148. /package/out/static/legacy/{index.5592b02d966df8ba.js.LICENSE.txt → index.e979e65eb8758f6f.js.LICENSE.txt} +0 -0
  149. /package/out/static/legacy/{yari.8ce0be252d1ae155.js.LICENSE.txt → yari.7f26dc58679ef833.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- /*! For license information please see 6480.09f744cd2fb69ed8.js.LICENSE.txt */
1
+ /*! For license information please see 6480.c839ead24f125a7e.js.LICENSE.txt */
2
2
  export const __webpack_id__="6480";export const __webpack_ids__=["6480"];export const __webpack_modules__={35030:function(e,t,i){i.d(t,{A:()=>h});var n=i(63819),s=i(31601),l=i.n(s),r=i(76314),a=i.n(r),c=i(55196),o=i(59235),d=a()(l());d.i(c.A),d.i(o.A),d.push([e.id,".code-example .example-header{justify-content:end;padding-right:.5rem}@media print{.example-header,mdn-button{display:none!important}}",""]);let h=(0,n.AH)([d.toString()])},4225:function(e,t,i){i.r(t),i.d(t,{MDNLiveSampleResult:()=>MDNLiveSampleResult});var n=i(63819),s=i(38758),l=i(86484),r=i(35030);i(86129),i(99638);let MDNLiveSampleResult=class MDNLiveSampleResult extends(0,l.J)(n.WF){static styles=r.A;static properties={liveId:{attribute:"live-id"},code:{type:Object},allowed:{},sandbox:{},srcPrefix:{attribute:"src-prefix"},height:{},breakoutLink:{state:!0}};constructor(){super(),this.liveId=void 0,this.code=void 0,this.allow=void 0,this.sandbox=void 0,this.srcPrefix=void 0,this.height=void 0,this.breakoutLink=void 0}_openFullscreen(e=!1){this._runnerSrc?e||this._fullscreenReplace?location.replace(this._runnerSrc):location.href=this._runnerSrc:(this._fullscreenPending=!0,e&&(this._fullscreenReplace=!0))}_fullscreenClick(e){this.liveId&&e.target instanceof HTMLAnchorElement&&e.target.hash===`#livesample_fullscreen=${this.liveId}`&&(e.preventDefault(),this._openFullscreen())}_runnerSrcUpdated({detail:e}){this._runnerSrc=e,this._fullscreenPending&&this._openFullscreen();let t=new URL("/en-US/play",location.href);t.search=new URL(this._runnerSrc).search,this.srcPrefix&&t.searchParams.append("srcPrefix",this.srcPrefix),this.breakoutLink=t.href}connectedCallback(){super.connectedCallback(),this._fullscreenClick=this._fullscreenClick.bind(this),document.addEventListener("click",this._fullscreenClick),location.hash===`#livesample_fullscreen=${this.liveId}`&&this._openFullscreen()}render(){return(0,n.qy)`
3
3
  <div class="code-example">
4
4
  <div class="example-header">
@@ -18,8 +18,9 @@ export const __webpack_id__="6480";export const __webpack_ids__=["6480"];export
18
18
  .allow=${this.allow}
19
19
  .sandbox=${[...new Set(["allow-modals",...this.sandbox?.split(" ")||[]])].join(" ")}
20
20
  .srcPrefix=${this.srcPrefix}
21
+ permalink
21
22
  style=${(0,s.W)({height:this.height?`${this.height}${/[0-9]$/.test(this.height)?"px":""}`:void 0})}
22
23
  ></mdn-play-runner>
23
24
  </div>
24
25
  `}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._fullscreenClick)}};customElements.define("mdn-live-sample-result",MDNLiveSampleResult)},62963:function(e,t,i){i.d(t,{J:()=>s});var n=i(97160);let s=e=>e??n.s6},70209:function(e,t,i){i.d(t,{D:()=>r});var n=i(97160),s=i(17316),l=i(98176);let r=(0,s.u$)(class extends s.WL{constructor(){super(...arguments),this.key=n.s6}render(e,t){return this.key=e,t}update(e,[t,i]){return t!==this.key&&((0,l.mY)(e),this.key=t),i}})}};
25
- //# sourceMappingURL=6480.09f744cd2fb69ed8.js.map
26
+ //# sourceMappingURL=6480.c839ead24f125a7e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"6480.09f744cd2fb69ed8.js","sources":["webpack://@mdn/fred/./components/live-sample-result/element.css","webpack://@mdn/fred/./components/live-sample-result/element.js","webpack://@mdn/fred/./node_modules/lit-html/directives/if-defined.js","webpack://@mdn/fred/./node_modules/lit-html/directives/keyed.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\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../build/loaders/fix-light-dark.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!../global/global.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../build/loaders/fix-light-dark.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!../code-example/common.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.code-example .example-header{justify-content:end;padding-right:.5rem}@media print{.example-header,mdn-button{display:none!important}}`, \"\"]);\n// Exports\nexport default css([___CSS_LOADER_EXPORT___.toString()]);\n","import { LitElement, html, nothing } from \"lit\";\n\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nimport { L10nMixin } from \"../../l10n/mixin.js\";\n\nimport styles from \"./element.css?lit\";\n\nimport \"../play-runner/element.js\";\nimport \"../button/element.js\";\n\nexport class MDNLiveSampleResult extends L10nMixin(LitElement) {\n static styles = styles;\n\n static properties = {\n liveId: { attribute: \"live-id\" },\n code: { type: Object },\n allowed: {},\n sandbox: {},\n srcPrefix: { attribute: \"src-prefix\" },\n height: {},\n breakoutLink: { state: true },\n };\n\n constructor() {\n super();\n /** @type {string | undefined} */\n this.liveId = undefined;\n /** @type {Record<string, string> | undefined} */\n this.code = undefined;\n /** @type {string | undefined} */\n this.allow = undefined;\n /** @type {string | undefined} */\n this.sandbox = undefined;\n /** @type {string | undefined} */\n this.srcPrefix = undefined;\n /** @type {string | undefined} */\n this.height = undefined;\n /** @type {string | undefined} */\n this.breakoutLink = undefined;\n }\n\n _openFullscreen(replace = false) {\n if (this._runnerSrc) {\n if (replace || this._fullscreenReplace) {\n location.replace(this._runnerSrc);\n } else {\n location.href = this._runnerSrc;\n }\n } else {\n this._fullscreenPending = true;\n if (replace) {\n this._fullscreenReplace = true;\n }\n }\n }\n\n /** @param {MouseEvent} event */\n _fullscreenClick(event) {\n if (\n this.liveId &&\n event.target instanceof HTMLAnchorElement &&\n event.target.hash === `#livesample_fullscreen=${this.liveId}`\n ) {\n event.preventDefault();\n this._openFullscreen();\n }\n }\n\n /** @param {CustomEvent<string>} event */\n _runnerSrcUpdated({ detail }) {\n this._runnerSrc = detail;\n if (this._fullscreenPending) {\n this._openFullscreen();\n }\n const playUrl = new URL(\"/en-US/play\", location.href);\n playUrl.search = new URL(this._runnerSrc).search;\n if (this.srcPrefix)\n playUrl.searchParams.append(\"srcPrefix\", this.srcPrefix);\n this.breakoutLink = playUrl.href;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._fullscreenClick = this._fullscreenClick.bind(this);\n document.addEventListener(\"click\", this._fullscreenClick);\n if (location.hash === `#livesample_fullscreen=${this.liveId}`) {\n this._openFullscreen();\n }\n }\n\n render() {\n return html`\n <div class=\"code-example\">\n <div class=\"example-header\">\n ${this.breakoutLink\n ? html`<mdn-button\n variant=\"secondary\"\n href=${this.breakoutLink}\n target=\"_blank\"\n rel=\"opener\"\n aria-label=${this.l10n(\"example-play-button-title\")}\n title=${this.l10n(\"example-play-button-title\")}\n >${this.l10n(\"example-play-button-label\")}</mdn-button\n >`\n : nothing}\n </div>\n <mdn-play-runner\n @mdn-play-runner-src=${this._runnerSrcUpdated}\n .code=${this.code}\n .allow=${this.allow}\n .sandbox=${[\n ...new Set([\"allow-modals\", ...(this.sandbox?.split(\" \") || [])]),\n ].join(\" \")}\n .srcPrefix=${this.srcPrefix}\n style=${styleMap({\n height: this.height\n ? `${this.height}${/[0-9]$/.test(this.height) ? \"px\" : \"\"}`\n : undefined,\n })}\n ></mdn-play-runner>\n </div>\n `;\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener(\"click\", this._fullscreenClick);\n }\n}\n\ncustomElements.define(\"mdn-live-sample-result\", MDNLiveSampleResult);\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import{nothing as r}from\"../lit-html.js\";import{directive as t,Directive as e}from\"../directive.js\";import{setCommittedValue as s}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const i=t(class extends e{constructor(){super(...arguments),this.key=r}render(r,t){return this.key=r,t}update(r,[t,e]){return t!==this.key&&(s(r),this.key=t),e}});export{i as keyed};\n//# sourceMappingURL=keyed.js.map\n"],"names":["MDNLiveSampleResult","Object","location","e","HTMLAnchorElement","URL","document","n","Set","s","customElements","arguments","t"],"mappings":";+NAMI,EAA0B,IAA4B,KAC1D,EAAwB,CAAC,CAAC,GAAiC,EAC3D,EAAwB,CAAC,CAAC,GAAiC,EAE3D,EAAwB,IAAI,CAAC,CAAC,EAAO,EAAE,CAAE,yIAA0I,GAAG,EAEtL,MAAe,SAAI,CAAC,EAAwB,QAAQ,GAAG,sJCDhD,IAAMA,oBAAN,MAAMA,2BAA4B,QAAU,IAAU,EAC3D,OAAO,OAAS,GAAM,AAAC,AAEvB,QAAO,WAAa,CAClB,OAAQ,CAAE,UAAW,SAAU,EAC/B,KAAM,CAAE,KAAMC,MAAO,EACrB,QAAS,CAAC,EACV,QAAS,CAAC,EACV,UAAW,CAAE,UAAW,YAAa,EACrC,OAAQ,CAAC,EACT,aAAc,CAAE,MAAO,EAAK,CAC9B,CAAE,AAEF,cAAc,CACZ,KAAK,GAEL,IAAI,CAAC,MAAM,CAAG,OAEd,IAAI,CAAC,IAAI,CAAG,OAEZ,IAAI,CAAC,KAAK,CAAG,OAEb,IAAI,CAAC,OAAO,CAAG,OAEf,IAAI,CAAC,SAAS,CAAG,OAEjB,IAAI,CAAC,MAAM,CAAG,OAEd,IAAI,CAAC,YAAY,CAAG,MACtB,CAEA,gBAAgB,EAAU,EAAK,CAAE,CAC3B,IAAI,CAAC,UAAU,CACb,GAAW,IAAI,CAAC,kBAAkB,CACpCC,SAAS,OAAO,CAAC,IAAI,CAAC,UAAU,EAEhCA,SAAS,IAAI,CAAG,IAAI,CAAC,UAAU,EAGjC,IAAI,CAAC,kBAAkB,CAAG,GACtB,GACF,KAAI,CAAC,kBAAkB,CAAG,EAAG,EAGnC,CAGA,iBAAiBC,CAAK,CAAE,CAEpB,IAAI,CAAC,MAAM,EACXA,EAAM,MAAM,YAAYC,mBACxBD,EAAM,MAAM,CAAC,IAAI,GAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAE7DA,EAAM,cAAc,GACpB,IAAI,CAAC,eAAe,GAExB,CAGA,kBAAkB,CAAE,QAAM,CAAE,CAAE,CAC5B,IAAI,CAAC,UAAU,CAAG,EACd,IAAI,CAAC,kBAAkB,EACzB,IAAI,CAAC,eAAe,GAEtB,IAAM,EAAU,IAAIE,IAAI,cAAeH,SAAS,IAAI,CACpD,GAAQ,MAAM,CAAG,IAAIG,IAAI,IAAI,CAAC,UAAU,EAAE,MAAM,CAC5C,IAAI,CAAC,SAAS,EAChB,EAAQ,YAAY,CAAC,MAAM,CAAC,YAAa,IAAI,CAAC,SAAS,EACzD,IAAI,CAAC,YAAY,CAAG,EAAQ,IAAI,AAClC,CAEA,mBAAoB,CAClB,KAAK,CAAC,oBACN,IAAI,CAAC,gBAAgB,CAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EACvDC,SAAS,gBAAgB,CAAC,QAAS,IAAI,CAAC,gBAAgB,EACpDJ,SAAS,IAAI,GAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAC3D,IAAI,CAAC,eAAe,EAExB,CAEA,QAAS,CACP,MAAO,QAAI,CAAC;;;UAGN,EAAE,IAAI,CAAC,YAAY,CACf,QAAI,CAAC;;qBAEE,EAAE,IAAI,CAAC,YAAY,CAAC;;;2BAGd,EAAE,IAAI,CAAC,IAAI,CAAC,6BAA6B;sBAC9C,EAAE,IAAI,CAAC,IAAI,CAAC,6BAA6B;iBAC9C,EAAE,IAAI,CAAC,IAAI,CAAC,6BAA6B;eAC3C,CAAC,CACFK,EAAA,EAAO,CAAC;;;+BAGS,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBACxC,EAAE,IAAI,CAAC,IAAI,CAAC;iBACX,EAAE,IAAI,CAAC,KAAK,CAAC;mBACX,EAAE,IACN,IAAIC,IAAI,CAAC,kBAAoB,IAAI,CAAC,OAAO,EAAE,MAAM,MAAQ,EAAE,CAAE,EACjE,CAAC,IAAI,CAAC,KAAK;qBACD,EAAE,IAAI,CAAC,SAAS,CAAC;gBACtB,EAAE,GAAAC,EAAA,GAAS,CACf,OAAQ,IAAI,CAAC,MAAM,CACf,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,IAAI,CAAC,IAAI,CAAC,MAAM,EAAI,KAAO,GAAG,CAAC,CACzD,MACN,GAAG;;;IAGT,CAAC,AACH,CAEA,sBAAuB,CACrB,KAAK,CAAC,uBACNH,SAAS,mBAAmB,CAAC,QAAS,IAAI,CAAC,gBAAgB,CAC7D,CACF,EAEAI,eAAe,MAAM,CAAC,yBAA0BV,4EC9H7C,IAAM,EAAE,GAAG,GAAG,IAAC,8ECAf,IAAM,EAAE,SAAE,cAAc,IAAC,CAAC,aAAa,CAAC,KAAK,IAAIW,WAAW,IAAI,CAAC,GAAG,CAAC,IAAC,CAAC,OAAO,CAAC,CAACC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAEA,CAAC,CAAC,OAAO,CAAC,CAAC,CAACA,EAAE,EAAE,CAAC,CAAC,OAAOA,IAAI,IAAI,CAAC,GAAG,EAAG,UAAE,GAAG,IAAI,CAAC,GAAG,CAACA,CAAAA,EAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"6480.c839ead24f125a7e.js","sources":["webpack://@mdn/fred/./components/live-sample-result/element.css","webpack://@mdn/fred/./components/live-sample-result/element.js","webpack://@mdn/fred/./node_modules/lit-html/directives/if-defined.js","webpack://@mdn/fred/./node_modules/lit-html/directives/keyed.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\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../build/loaders/fix-light-dark.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!../global/global.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../build/loaders/fix-light-dark.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!../code-example/common.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.code-example .example-header{justify-content:end;padding-right:.5rem}@media print{.example-header,mdn-button{display:none!important}}`, \"\"]);\n// Exports\nexport default css([___CSS_LOADER_EXPORT___.toString()]);\n","import { LitElement, html, nothing } from \"lit\";\n\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nimport { L10nMixin } from \"../../l10n/mixin.js\";\n\nimport styles from \"./element.css?lit\";\n\nimport \"../play-runner/element.js\";\nimport \"../button/element.js\";\n\nexport class MDNLiveSampleResult extends L10nMixin(LitElement) {\n static styles = styles;\n\n static properties = {\n liveId: { attribute: \"live-id\" },\n code: { type: Object },\n allowed: {},\n sandbox: {},\n srcPrefix: { attribute: \"src-prefix\" },\n height: {},\n breakoutLink: { state: true },\n };\n\n constructor() {\n super();\n /** @type {string | undefined} */\n this.liveId = undefined;\n /** @type {Record<string, string> | undefined} */\n this.code = undefined;\n /** @type {string | undefined} */\n this.allow = undefined;\n /** @type {string | undefined} */\n this.sandbox = undefined;\n /** @type {string | undefined} */\n this.srcPrefix = undefined;\n /** @type {string | undefined} */\n this.height = undefined;\n /** @type {string | undefined} */\n this.breakoutLink = undefined;\n }\n\n _openFullscreen(replace = false) {\n if (this._runnerSrc) {\n if (replace || this._fullscreenReplace) {\n location.replace(this._runnerSrc);\n } else {\n location.href = this._runnerSrc;\n }\n } else {\n this._fullscreenPending = true;\n if (replace) {\n this._fullscreenReplace = true;\n }\n }\n }\n\n /** @param {MouseEvent} event */\n _fullscreenClick(event) {\n if (\n this.liveId &&\n event.target instanceof HTMLAnchorElement &&\n event.target.hash === `#livesample_fullscreen=${this.liveId}`\n ) {\n event.preventDefault();\n this._openFullscreen();\n }\n }\n\n /** @param {CustomEvent<string>} event */\n _runnerSrcUpdated({ detail }) {\n this._runnerSrc = detail;\n if (this._fullscreenPending) {\n this._openFullscreen();\n }\n const playUrl = new URL(\"/en-US/play\", location.href);\n playUrl.search = new URL(this._runnerSrc).search;\n if (this.srcPrefix)\n playUrl.searchParams.append(\"srcPrefix\", this.srcPrefix);\n this.breakoutLink = playUrl.href;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._fullscreenClick = this._fullscreenClick.bind(this);\n document.addEventListener(\"click\", this._fullscreenClick);\n if (location.hash === `#livesample_fullscreen=${this.liveId}`) {\n this._openFullscreen();\n }\n }\n\n render() {\n return html`\n <div class=\"code-example\">\n <div class=\"example-header\">\n ${this.breakoutLink\n ? html`<mdn-button\n variant=\"secondary\"\n href=${this.breakoutLink}\n target=\"_blank\"\n rel=\"opener\"\n aria-label=${this.l10n(\"example-play-button-title\")}\n title=${this.l10n(\"example-play-button-title\")}\n >${this.l10n(\"example-play-button-label\")}</mdn-button\n >`\n : nothing}\n </div>\n <mdn-play-runner\n @mdn-play-runner-src=${this._runnerSrcUpdated}\n .code=${this.code}\n .allow=${this.allow}\n .sandbox=${[\n ...new Set([\"allow-modals\", ...(this.sandbox?.split(\" \") || [])]),\n ].join(\" \")}\n .srcPrefix=${this.srcPrefix}\n permalink\n style=${styleMap({\n height: this.height\n ? `${this.height}${/[0-9]$/.test(this.height) ? \"px\" : \"\"}`\n : undefined,\n })}\n ></mdn-play-runner>\n </div>\n `;\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener(\"click\", this._fullscreenClick);\n }\n}\n\ncustomElements.define(\"mdn-live-sample-result\", MDNLiveSampleResult);\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import{nothing as r}from\"../lit-html.js\";import{directive as t,Directive as e}from\"../directive.js\";import{setCommittedValue as s}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const i=t(class extends e{constructor(){super(...arguments),this.key=r}render(r,t){return this.key=r,t}update(r,[t,e]){return t!==this.key&&(s(r),this.key=t),e}});export{i as keyed};\n//# sourceMappingURL=keyed.js.map\n"],"names":["MDNLiveSampleResult","Object","location","e","HTMLAnchorElement","URL","document","n","Set","s","customElements","arguments","t"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__="7185";export const __webpack_ids__=["7185"];export const __webpack_modules__={41083:function(e,t,n){e.exports=n.p+"watify_bg.c5a182c47876cd2b.wasm"},12456:function(e,t,n){let a;n.d(t,{default:()=>d,watify:()=>f});let i=null;function r(){return(null===i||0===i.byteLength)&&(i=new Uint8Array(a.memory.buffer)),i}let o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});o.decode();let s=0,l=0,c=new TextEncoder;function f(e){let t=function(e,t,n){if(void 0===n){let n=c.encode(e),a=t(n.length,1)>>>0;return r().subarray(a,a+n.length).set(n),l=n.length,a}let a=e.length,i=t(a,1)>>>0,o=r(),s=0;for(;s<a;s++){let t=e.charCodeAt(s);if(t>127)break;o[i+s]=t}if(s!==a){0!==s&&(e=e.slice(s)),i=n(i,a,a=s+3*e.length,1)>>>0;let t=r().subarray(i+s,i+a);s+=c.encodeInto(e,t).written,i=n(i,a,s,1)>>>0}return l=s,i}(e,a.__wbindgen_malloc,a.__wbindgen_realloc),n=l,i=a.watify(t,n);if(i[3]){let e;throw o=i[2],e=a.__wbindgen_externrefs.get(o),a.__externref_table_dealloc(o),e}var o,s,f,_=(s=i[0],f=i[1],s>>>=0,r().subarray(s/1,s/1+f)).slice();return a.__wbindgen_free(i[0],+i[1],1),_}"encodeInto"in c||(c.encodeInto=function(e,t){let n=c.encode(e);return t.set(n),{read:e.length,written:n.length}});let _=new Set(["basic","cors","default"]);async function b(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&_.has(e.type)&&"application/wasm"!==e.headers.get("Content-Type"))console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}async function u(e){let t;if(void 0!==a)return a;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===e&&(e=new n.U(n(41083)));let l=((t={}).wbg={},t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){var n;return n=e>>>0,(s+=t)>=0x7ff00000&&((o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})).decode(),s=t),o.decode(r().subarray(n,n+t))},t.wbg.__wbindgen_init_externref_table=function(){let e=a.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},t);("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));let{instance:c,module:f}=await b(await e,l);return a=c.exports,u.__wbindgen_wasm_module=f,i=null,a.__wbindgen_start(),a}let d=u}};
2
+ //# sourceMappingURL=7185.278701dcd05fcd30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"7185.278701dcd05fcd30.js","sources":["webpack://@mdn/fred/./node_modules/@mdn/watify/watify.js"],"sourcesContent":["let wasm;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n }\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n * Parses the given WAT text and returns a vector of bytes on success or a JavaScript error on failure.\n *\n * # Arguments\n *\n * * `text` - A string slice containing the WAT text to be parsed.\n *\n * # Returns\n *\n * * `Ok(Vec<u8>)` containing the parsed byte code if parsing is successful.\n * * `Err(JsValue)` if parsing fails, with the error message converted into a JavaScript error value.\n * @param {string} text\n * @returns {Uint8Array}\n */\nexport function watify(text) {\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.watify(ptr0, len0);\n if (ret[3]) {\n throw takeFromExternrefTable0(ret[2]);\n }\n var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v2;\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('watify_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"names":["Uint8Array","TextDecoder","c","TextEncoder","Set","Response","WebAssembly","console","Object","n","Request","URL","fetch"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__="9379";export const __webpack_ids__=["9379"];export const __webpack_modules__={60292:function(e,t,n){n.d(t,{Ar:()=>a,Bc:()=>er,Gw:()=>K,OO:()=>ef,et:()=>l,wm:()=>X,yU:()=>eh});var o=n(40865),i=n(44547),r=n(30010);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.label.localeCompare(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 R=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 T=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 _=[{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)}],J=o.sj.define({combine:e=>e.length?e[0]:_}),q=o.Nb.highest(i.w4.compute([J],e=>e.facet(J)));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),T,eu,P]}let ef=[{key:"Ctrl-Space",run:R},{mac:"Alt-`",run:R},{mac:"Alt-i",run:R},{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]:[]))},83814:function(e,t,n){n.d(t,{Yc:()=>eE,b6:()=>y,cL:()=>I,pw:()=>eM});var o=n(40865),i=n(44547),r=n(30010),s=n(64693);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 R(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function T({state:e,dispatch:t},n){let o=F(e.selection,n);return!o.eq(e.selection,!0)&&(t(R(e,o)),!0)}function B(e,t){return o.OF.cursor(t?e.to:e.from)}function L(e,t){return T(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 T(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 T(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)})}"undefined"!=typeof Intl&&Intl.Segmenter;let $=e=>V(e,!1),j=e=>V(e,!0);function _(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 J(e,t){let n,o=_(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(R(r,s),{effects:n}),!0}let q=e=>J(e,!1),K=e=>J(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(R(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,_(e).height))}let ei=e=>eo(e,!1),er=e=>eo(e,!0),es=({state:e,dispatch:t})=>(t(R(e,{anchor:0})),!0),el=({state:e,dispatch:t})=>(t(R(e,{anchor:e.doc.length})),!0),ea=({state:e,dispatch:t})=>(t(R(e,{anchor:e.selection.main.anchor,head:0})),!0),ec=({state:e,dispatch:t})=>(t(R(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(R(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)});return t(e.update({changes:o,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=>T(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=>T(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=>T(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=>T(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(R(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(R(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(R(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=>T(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=>T(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=>T(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=>T(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}},91075:function(e,t,n){n.d(t,{V0:()=>s});var o=n(44547),i=n(30010),r=n(83814);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=9379.edc05ee9f550804e.js.map