@rse/ase 1.0.7 → 2.0.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.
- package/dst/ase-agent-definition-api.d.ts +184 -0
- package/dst/ase-agent-definition-api.js +6 -0
- package/dst/ase-agent-definition-builtin/condenser.js +42 -0
- package/dst/ase-agent-definition-builtin/editor.js +45 -0
- package/dst/ase-agent-definition-builtin/estimator.js +98 -0
- package/dst/ase-agent-definition-builtin/implementer.js +121 -0
- package/dst/ase-agent-definition-builtin/integrator.js +56 -0
- package/dst/ase-agent-definition-builtin/qualifier.js +61 -0
- package/dst/ase-agent-definition-builtin/rebooter.js +41 -0
- package/dst/ase-agent-definition-builtin/researcher.js +77 -0
- package/dst/ase-agent-definition-core.js +827 -0
- package/dst/ase-agent-fleet.js +772 -0
- package/dst/ase-agent-process.js +232 -0
- package/dst/ase-agent-relay-client.js +509 -0
- package/dst/ase-agent-relay-core.js +213 -0
- package/dst/ase-agent-relay-server-bind.js +242 -0
- package/dst/ase-agent-relay-server-cli.js +50 -0
- package/dst/ase-agent-runtime-claim.js +189 -0
- package/dst/ase-agent-runtime-engine.js +1100 -0
- package/dst/ase-agent-runtime-exec.js +275 -0
- package/dst/ase-agent-runtime-phase.js +581 -0
- package/dst/ase-agent-runtime-request.js +272 -0
- package/dst/ase-agent-runtime-tool.js +207 -0
- package/dst/ase-agent-runtime.js +1316 -0
- package/dst/ase-agent.js +65 -0
- package/dst/ase-artifact.js +6 -5
- package/dst/ase-config-core.js +465 -0
- package/dst/ase-config-schema.js +351 -0
- package/dst/ase-config-scope.js +172 -0
- package/dst/ase-config.js +25 -585
- package/dst/ase-hook.js +228 -111
- package/dst/ase-lib-daemon-cli.js +130 -0
- package/dst/ase-lib-hash.js +20 -0
- package/dst/{ase-log.js → ase-lib-log.js} +40 -7
- package/dst/ase-lib-server-bind.js +115 -0
- package/dst/ase-lib-server-cli.js +474 -0
- package/dst/{ase-table.js → ase-lib-table.js} +1 -1
- package/dst/{ase-version.js → ase-lib-version.js} +3 -0
- package/dst/ase-man.js +96 -0
- package/dst/ase-mcp.js +166 -13
- package/dst/{ase-getopt.js → ase-service-getopt.js} +82 -80
- package/dst/{ase-markdown.js → ase-service-markdown.js} +18 -11
- package/dst/ase-service-otel.js +1246 -0
- package/dst/{ase-skills.js → ase-service-skills.js} +29 -64
- package/dst/ase-service-state.js +101 -0
- package/dst/ase-service.js +251 -76
- package/dst/ase-setup-common.js +141 -0
- package/dst/ase-setup-mcp.js +359 -0
- package/dst/ase-setup-settings.js +837 -0
- package/dst/ase-setup.js +113 -869
- package/dst/ase-spec.js +31 -19
- package/dst/ase-statusline.js +108 -43
- package/dst/ase-task-board-core.js +739 -0
- package/dst/ase-task-board-filter.js +127 -0
- package/dst/ase-task-board-flow.js +237 -0
- package/dst/ase-task-board-graph.js +497 -0
- package/dst/ase-task-board-stats.js +263 -0
- package/dst/ase-task-board-tui-control.js +775 -0
- package/dst/ase-task-board-tui-model.js +1008 -0
- package/dst/ase-task-board-tui-popup.js +626 -0
- package/dst/ase-task-board-tui-style.js +106 -0
- package/dst/ase-task-board-tui-view.js +847 -0
- package/dst/ase-task-board-tui.js +189 -0
- package/dst/ase-task-board-web-client.css +1 -0
- package/dst/ase-task-board-web-client.html +20 -0
- package/dst/ase-task-board-web-client.js +81 -0
- package/dst/ase-task-board-web-server.js +823 -0
- package/dst/ase-task-board.js +134 -0
- package/dst/ase-task-format.js +757 -0
- package/dst/ase-task-request.js +208 -0
- package/dst/ase-task-store-client.js +495 -0
- package/dst/ase-task-store-core.js +804 -0
- package/dst/ase-task-store-issues.js +237 -0
- package/dst/ase-task-store-plugin-api.js +6 -0
- package/dst/ase-task-store-plugin-ase.js +484 -0
- package/dst/ase-task-store-plugin-delegate.js +137 -0
- package/dst/ase-task-store-plugin-gitea.js +666 -0
- package/dst/ase-task-store-plugin-github.js +696 -0
- package/dst/ase-task-store-plugin-gitlab.js +668 -0
- package/dst/ase-task-store-server-bind.js +538 -0
- package/dst/ase-task-store-server-cli.js +154 -0
- package/dst/ase-task.js +1335 -357
- package/dst/{ase-compat.js → ase-util-compat.js} +2 -2
- package/dst/{ase-diagram.js → ase-util-diagram.js} +107 -32
- package/dst/{ase-meta.js → ase-util-meta.js} +2 -2
- package/dst/{ase-metric.js → ase-util-metric.js} +2 -2
- package/dst/{ase-mint.js → ase-util-mint.js} +19 -12
- package/dst/{ase-worktree.js → ase-util-worktree.js} +30 -19
- package/dst/ase-util.js +20 -0
- package/dst/ase.js +108 -32
- package/dst/man/ase-agent-adhoc.1 +515 -0
- package/dst/man/ase-agent-condenser.1 +193 -0
- package/dst/man/ase-agent-editor.1 +212 -0
- package/dst/man/ase-agent-estimator.1 +214 -0
- package/dst/man/ase-agent-fleet.1 +185 -0
- package/dst/man/ase-agent-implementer.1 +233 -0
- package/dst/man/ase-agent-integrator.1 +213 -0
- package/dst/man/ase-agent-qualifier.1 +214 -0
- package/dst/man/ase-agent-rebooter.1 +193 -0
- package/dst/man/ase-agent-relay.1 +128 -0
- package/dst/man/ase-agent-researcher.1 +217 -0
- package/dst/man/ase-agent.1 +264 -0
- package/dst/man/ase-artifact-list.1 +38 -0
- package/dst/man/ase-artifact-name.1 +39 -0
- package/dst/man/ase-artifact.1 +56 -0
- package/dst/man/ase-config-delete.1 +45 -0
- package/dst/man/ase-config-edit.1 +48 -0
- package/dst/man/ase-config-get.1 +46 -0
- package/dst/man/ase-config-init.1 +60 -0
- package/dst/man/ase-config-list.1 +42 -0
- package/dst/man/ase-config-set.1 +52 -0
- package/dst/man/ase-config.1 +225 -0
- package/dst/man/ase-hook-permission-request.1 +36 -0
- package/dst/man/ase-hook-pre-tool-use.1 +59 -0
- package/dst/man/ase-hook-session-end.1 +47 -0
- package/dst/man/ase-hook-session-persona.1 +37 -0
- package/dst/man/ase-hook-session-start.1 +81 -0
- package/dst/man/ase-hook-stop.1 +34 -0
- package/dst/man/ase-hook-user-prompt-submit.1 +34 -0
- package/dst/man/ase-hook.1 +51 -0
- package/dst/man/ase-man.1 +67 -0
- package/dst/man/ase-mcp.1 +61 -0
- package/dst/man/ase-service-log.1 +43 -0
- package/dst/man/ase-service-send.1 +47 -0
- package/dst/man/ase-service-start.1 +54 -0
- package/dst/man/ase-service-status.1 +46 -0
- package/dst/man/ase-service-stop.1 +37 -0
- package/dst/man/ase-service.1 +85 -0
- package/dst/man/ase-setup-disable.1 +44 -0
- package/dst/man/ase-setup-enable.1 +45 -0
- package/dst/man/ase-setup-install.1 +73 -0
- package/dst/man/ase-setup-mcp.1 +124 -0
- package/dst/man/ase-setup-status.1 +60 -0
- package/dst/man/ase-setup-statusline.1 +92 -0
- package/dst/man/ase-setup-telemetry.1 +92 -0
- package/dst/man/ase-setup-uninstall.1 +59 -0
- package/dst/man/ase-setup-update.1 +64 -0
- package/dst/man/ase-setup.1 +93 -0
- package/dst/man/ase-spec-export.1 +62 -0
- package/dst/man/ase-spec-lint.1 +40 -0
- package/dst/man/ase-spec-preview.1 +40 -0
- package/dst/man/ase-spec.1 +46 -0
- package/dst/man/ase-statusline.1 +189 -0
- package/dst/man/ase-task-assign.1 +71 -0
- package/dst/man/ase-task-board.1 +384 -0
- package/dst/man/ase-task-delete.1 +35 -0
- package/dst/man/ase-task-edit.1 +46 -0
- package/dst/man/ase-task-idscheme.1 +65 -0
- package/dst/man/ase-task-lifecycle.1 +57 -0
- package/dst/man/ase-task-list.1 +47 -0
- package/dst/man/ase-task-load.1 +36 -0
- package/dst/man/ase-task-newid.1 +61 -0
- package/dst/man/ase-task-purge.1 +37 -0
- package/dst/man/ase-task-rename.1 +44 -0
- package/dst/man/ase-task-request.1 +61 -0
- package/dst/man/ase-task-save.1 +48 -0
- package/dst/man/ase-task-status.1 +55 -0
- package/dst/man/ase-task-store.1 +194 -0
- package/dst/man/ase-task-view.1 +40 -0
- package/dst/man/ase-task.1 +160 -0
- package/dst/man/ase-util-compat.1 +25 -0
- package/dst/man/ase-util-diagram.1 +76 -0
- package/dst/man/ase-util-meta.1 +45 -0
- package/dst/man/ase-util-metric.1 +54 -0
- package/dst/man/ase-util-mint.1 +59 -0
- package/dst/man/ase-util-worktree.1 +72 -0
- package/dst/man/ase-util.1 +50 -0
- package/dst/man/ase.1 +124 -0
- package/package.json +79 -21
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/agents/ase-meta-diagram.md +12 -8
- package/plugin/agents/ase-repo-review.md +322 -0
- package/plugin/hooks/hooks-codex.json +5 -0
- package/plugin/hooks/hooks-copilot.json +5 -0
- package/plugin/hooks/hooks.json +8 -0
- package/plugin/meta/ase-common-approach.md +117 -0
- package/plugin/meta/ase-common-changeset.md +256 -0
- package/plugin/meta/ase-common-code.md +10 -173
- package/plugin/meta/ase-common-grill.md +317 -0
- package/plugin/meta/ase-common-resolve.md +305 -0
- package/plugin/meta/ase-common-task.md +83 -4
- package/plugin/meta/ase-constitution.md +0 -2
- package/plugin/meta/ase-format-specbook.md +208 -25
- package/plugin/meta/ase-format-specbook.yaml +242 -851
- package/plugin/meta/ase-format-task.md +669 -125
- package/plugin/meta/ase-persona.md +3 -4
- package/plugin/meta/ase-skill.md +9 -0
- package/plugin/mods/ase-mods.ts +409 -0
- package/plugin/mods/claude-code.d.ts +13417 -0
- package/plugin/skills/ase-arch-analyze/SKILL.md +1 -1
- package/plugin/skills/ase-arch-analyze/help.md +2 -2
- package/plugin/skills/ase-code-analyze/SKILL.md +59 -8
- package/plugin/skills/ase-code-analyze/help.md +29 -4
- package/plugin/skills/ase-code-edit/SKILL.md +107 -181
- package/plugin/skills/ase-code-edit/help.md +118 -31
- package/plugin/skills/ase-code-lint/SKILL.md +64 -13
- package/plugin/skills/ase-code-lint/help.md +32 -2
- package/plugin/skills/ase-docs-proofread/SKILL.md +4 -4
- package/plugin/skills/ase-docs-proofread/help.md +1 -1
- package/plugin/skills/ase-docs-refine/SKILL.md +4 -4
- package/plugin/skills/ase-docs-shorten/SKILL.md +4 -4
- package/plugin/skills/ase-help-intent/data.md +2164 -1087
- package/plugin/skills/ase-help-intent/help.md +1 -1
- package/plugin/skills/ase-help-skill/catalog.md +12 -9
- package/plugin/skills/ase-meta-brainstorm/SKILL.md +1 -1
- package/plugin/skills/ase-meta-config/SKILL.md +3 -4
- package/plugin/skills/ase-meta-config/help.md +31 -10
- package/plugin/skills/ase-meta-mint/SKILL.md +5 -5
- package/plugin/skills/ase-meta-mint/help.md +10 -5
- package/plugin/skills/ase-meta-why/help.md +1 -1
- package/plugin/skills/ase-meta-workflow/SKILL.md +7 -7
- package/plugin/skills/ase-meta-workflow/help.md +4 -4
- package/plugin/skills/ase-meta-workflow/sample.md +3 -3
- package/plugin/skills/ase-meta-workflow/workflow.txt +22 -18
- package/plugin/skills/{ase-meta-changelog → ase-repo-changelog}/SKILL.md +4 -3
- package/plugin/skills/{ase-meta-changelog → ase-repo-changelog}/help.md +5 -5
- package/plugin/skills/{ase-meta-commit → ase-repo-commit}/SKILL.md +6 -6
- package/plugin/skills/{ase-meta-commit → ase-repo-commit}/help.md +5 -5
- package/plugin/skills/{ase-meta-diff → ase-repo-diff}/SKILL.md +6 -6
- package/plugin/skills/{ase-meta-diff → ase-repo-diff}/help.md +8 -8
- package/plugin/skills/{ase-code-dissect → ase-repo-dissect}/SKILL.md +19 -19
- package/plugin/skills/{ase-code-dissect → ase-repo-dissect}/help.md +10 -12
- package/plugin/skills/ase-repo-merge/SKILL.md +346 -0
- package/plugin/skills/ase-repo-merge/help.md +107 -0
- package/plugin/skills/ase-repo-resolve/SKILL.md +158 -0
- package/plugin/skills/ase-repo-resolve/help.md +102 -0
- package/plugin/skills/ase-repo-review/SKILL.md +406 -0
- package/plugin/skills/ase-repo-review/help.md +181 -0
- package/plugin/skills/ase-spec-edit/SKILL.md +117 -183
- package/plugin/skills/ase-spec-edit/help.md +107 -26
- package/plugin/skills/ase-sync-reconcile/help.md +1 -1
- package/plugin/skills/ase-task-assign/SKILL.md +111 -0
- package/plugin/skills/ase-task-assign/help.md +119 -0
- package/plugin/skills/ase-task-condense/SKILL.md +21 -21
- package/plugin/skills/ase-task-condense/help.md +12 -10
- package/plugin/skills/ase-task-delete/SKILL.md +1 -1
- package/plugin/skills/ase-task-dissect/SKILL.md +71 -48
- package/plugin/skills/ase-task-dissect/help.md +10 -9
- package/plugin/skills/ase-task-edit/SKILL.md +379 -94
- package/plugin/skills/ase-task-edit/help.md +95 -22
- package/plugin/skills/ase-task-estimate/SKILL.md +492 -0
- package/plugin/skills/ase-task-estimate/help.md +158 -0
- package/plugin/skills/ase-task-grill/SKILL.md +246 -138
- package/plugin/skills/ase-task-grill/help.md +129 -26
- package/plugin/skills/ase-task-id/SKILL.md +8 -1
- package/plugin/skills/ase-task-id/help.md +6 -3
- package/plugin/skills/ase-task-implement/SKILL.md +535 -145
- package/plugin/skills/ase-task-implement/help.md +138 -47
- package/plugin/skills/ase-task-integrate/SKILL.md +549 -0
- package/plugin/skills/ase-task-integrate/help.md +187 -0
- package/plugin/skills/ase-task-list/SKILL.md +55 -23
- package/plugin/skills/ase-task-list/help.md +45 -21
- package/plugin/skills/ase-task-reboot/SKILL.md +84 -43
- package/plugin/skills/ase-task-reboot/help.md +28 -8
- package/plugin/skills/ase-task-rename/SKILL.md +10 -2
- package/plugin/skills/ase-task-research/SKILL.md +386 -0
- package/plugin/skills/ase-task-research/help.md +102 -0
- package/plugin/skills/ase-task-status/SKILL.md +137 -0
- package/plugin/skills/ase-task-status/help.md +80 -0
- package/plugin/skills/ase-task-view/SKILL.md +49 -24
- package/plugin/skills/ase-task-view/help.md +19 -9
- package/plugin/agents/ase-meta-review.md +0 -187
- package/plugin/skills/ase-code-craft/SKILL.md +0 -264
- package/plugin/skills/ase-code-craft/help.md +0 -122
- package/plugin/skills/ase-code-refactor/SKILL.md +0 -232
- package/plugin/skills/ase-code-refactor/help.md +0 -109
- package/plugin/skills/ase-code-resolve/SKILL.md +0 -289
- package/plugin/skills/ase-code-resolve/help.md +0 -116
- package/plugin/skills/ase-meta-review/SKILL.md +0 -210
- package/plugin/skills/ase-meta-review/help.md +0 -96
- package/plugin/skills/ase-task-preflight/SKILL.md +0 -166
- package/plugin/skills/ase-task-preflight/help.md +0 -82
- /package/dst/{ase-ignore.js → ase-lib-ignore.js} +0 -0
- /package/dst/{ase-stdio.js → ase-lib-stdio.js} +0 -0
- /package/dst/{ase-kv.js → ase-service-kv.js} +0 -0
- /package/dst/{ase-sleep.js → ase-service-sleep.js} +0 -0
- /package/dst/{ase-timestamp.js → ase-service-timestamp.js} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function l(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var u={},d=[],f=()=>{},p=()=>!1,m=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),h=e=>e.startsWith(`onUpdate:`),g=Object.assign,_=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},v=Object.prototype.hasOwnProperty,y=(e,t)=>v.call(e,t),b=Array.isArray,x=e=>re(e)===`[object Map]`,S=e=>re(e)===`[object Set]`,C=e=>re(e)===`[object Date]`,w=e=>typeof e==`function`,T=e=>typeof e==`string`,ee=e=>typeof e==`symbol`,E=e=>typeof e==`object`&&!!e,te=e=>(E(e)||w(e))&&w(e.then)&&w(e.catch),ne=Object.prototype.toString,re=e=>ne.call(e),ie=e=>re(e).slice(8,-1),ae=e=>re(e)===`[object Object]`,oe=e=>T(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,D=l(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),se=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ce=/-\w/g,le=se(e=>e.replace(ce,e=>e.slice(1).toUpperCase())),ue=/\B([A-Z])/g,de=se(e=>e.replace(ue,`-$1`).toLowerCase()),fe=se(e=>e.charAt(0).toUpperCase()+e.slice(1)),pe=se(e=>e?`on${fe(e)}`:``),me=(e,t)=>!Object.is(e,t),he=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ge=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},_e=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ve,ye=()=>ve||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function be(e){if(b(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=T(r)?we(r):be(r);if(i)for(let e in i)t[e]=i[e]}return t}if(T(e)||E(e))return e}var xe=/;(?![^(]*\))/g,Se=/:([^]+)/,Ce=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function we(e){let t={};return e.replace(Ce,e=>e.startsWith(`/*`)?``:e).split(xe).forEach(e=>{if(e){let n=e.split(Se);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function O(e){let t=``;if(T(e))t=e;else if(b(e))for(let n=0;n<e.length;n++){let r=O(e[n]);r&&(t+=r+` `)}else if(E(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var Te=l(`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`);function Ee(e){return!!e||e===``}function De(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=je(e[i],t[i],n);return r}function Oe(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&je(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function ke(e,t,n){let r=x(e),i=x(t);if(r||i||(r=S(e),i=S(t),r||i))return r&&i?Oe(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!je(e[r],t[r],n))return!1}return String(e)===String(t)}function Ae(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function je(e,t,n){if(e===t)return!0;let r=C(e),i=C(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=ee(e),i=ee(t),r||i?e===t:(r=b(e),i=b(t),r||i?r&&i?Ae(e,t,n,De):!1:(r=E(e),i=E(t),r||i?!r||!i?!1:Ae(e,t,n,ke):String(e)===String(t))))}var Me=e=>!!(e&&e.__v_isRef===!0),k=e=>T(e)?e:e==null?``:b(e)||E(e)&&(e.toString===ne||!w(e.toString))?Me(e)?k(e.value):JSON.stringify(e,Ne,2):String(e),Ne=(e,t)=>Me(t)?Ne(e,t.value):x(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Pe(t,r)+` =>`]=n,e),{})}:S(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Pe(e))}:ee(t)?Pe(t):E(t)&&!b(t)&&!ae(t)?String(t):t,Pe=(e,t=``)=>ee(e)?`Symbol(${e.description??t})`:e,Fe,Ie=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Fe&&(Fe.active?(this.parent=Fe,this.index=(Fe.scopes||(Fe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Fe;try{return Fe=this,e()}finally{Fe=t}}}on(){++this._on===1&&(this.prevScope=Fe,Fe=this)}off(){if(this._on>0&&--this._on===0){if(Fe===this)Fe=this.prevScope;else{let e=Fe;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Le(){return Fe}var Re,ze=new WeakSet,Be=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Fe&&(Fe.active?Fe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ze.has(this)&&(ze.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||We(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rt(this),qe(this);let e=Re,t=$e;Re=this,$e=!0;try{return this.fn()}finally{Je(this),Re=e,$e=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ze(e);this.deps=this.depsTail=void 0,rt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ze.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ye(this)&&this.run()}get dirty(){return Ye(this)}},Ve=0,He,Ue;function We(e,t=!1){e.flags|=8,t?(e.next=Ue,Ue=e):(e.next=He,He=e)}function Ge(){Ve++}function Ke(){if(--Ve>0)return;if(Ue){let e=Ue;for(Ue=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;He;){let t=He;for(He=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function qe(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Je(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ze(r),Qe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ye(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Xe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Xe(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===it)||(e.globalVersion=it,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ye(e))))return;e.flags|=2;let t=e.dep,n=Re,r=$e;Re=e,$e=!0;try{qe(e);let n=e.fn(e._value);(t.version===0||me(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Re=n,$e=r,Je(e),e.flags&=-3}}function Ze(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ze(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Qe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var $e=!0,et=[];function tt(){et.push($e),$e=!1}function nt(){let e=et.pop();$e=e===void 0||e}function rt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Re;Re=void 0;try{t()}finally{Re=e}}}var it=0,at=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},ot=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Re||!$e||Re===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Re)t=this.activeLink=new at(Re,this),Re.deps?(t.prevDep=Re.depsTail,Re.depsTail.nextDep=t,Re.depsTail=t):Re.deps=Re.depsTail=t,st(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Re.depsTail,t.nextDep=void 0,Re.depsTail.nextDep=t,Re.depsTail=t,Re.deps===t&&(Re.deps=e)}return t}trigger(e){this.version++,it++,this.notify(e)}notify(e){Ge();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ke()}}};function st(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)st(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var ct=new WeakMap,lt=Symbol(``),ut=Symbol(``),dt=Symbol(``);function ft(e,t,n){if($e&&Re){let t=ct.get(e);t||ct.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new ot),r.map=t,r.key=n),r.track()}}function pt(e,t,n,r,i,a){let o=ct.get(e);if(!o){it++;return}let s=e=>{e&&e.trigger()};if(Ge(),t===`clear`)o.forEach(s);else{let i=b(e),a=i&&oe(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===dt||!ee(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(dt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(lt)),x(e)&&s(o.get(ut)));break;case`delete`:i||(s(o.get(lt)),x(e)&&s(o.get(ut)));break;case`set`:x(e)&&s(o.get(lt))}}Ke()}function mt(e){let t=nn(e);return t===e||(ft(t,`iterate`,dt),en(e))?t:$t(e)?Qt(e)?t.map(e=>on(an(e))):t.map(on):t.map(an)}function ht(e){return ft(e=nn(e),`iterate`,dt),e}function gt(e,t){return $t(e)?on(Qt(e)?an(t):t):an(t)}var _t={__proto__:null,[Symbol.iterator](){return vt(this,Symbol.iterator,e=>gt(this,e))},concat(...e){return mt(this).concat(...e.map(e=>b(e)?mt(e):e))},entries(){return vt(this,`entries`,e=>(e[1]=gt(this,e[1]),e))},every(e,t){return xt(this,`every`,e,t,void 0,arguments)},filter(e,t){return xt(this,`filter`,e,t,e=>e.map(e=>gt(this,e)),arguments)},find(e,t){return xt(this,`find`,e,t,e=>gt(this,e),arguments)},findIndex(e,t){return xt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return xt(this,`findLast`,e,t,e=>gt(this,e),arguments)},findLastIndex(e,t){return xt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return xt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Ct(this,`includes`,e)},indexOf(...e){return Ct(this,`indexOf`,e)},join(e){return mt(this).join(e)},lastIndexOf(...e){return Ct(this,`lastIndexOf`,e)},map(e,t){return xt(this,`map`,e,t,void 0,arguments)},pop(){return wt(this,`pop`)},push(...e){return wt(this,`push`,e)},reduce(e,...t){return St(this,`reduce`,e,t)},reduceRight(e,...t){return St(this,`reduceRight`,e,t)},shift(){return wt(this,`shift`)},some(e,t){return xt(this,`some`,e,t,void 0,arguments)},splice(...e){return wt(this,`splice`,e)},toReversed(){return mt(this).toReversed()},toSorted(e){return mt(this).toSorted(e)},toSpliced(...e){return mt(this).toSpliced(...e)},unshift(...e){return wt(this,`unshift`,e)},values(){return vt(this,`values`,e=>gt(this,e))}};function vt(e,t,n){let r=ht(e),i=r[t],a=i.call(r);if(r!==e&&!en(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>yt(a.next(),n),i!==bt[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>yt(a._next(),n)}return a}function yt(e,t){return e.done||(e.value=t(e.value)),e}var bt=Array.prototype;function xt(e,t,n,r,i,a){let o=ht(e),s=o!==e&&!en(e),c=o[t];if(c!==bt[t]){let t=c.apply(e,a);return s?an(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,gt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function St(e,t,n,r){let i=ht(e),a=i!==e&&!en(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=gt(e,t)),n.call(this,t,gt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?gt(e,c):c}function Ct(e,t,n){let r=nn(e);ft(r,`iterate`,dt);let i=r[t](...n);return(i===-1||i===!1)&&tn(n[0])?(n[0]=nn(n[0]),r[t](...n)):i}function wt(e,t,n=[]){tt(),Ge();let r=nn(e)[t].apply(e,n);return Ke(),nt(),r}var Tt=l(`__proto__,__v_isRef,__isVue`),Et=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(ee));function Dt(e){ee(e)||(e=String(e));let t=nn(this);return ft(t,`has`,e),t.hasOwnProperty(e)}var Ot=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Kt:Gt:i?Wt:Ut).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=b(e);if(!r){let e;if(a&&(e=_t[t]))return e;if(t===`hasOwnProperty`)return Dt}let o=Reflect.get(e,t,sn(e)?e:n);if((ee(t)?Et.has(t):Tt(t))||(r||ft(e,`get`,t),i))return o;if(sn(o)){let e=a&&oe(t)?o:o.value;return r&&E(e)?Xt(e):e}return E(o)?r?Xt(o):Jt(o):o}},kt=class extends Ot{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=b(e)&&oe(t);if(!this._isShallow){let e=$t(i);if(!en(n)&&!$t(n)&&(i=nn(i),n=nn(n)),!a&&sn(i)&&!sn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:y(e,t),s=Reflect.set(e,t,n,sn(e)?e:r);return e===nn(r)&&s&&(o?me(n,i)&&pt(e,`set`,t,n,i):pt(e,`add`,t,n)),s}deleteProperty(e,t){let n=y(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&pt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!ee(t)||!Et.has(t))&&ft(e,`has`,t),n}ownKeys(e){return ft(e,`iterate`,b(e)?`length`:lt),Reflect.ownKeys(e)}},At=class extends Ot{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},jt=new kt,Mt=new At,Nt=new kt(!0),Pt=e=>e,Ft=e=>Reflect.getPrototypeOf(e);function It(e,t,n){return function(...r){let i=this.__v_raw,a=nn(i),o=x(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Pt:t?on:an;return!t&&ft(a,`iterate`,c?ut:lt),g(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Lt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Rt(e,t){let n={get(n){let r=this.__v_raw,i=nn(r),a=nn(n);e||(me(n,a)&&ft(i,`get`,n),ft(i,`get`,a));let{has:o}=Ft(i),s=t?Pt:e?on:an;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&ft(nn(t),`iterate`,lt),t.size},has(t){let n=this.__v_raw,r=nn(n),i=nn(t);return e||(me(t,i)&&ft(r,`has`,t),ft(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=nn(a),s=t?Pt:e?on:an;return!e&&ft(o,`iterate`,lt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return g(n,e?{add:Lt(`add`),set:Lt(`set`),delete:Lt(`delete`),clear:Lt(`clear`)}:{add(e){let n=nn(this),r=Ft(n),i=nn(e),a=!t&&!en(e)&&!$t(e)?i:e;return r.has.call(n,a)||me(e,a)&&r.has.call(n,e)||me(i,a)&&r.has.call(n,i)||(n.add(a),pt(n,`add`,a,a)),this},set(e,n){!t&&!en(n)&&!$t(n)&&(n=nn(n));let r=nn(this),{has:i,get:a}=Ft(r),o=i.call(r,e);o||=(e=nn(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?me(n,s)&&pt(r,`set`,e,n,s):pt(r,`add`,e,n),this},delete(e){let t=nn(this),{has:n,get:r}=Ft(t),i=n.call(t,e);i||=(e=nn(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&pt(t,`delete`,e,void 0,a),o},clear(){let e=nn(this),t=e.size!==0,n=e.clear();return t&&pt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=It(r,e,t)}),n}function zt(e,t){let n=Rt(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(y(n,i)&&i in r?n:r,i,a)}var Bt={get:zt(!1,!1)},Vt={get:zt(!1,!0)},Ht={get:zt(!0,!1)},Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap;function qt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Jt(e){return $t(e)?e:Zt(e,!1,jt,Bt,Ut)}function Yt(e){return Zt(e,!1,Nt,Vt,Wt)}function Xt(e){return Zt(e,!0,Mt,Ht,Gt)}function Zt(e,t,n,r,i){if(!E(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=qt(ie(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Qt(e){return $t(e)?Qt(e.__v_raw):!!(e&&e.__v_isReactive)}function $t(e){return!!(e&&e.__v_isReadonly)}function en(e){return!!(e&&e.__v_isShallow)}function tn(e){return e?!!e.__v_raw:!1}function nn(e){let t=e&&e.__v_raw;return t?nn(t):e}function rn(e){return!y(e,`__v_skip`)&&Object.isExtensible(e)&&ge(e,`__v_skip`,!0),e}var an=e=>E(e)?Jt(e):e,on=e=>E(e)?Xt(e):e;function sn(e){return e?e.__v_isRef===!0:!1}function A(e){return ln(e,!1)}function cn(e){return ln(e,!0)}function ln(e,t){return sn(e)?e:new un(e,t)}var un=class{constructor(e,t){this.dep=new ot,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:nn(e),this._value=t?e:an(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||en(e)||$t(e);e=n?e:nn(e),me(e,t)&&(this._rawValue=e,this._value=n?e:an(e),this.dep.trigger())}};function j(e){return sn(e)?e.value:e}var dn={get:(e,t,n)=>t===`__v_raw`?e:j(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return sn(i)&&!sn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function fn(e){return Qt(e)?e:new Proxy(e,dn)}var pn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ot(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=it-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Re!==this)return We(this,!0),!0}get value(){let e=this.dep.track();return Xe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function mn(e,t,n=!1){let r,i;return w(e)?r=e:(r=e.get,i=e.set),new pn(r,i,n)}var hn={},gn=new WeakMap,_n=void 0;function vn(e,t=!1,n=_n){if(n){let t=gn.get(n);t||gn.set(n,t=[]),t.push(e)}}function yn(e,t,n=u){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:en(e)||i===!1||i===0?bn(e,1):bn(e),d,p,m,h,g=!1,v=!1;if(sn(e)?(p=()=>e.value,g=en(e)):Qt(e)?(p=()=>l(e),g=!0):b(e)?(v=!0,g=e.some(e=>Qt(e)||en(e)),p=()=>e.map(e=>{if(sn(e))return e.value;if(Qt(e))return l(e);if(w(e))return c?c(e,2):e()})):p=w(e)?t?c?()=>c(e,2):e:()=>{if(m){tt();try{m()}finally{nt()}}let t=_n;_n=d;try{return c?c(e,3,[h]):e(h)}finally{_n=t}}:f,t&&i){let e=p,t=i===!0?1/0:i;p=()=>bn(e(),t)}let y=Le(),x=()=>{d.stop(),y&&y.active&&_(y.effects,d)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{x()}}}let S=v?Array(e.length).fill(hn):hn,C=e=>{if(d.flags&1&&(d.dirty||e)){if(t){let n=d.run();if(e||i||g||(v?n.some((e,t)=>me(e,S[t])):me(n,S))){let e=_n;tt();try{m&&m(),_n=d;let e=[n,S===hn?void 0:v&&S[0]===hn?[]:S,h];S=n,c?c(t,3,e):t(...e)}finally{_n=e,nt()}}}else d.run()}};return s&&s(C),d=new Be(p),d.scheduler=o?()=>o(C,!1):C,h=e=>vn(e,!1,d),m=d.onStop=()=>{let e=gn.get(d);if(e){if(c)c(e,4);else for(let t of e)t();gn.delete(d)}},t?r?C(!0):S=d.run():o?o(C.bind(null,!0),!0):d.run(),x.pause=d.pause.bind(d),x.resume=d.resume.bind(d),x.stop=x,x}function bn(e,t=1/0,n){if(t<=0||!E(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,sn(e))bn(e.value,t,n);else if(b(e))for(let r=0;r<e.length;r++)bn(e[r],t,n);else if(S(e)||x(e))e.forEach(e=>{bn(e,t,n)});else if(ae(e)){for(let r in e)bn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&bn(e[r],t,n)}return e}function xn(e,t,n,r){try{return r?e(...r):e()}catch(e){Cn(e,t,n)}}function Sn(e,t,n,r){if(w(e)){let i=xn(e,t,n,r);return i&&te(i)&&i.catch(e=>{Cn(e,t,n)}),i}if(b(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Sn(e[a],t,n,r));return i}}function Cn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||u;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){tt(),xn(a,null,10,[e,i,o]),nt();return}}wn(e,n,i,r,o)}function wn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Tn=[],En=-1,Dn=[],On=null,kn=0,An=Promise.resolve(),jn=null;function Mn(e){let t=jn||An;return e?t.then(this?e.bind(this):e):t}function Nn(e){let t=En+1,n=Tn.length;for(;t<n;){let r=t+n>>>1,i=Tn[r],a=Vn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Pn(e){if(!(e.flags&1)){let t=Vn(e),n=Tn[Tn.length-1];!n||!(e.flags&2)&&t>=Vn(n)?Tn.push(e):Tn.splice(Nn(t),0,e),e.flags|=1,Fn()}}function Fn(){jn||=An.then(Hn)}function In(e){if(!b(e))On&&e.id===-1?On.splice(kn+1,0,e):e.flags&1||(Dn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Dn.push(e[t]);Fn()}function Ln(e,t,n,r=En+1){for(;r<Tn.length;r++){let n=Tn[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;Tn.splice(r,1),r=e?r-1:En,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Rn(e,t,n=0){if(Dn.length){let e=Dn,r=0;if(t){e=[];for(let i=0;i<Dn.length;i++){let a=Dn[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?Dn[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>Vn(e)-Vn(t));if(Dn.length=r,On){for(let e=0;e<i.length;e++)On.push(i[e]);return}for(On=i,kn=0;kn<On.length;kn++){let e=On[kn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}On=null,kn=0}}var zn=!1;function Bn(e,t){if(zn){e();return}let n=t===void 0?void 0:new Set(Dn);e(),zn=!0;try{Ln(void 0,t),Rn(void 0,n,t)}finally{zn=!1}}var Vn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Hn(e){try{for(En=0;En<Tn.length;En++){let e=Tn[En];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),xn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;En<Tn.length;En++){let e=Tn[En];e&&(e.flags&=-2)}En=-1,Tn.length=0,Rn(e),jn=null,(Tn.length||Dn.length)&&Hn(e)}}var Un=null,Wn=null;function Gn(e){let t=Un;return Un=e,Wn=e&&e.type.__scopeId||null,t}function Kn(e,t=Un,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ra(-1);let i=Gn(t),a=$i.length,o;try{o=e(...n)}finally{for(let e=$i.length;e>a;e--)ta();Gn(i),r._d&&ra(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function qn(e,t){if(Un===null)return e;let n=Ra(Un),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=u]=t[e];i&&(w(i)&&(i={mounted:i,updated:i}),i.deep&&bn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Jn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(tt(),Sn(c,n,8,[e.el,s,e,t]),nt())}}function Yn(e,t){if(wa){let n=wa.provides,r=wa.parent&&wa.parent.provides;r===n&&(n=wa.provides=Object.create(r)),n[e]=t}}function Xn(e,t,n=!1){let r=Ta();if(r||ai){let i=ai?ai._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&w(t)?t.call(r&&r.proxy):t}}var Zn=Symbol.for(`v-scx`),Qn=()=>Xn(Zn);function $n(e,t,n){return er(e,t,n)}function er(e,t,n=u){let{immediate:r,deep:i,flush:a,once:o}=n,s=g({},n),c=t&&r||!t&&a!==`post`,l;if(ja){if(a===`sync`){let e=Qn();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=f,e.resume=f,e.pause=f,e}}let d=wa;s.call=(e,t,n)=>Sn(e,d,t,n);let p=!1;a===`post`?s.scheduler=e=>{e.i=d,Li(e,d&&d.suspense)}:a!==`sync`&&(p=!0,s.scheduler=(e,t)=>{t?e():Pn(e)}),s.augmentJob=e=>{t&&(e.flags|=4),p&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};let m=yn(e,t,s);return ja&&(l?l.push(m):c&&m()),m}function tr(e,t,n){let r=this.proxy,i=T(e)?e.includes(`.`)?nr(r,e):()=>r[e]:e.bind(r,r),a;w(t)?a=t:(a=t.handler,n=t);let o=Oa(this),s=er(i,a.bind(r),n);return o(),s}function nr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var rr=Symbol(`_vte`),ir=e=>e.__isTeleport,ar=Symbol(`_leaveCb`);function or(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Zi){t=n;break}}return t}function sr(e){if(!_r(e))return ir(e.type)&&e.children?or(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&w(n.default))return n.default()}}function cr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;cr(ir(n.type)&&sr(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===M&&b(e.children)){let n=fi(e.children,!1);n&&cr(n,t)}}function lr(e){if(e.component)return lr(e.component.subTree);if(e.type===M){let t=b(e.children)&&fi(e.children,!1);return t?lr(t):void 0}if(e.type!==Zi)return e}function ur(e,t){return w(e)?g({name:e.name},t,{setup:e}):e}function dr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function fr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var pr=new WeakMap;function mr(e,t,n,r,i=!1){if(b(e)){e.forEach((e,a)=>mr(e,t&&(b(t)?t[a]:t),n,r,i));return}if(gr(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&mr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ra(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,d=s.refs===u?s.refs={}:s.refs,f=s.setupState,m=nn(f),h=f===u?p:e=>!fr(d,e)&&y(m,e),g=(e,t)=>!(t&&fr(d,t));if(l!=null&&l!==c){if(hr(t),T(l))d[l]=null,h(l)&&(f[l]=null);else if(sn(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(d[e.k]=null)}}if(w(c))xn(c,s,12,[o,d]);else{let t=T(c),r=sn(c);if(t||r){let s=()=>{if(e.f){let n=t?h(c)?f[c]:d[c]:g(c)||!e.k?c.value:d[e.k];if(i)b(n)&&_(n,a);else if(b(n))n.includes(a)||n.push(a);else if(t)d[c]=[a],h(c)&&(f[c]=d[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(d[e.k]=t)}}else t?(d[c]=o,h(c)&&(f[c]=o)):r&&(g(c,e.k)&&(c.value=o),e.k&&(d[e.k]=o))};if(o){let t=()=>{s(),pr.delete(e)};t.id=-1,pr.set(e,t),Li(t,n)}else hr(e),s()}}}function hr(e){let t=pr.get(e);t&&(t.flags|=8,pr.delete(e))}ye().requestIdleCallback,ye().cancelIdleCallback;var gr=e=>!!e.type.__asyncLoader,_r=e=>e.type.__isKeepAlive;function vr(e,t){br(e,`a`,t)}function yr(e,t){br(e,`da`,t)}function br(e,t,n=wa){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Sr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)_r(e.parent.vnode)&&xr(r,t,n,e),e=e.parent}}function xr(e,t,n,r){let i=Sr(t,e,r,!0);kr(()=>{_(r[t],i)},n)}function Sr(e,t,n=wa,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{tt();let i=Oa(n),a=Sn(t,n,e,r);return i(),nt(),a};return r?i.unshift(a):i.push(a),a}}var Cr=e=>(t,n=wa)=>{(!ja||e===`sp`)&&Sr(e,(...e)=>t(...e),n)},wr=Cr(`bm`),Tr=Cr(`m`),Er=Cr(`bu`),Dr=Cr(`u`),Or=Cr(`bum`),kr=Cr(`um`),Ar=Cr(`sp`),jr=Cr(`rtg`),Mr=Cr(`rtc`);function Nr(e,t=wa){Sr(`ec`,e,t)}var Pr=Symbol.for(`v-ndc`);function Fr(e,t,n,r){let i,a=n&&n[r],o=b(e);if(o||T(e)){let n=o&&Qt(e),r=!1,s=!1;n&&(r=!en(e),s=$t(e),e=ht(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?on(an(e[n])):an(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(!Number.isInteger(e)||e<0)i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(E(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}var Ir=e=>e?Aa(e)?Ra(e):Ir(e.parent):null,Lr=g(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ir(e.parent),$root:e=>Ir(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Kr(e),$forceUpdate:e=>e.f||=()=>{Pn(e.update)},$nextTick:e=>e.n||=Mn.bind(e.proxy),$watch:e=>tr.bind(e)}),Rr=(e,t)=>e!==u&&!e.__isScriptSetup&&y(e,t),zr={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Rr(r,t))return o[t]=1,r[t];else if(i!==u&&y(i,t))return o[t]=2,i[t];else if(y(a,t))return o[t]=3,a[t];else if(n!==u&&y(n,t))return o[t]=4,n[t];else Vr&&(o[t]=0)}let l=Lr[t],d,f;if(l)return t===`$attrs`&&ft(e.attrs,`get`,``),l(e);if((d=s.__cssModules)&&(d=d[t]))return d;if(n!==u&&y(n,t))return o[t]=4,n[t];if(f=c.config.globalProperties,y(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Rr(i,t)?(i[t]=n,!0):r!==u&&y(r,t)?(r[t]=n,!0):y(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==u&&s[0]!==`$`&&y(e,s)||Rr(t,s)||y(a,s)||y(r,s)||y(Lr,s)||y(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?y(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Br(e){return b(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var Vr=!0;function Hr(e){let t=Kr(e),n=e.proxy,r=e.ctx;Vr=!1,t.beforeCreate&&Wr(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:p,beforeUpdate:m,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:x,unmounted:S,render:C,renderTracked:T,renderTriggered:ee,errorCaptured:te,serverPrefetch:ne,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:D}=t;if(l&&Ur(l,r,null),o)for(let e in o){let t=o[e];w(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);E(t)&&(e.data=Jt(t))}if(Vr=!0,a)for(let e in a){let t=a[e],i=R({get:w(t)?t.bind(n,n):w(t.get)?t.get.bind(n,n):f,set:!w(t)&&w(t.set)?t.set.bind(n):f});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)Gr(s[e],r,n,e);if(c){let e=w(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Yn(t,e[t])})}u&&Wr(u,e,`c`);function se(e,t){b(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(se(wr,d),se(Tr,p),se(Er,m),se(Dr,h),se(vr,g),se(yr,_),se(Nr,te),se(Mr,T),se(jr,ee),se(Or,y),se(kr,S),se(Ar,ne),b(re)){if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===f&&(e.render=C),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),ne&&dr(e)}function Ur(e,t,n=f){b(e)&&(e=Zr(e));for(let n in e){let r=e[n],i;i=E(r)?`default`in r?Xn(r.from||n,r.default,!0):Xn(r.from||n):Xn(r),sn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Wr(e,t,n){Sn(b(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gr(e,t,n,r){let i=r.includes(`.`)?nr(n,r):()=>n[r];if(T(e)){let n=t[e];w(n)&&$n(i,n)}else if(w(e))$n(i,e.bind(n));else if(E(e)){if(b(e))e.forEach(e=>Gr(e,t,n,r));else{let r=w(e.handler)?e.handler.bind(n):t[e.handler];w(r)&&$n(i,r,e)}}}function Kr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>qr(c,e,o,!0)),qr(c,t,o)),E(t)&&a.set(t,c),c}function qr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&qr(e,a,n,!0),i&&i.forEach(t=>qr(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Jr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Jr={data:Yr,props:ei,emits:ei,methods:$r,computed:$r,beforeCreate:Qr,created:Qr,beforeMount:Qr,mounted:Qr,beforeUpdate:Qr,updated:Qr,beforeDestroy:Qr,beforeUnmount:Qr,destroyed:Qr,unmounted:Qr,activated:Qr,deactivated:Qr,errorCaptured:Qr,serverPrefetch:Qr,components:$r,directives:$r,watch:ti,provide:Yr,inject:Xr};function Yr(e,t){return t?e?function(){return g(w(e)?e.call(this,this):e,w(t)?t.call(this,this):t)}:t:e}function Xr(e,t){return $r(Zr(e),Zr(t))}function Zr(e){if(b(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Qr(e,t){return e?[...new Set([].concat(e,t))]:t}function $r(e,t){return e?g(Object.create(null),e,t):t}function ei(e,t){return e?b(e)&&b(t)?[...new Set([...e,...t])]:g(Object.create(null),Br(e),Br(t??{})):t}function ti(e,t){if(!e)return t;if(!t)return e;let n=g(Object.create(null),e);for(let r in t)n[r]=Qr(e[r],t[r]);return n}function ni(){return{app:null,config:{isNativeTag:p,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var ri=0;function ii(e,t){return function(n,r=null){w(n)||(n=g({},n)),r!=null&&!E(r)&&(r=null);let i=ni(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:ri++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Va,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&w(e.install)?(a.add(e),e.install(c,...t)):w(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||ua(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,Ra(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Sn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=ai;ai=c;try{return e()}finally{ai=t}}};return c}}var ai=null,oi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${le(t)}Modifiers`]||e[`${de(t)}Modifiers`];function si(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||u,i=n,a=t.startsWith(`update:`),o=a&&oi(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>T(e)?e.trim():e)),o.number&&(i=i.map(_e)));let s,c=r[s=pe(t)]||r[s=pe(le(t))];!c&&a&&(c=r[s=pe(de(t))]),c&&Sn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Sn(l,e,6,i)}}var ci=new WeakMap;function li(e,t,n=!1){let r=n?ci:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!w(e)){let r=e=>{let n=li(e,t,!0);n&&(s=!0,g(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(E(e)&&r.set(e,null),null):(b(a)?a.forEach(e=>o[e]=null):g(o,a),E(e)&&r.set(e,o),o)}function ui(e,t){return!e||!m(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),y(e,t[0].toLowerCase()+t.slice(1))||y(e,de(t))||y(e,t))}function di(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:g}=e,_=Gn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=ha(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=ha(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:pi(s)}}catch(t){$i.length=0,Cn(t,e,1),v=ua(Zi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(h)&&(y=mi(y,a)),b=pa(b,y,!1,!0))}return n.dirs&&(b=pa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&cr(ir(b.type)&&sr(b)||b,n.transition),v=b,Gn(_),v}function fi(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(oa(r)){if(r.type!==Zi||r.children===`v-if`){if(n)return;n=r}}else return}return n}var pi=e=>{let t;for(let n in e)(n===`class`||n===`style`||m(n))&&((t||={})[n]=e[n]);return t},mi=(e,t)=>{let n={};for(let r in e)(!h(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function hi(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?gi(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(_i(o,r,n)&&!ui(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||gi(r,o,l):!!o;return!1}function gi(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(!y(e,a)||_i(t,e,a)&&!ui(n,a))return!0}return!1}function _i(e,t,n){let r=e[n],i=t[n];return n===`style`&&E(r)&&E(i)?!je(r,i):r!==i}function vi({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var yi={},bi=()=>Object.create(yi),xi=e=>Object.getPrototypeOf(e)===yi;function Si(e,t,n,r=!1){let i={},a=bi();e.propsDefaults=Object.create(null),wi(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Yt(i):e.type.props?i:a,e.attrs=a}function Ci(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=nn(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(ui(e.emitsOptions,o))continue;let u=t[o];if(c){if(y(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=le(o);i[t]=Ti(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{wi(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!y(t,a)&&((r=de(a))===a||!y(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Ti(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!y(t,e))&&(delete a[e],l=!0)}l&&pt(e.attrs,`set`,``)}function wi(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(D(c))continue;let l=t[c],u;i&&y(i,u=le(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:ui(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=nn(n),r=s||u;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Ti(i,t,s,r[s],e,!y(r,s))}}return o}function Ti(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=y(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&w(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Oa(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===de(n))&&(r=!0))}return r}var Ei=new WeakMap;function Di(e,t,n=!1){let r=n?Ei:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!w(e)){let r=e=>{c=!0;let[n,r]=Di(e,t,!0);g(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return E(e)&&r.set(e,d),d;if(b(a))for(let e=0;e<a.length;e++){let t=le(a[e]);Oi(t)&&(o[t]=u)}else if(a)for(let e in a){let t=le(e);if(Oi(t)){let n=a[e],r=o[t]=b(n)||w(n)?{type:n}:g({},n),i=r.type,c=!1,l=!0;if(b(i))for(let e=0;e<i.length;++e){let t=i[e],n=w(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=w(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||y(r,`default`))&&s.push(t)}}let l=[o,s];return E(e)&&r.set(e,l),l}function Oi(e){return e[0]!==`$`&&!D(e)}var ki=e=>e===`_`||e===`_ctx`||e===`$stable`,Ai=e=>b(e)?e.map(ha):[ha(e)],ji=(e,t,n)=>{if(t._n)return t;let r=Kn((...e)=>Ai(t(...e)),n);return r._c=!1,r},Mi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ki(n))continue;let i=e[n];if(w(i))t[n]=ji(n,i,r);else if(i!=null){let e=Ai(i);t[n]=()=>e}}},Ni=(e,t)=>{let n=Ai(t);e.slots.default=()=>n},Pi=(e,t,n)=>{for(let r in t)(n||!ki(r))&&(e[r]=t[r])},Fi=(e,t,n)=>{let r=e.slots=bi();if(e.vnode.shapeFlag&32){let e=t._;e?(Pi(r,t,n),n&&ge(r,`_`,e,!0)):Mi(t,r)}else t&&Ni(e,t)},Ii=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=u;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Pi(i,t,n):(a=!t.$stable,Mi(t,i)),o=t}else t&&(Ni(e,t),o={default:1});if(a)for(let e in i)!ki(e)&&o[e]==null&&delete i[e]},Li=Yi;function Ri(e){return zi(e)}function zi(e,t){let n=ye();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=f,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!sa(e,t)&&(r=xe(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===d&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:f}=t;switch(l){case Xi:y(e,t,n,r);break;case Zi:b(e,t,n,r);break;case Qi:e??x(t,n,r,o);break;case M:ie(e,t,n,r,i,a,o,s,c);break;default:f&1?w(e,t,n,r,i,a,o,s,c):f&6?ae(e,t,n,r,i,a,o,s,c):(f&64||f&128)&&l.process(e,t,n,r,i,a,o,s,c,Ce)}u!=null&&i?mr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&mr(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),te(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=o(e.type,c,m&&m.is,m),h&8?p(d,e.children):h&16&&E(e.children,d,null,i,s,Bi(e,c),l,u),_&&Jn(e,null,i,`created`),ee(d,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!D(e)&&a(d,e,null,m[e],c,i);`value`in m&&a(d,`value`,null,m.value,c),(f=m.onVnodeBeforeMount)&&ya(f,i,e)}_&&Jn(e,null,i,`beforeMount`);let v=Hi(s,g);v&&g.beforeEnter(d),r(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&Li(()=>{try{f&&ya(f,i,e),v&&g.enter(d),_&&Jn(e,null,i,`mounted`)}finally{}},s)},ee=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||Ji(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;ee(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},E=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ga(e[l]):ha(e[l]);v(null,c,t,n,r,i,a,o,s)}},te=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let m=e.props||u,h=t.props||u,g;if(n&&Vi(n,!1),(g=h.onVnodeBeforeUpdate)&&ya(g,n,t,e),f&&Jn(t,e,n,`beforeUpdate`),n&&Vi(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(c,``),d?ne(e.dynamicChildren,d,c,n,r,Bi(t,i),o):s||ue(e,t,c,null,n,r,Bi(t,i),o,!1),l>0){if(l&16)re(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&p(c,t.children)}else!s&&d==null&&re(c,m,h,n,i);((g=h.onVnodeUpdated)||f)&&Li(()=>{g&&ya(g,n,t,e),f&&Jn(t,e,n,`updated`)},r)},ne=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el||qi(c),d=u&&(c.type===M||!sa(c,l)||c.shapeFlag&198)?m(u):n;v(c,l,d,null,r,i,a,o,!0)}},re=(e,t,n,r,i)=>{if(t!==n){if(t!==u)for(let o in t)!D(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(D(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ie=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),E(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ne(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Ui(e,t,!0)):ue(e,t,n,f,a,o,c,l,u)},ae=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):se(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=Ca(e,r,i);if(_r(e)&&(s.ctx.renderer=Ce),Ma(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ce,o,a),!e.el){let r=s.subTree=ua(Zi);b(null,r,t,n),e.placeholder=r.el}}else ce(s,e,t,n,i,a,o)},se=(e,t,n)=>{let r=t.component=e.component;if(hi(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,le(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},ce=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Gi(e);if(n){t&&(t.el=c.el,le(e,t,o)),n.asyncDep.then(()=>{Li(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Vi(e,!1),t?(t.el=c.el,le(e,t,o)):t=c,n&&he(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&ya(d,s,t,c),Vi(e,!0);let f=di(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),xe(p),e,i,a),t.el=f.el,u===null&&vi(e,f.el),r&&Li(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Li(()=>ya(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=gr(t);if(Vi(e,!1),l&&he(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ya(o,d,t),Vi(e,!0),s&&O){let t=()=>{e.subTree=di(e),O(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=di(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Li(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Li(()=>ya(o,d,e),i)}(t.shapeFlag&256||d&&gr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Li(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Be(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Pn(u),Vi(e,!0),l()},le=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Ci(e,t.props,r,n),Ii(e,t.children,n),tt(),Ln(e),nt()},ue=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){fe(l,d,n,r,i,a,o,s,c);return}if(f&256){de(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&be(l,i,a),d!==l&&p(n,d)):u&16?m&16?fe(l,d,n,r,i,a,o,s,c):be(l,i,a,!0):(u&8&&p(n,``),m&16&&E(d,n,r,i,a,o,s,c))},de=(e,t,n,r,i,a,o,s,c)=>{e||=d,t||=d;let l=e.length,u=t.length,f=Math.min(l,u),p=0;for(;p<f;p++){let r=t[p]=c?ga(t[p]):ha(t[p]);v(e[p],r,n,null,i,a,o,s,c)}l>u?be(e,i,a,!0,!1,f):E(t,n,r,i,a,o,s,c,f)},fe=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,f=e.length-1,p=u-1;for(;l<=f&&l<=p;){let r=e[l],u=t[l]=c?ga(t[l]):ha(t[l]);if(sa(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=f&&l<=p;){let r=e[f],l=t[p]=c?ga(t[p]):ha(t[p]);if(sa(r,l))v(r,l,n,null,i,a,o,s,c);else break;f--,p--}if(l>f){if(l<=p){let e=p+1,d=e<u?t[e].el:r;for(;l<=p;)v(null,t[l]=c?ga(t[l]):ha(t[l]),n,d,i,a,o,s,c),l++}}else if(l>p)for(;l<=f;)me(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=p;l++){let e=t[l]=c?ga(t[l]):ha(t[l]);e.key!=null&&g.set(e.key,l)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=f;l++){let r=e[l];if(y>=b){me(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&sa(r,t[_])){u=_;break}u===void 0?me(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Wi(C):d;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||qi(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?pe(d,n,p,2):_--)}}},pe=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)pe(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,Ce);else if(c===M){r(s,t,n);for(let e=0;e<u.length;e++)pe(u[e],t,n,a);r(e.anchor,t,n)}else if(c===Qi)S(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[ar]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Li(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[ar];s._isLeaving&&s[ar](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(tt(),mr(s,null,n,e,!0),nt()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!gr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ya(_,t,e),u&6)ve(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Jn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Ce,r):l&&!l.hasOnce&&(a!==M||d>0&&d&64)?be(l,t,n,!1,!0):(a===M&&d&384||!i&&u&16)&&be(c,t,n),r&&ge(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Li(()=>{_&&ya(_,t,e),h&&Jn(e,null,t,`unmounted`),v&&(e.el=null)},n)},ge=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===M;if(o&&!a){_e(n,r);return}if(t===Qi){C(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?lr(e):e,c=()=>{o?m(n)&&_e(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},_e=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},ve=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Ki(c),Ki(l),r&&he(r),i.stop(),a?(a.flags|=8,me(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,me(o,e,t,n)),s&&Li(s,t),Li(()=>{e.isUnmounted=!0},t)},be=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},xe=e=>{if(e.shapeFlag&6)return xe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[rr];return n?h(n):t},Se=(e,t,n)=>{Bn(()=>{e==null?t._vnode&&me(t._vnode,null,null,!0):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:Sa())},Ce={p:v,um:me,m:pe,r:ge,mt:oe,mc:E,pc:ue,pbc:ne,n:xe,o:e},we,O;return t&&([we,O]=t(Ce)),{render:Se,hydrate:we,createApp:ii(Se,we)}}function Bi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Vi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ui(e,t,n=!1){let r=e.children,i=t.children;if(b(r)&&b(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ga(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Ui(t,a)),a.type===Xi&&(a.patchFlag===-1&&(a=i[e]=ga(a)),a.el=t.el),a.type===Zi&&!a.el&&(a.el=t.el)}}function Wi(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Gi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Gi(t)}function Ki(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function qi(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?qi(t.subTree):null}var Ji=e=>e.__isSuspense;function Yi(e,t){t&&t.pendingBranch?b(e)?t.effects.push(...e):t.effects.push(e):In(e)}var M=Symbol.for(`v-fgt`),Xi=Symbol.for(`v-txt`),Zi=Symbol.for(`v-cmt`),Qi=Symbol.for(`v-stc`),$i=[],ea=null;function N(e=!1){$i.push(ea=e?null:[])}function ta(){$i.pop(),ea=$i[$i.length-1]||null}var na=1;function ra(e,t=!1){na+=e,e<0&&ea&&t&&(ea.hasOnce=!0)}function ia(e){return e.dynamicChildren=na>0?ea||d:null,ta(),na>0&&ea&&ea.push(e),e}function P(e,t,n,r,i,a){return ia(F(e,t,n,r,i,a,!0))}function aa(e,t,n,r,i){return ia(ua(e,t,n,r,i,!0))}function oa(e){return e?e.__v_isVNode===!0:!1}function sa(e,t){return e.type===t.type&&e.key===t.key}var ca=({key:e})=>e??null,la=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:T(e)||sn(e)||w(e)?{i:Un,r:e,k:t,f:!!n}:e);function F(e,t=null,n=null,r=0,i=null,a=e===M?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ca(t),ref:t&&la(t),scopeId:Wn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Un};return s?(_a(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=T(n)?8:16),na>0&&!o&&ea&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ea.push(c),c}var ua=da;function da(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Pr)&&(e=Zi),oa(e)){let r=pa(e,t,!0);return n&&_a(r,n),na>0&&!a&&ea&&(r.shapeFlag&6?ea[ea.indexOf(e)]=r:ea.push(r)),r.patchFlag=-2,r}if(za(e)&&(e=e.__vccOpts),t){t=fa(t);let{class:e,style:n}=t;e&&!T(e)&&(t.class=O(e)),E(n)&&(tn(n)&&!b(n)&&(n=g({},n)),t.style=be(n))}let o=T(e)?1:Ji(e)?128:ir(e)?64:E(e)?4:w(e)?2:0;return F(e,t,n,r,i,o,a,!0)}function fa(e){return e?tn(e)||xi(e)?g({},e):e:null}function pa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?va(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ca(l),ref:t&&t.ref?n&&a?b(a)?a.concat(la(t)):[a,la(t)]:la(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==M?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&pa(e.ssContent),ssFallback:e.ssFallback&&pa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&cr(u,c.clone(u)),u}function I(e=` `,t=0){return ua(Xi,null,e,t)}function ma(e,t){let n=ua(Qi,null,e);return n.staticCount=t,n}function L(e=``,t=!1){return t?(N(),aa(Zi,null,e)):ua(Zi,null,e)}function ha(e){return e==null||typeof e==`boolean`?ua(Zi):b(e)?ua(M,null,e.slice()):oa(e)?ga(e):ua(Xi,null,String(e))}function ga(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:pa(e)}function _a(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(b(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),_a(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!xi(t)?t._ctx=Un:r===3&&Un&&(Un.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(w(t)){if(r&65){_a(e,{default:t});return}t={default:t,_ctx:Un},n=32}else t=String(t),r&64?(n=16,t=[I(t)]):n=8;e.children=t,e.shapeFlag|=n}function va(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=O([t.class,r.class]));else if(e===`style`)t.style=be([t.style,r.style]);else if(m(e)){let n=t[e],i=r[e];i&&n!==i&&!(b(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!h(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ya(e,t,n,r=null){Sn(e,t,7,[n,r])}var ba=ni(),xa=0;function Sa(){return xa}function Ca(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||ba,a={uid:xa++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ie(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Di(r,i),emitsOptions:li(r,i),emit:null,emitted:null,propsDefaults:u,inheritAttrs:r.inheritAttrs,ctx:u,data:u,props:u,attrs:u,slots:u,refs:u,setupState:u,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=si.bind(null,a),e.ce&&e.ce(a),a}var wa=null,Ta=()=>wa||Un,Ea,Da;{let e=ye(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Ea=t(`__VUE_INSTANCE_SETTERS__`,e=>wa=e),Da=t(`__VUE_SSR_SETTERS__`,e=>ja=e)}var Oa=e=>{let t=wa;return Ea(e),e.scope.on(),()=>{e.scope.off(),Ea(t)}},ka=()=>{wa&&wa.scope.off(),Ea(null)};function Aa(e){return e.vnode.shapeFlag&4}var ja=!1;function Ma(e,t=!1,n=!1){t&&Da(t);let{props:r,children:i}=e.vnode,a=Aa(e);Si(e,r,a,t),Fi(e,i,n||t);let o=a?Na(e,t):void 0;return t&&Da(!1),o}function Na(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,zr);let{setup:r}=n;if(r){tt();let n=e.setupContext=r.length>1?La(e):null,i=Oa(e),a=xn(r,e,0,[e.props,n]),o=te(a);if(nt(),i(),(o||e.sp)&&!gr(e)&&dr(e),o){if(a.then(ka,ka),t)return a.then(n=>{Da(!0);try{Pa(e,n,t)}finally{Da(!1)}}).catch(t=>{Cn(t,e,0)});e.asyncDep=a}else Pa(e,a,t)}else Fa(e,t)}function Pa(e,t,n){w(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:E(t)&&(e.setupState=fn(t)),Fa(e,n)}function Fa(e,t,n){let r=e.type;e.render||=r.render||f;{let t=Oa(e);tt();try{Hr(e)}finally{nt(),t()}}}var Ia={get(e,t){return ft(e,`get`,``),e[t]}};function La(e){return{attrs:new Proxy(e.attrs,Ia),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ra(e){return e.exposed?e.exposeProxy||=new Proxy(fn(rn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Lr)return Lr[n](e)},has(e,t){return t in e||t in Lr}}):e.proxy}function za(e){return w(e)&&`__vccOpts`in e}var R=(e,t)=>mn(e,t,ja);function Ba(e,t,n){try{ra(-1);let r=arguments.length;return r===2?E(t)&&!b(t)?oa(t)?ua(e,null,[t]):ua(e,t):ua(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&oa(n)&&(n=[n]),ua(e,t,n))}finally{ra(1)}}var Va=`3.5.44`,Ha=void 0,Ua=typeof window<`u`&&window.trustedTypes;if(Ua)try{Ha=Ua.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Wa=Ha?e=>Ha.createHTML(e):e=>e,Ga=`http://www.w3.org/2000/svg`,Ka=`http://www.w3.org/1998/Math/MathML`,qa=typeof document<`u`?document:null,Ja=qa&&qa.createElement(`template`),Ya={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?qa.createElementNS(Ga,e):t===`mathml`?qa.createElementNS(Ka,e):n?qa.createElement(e,{is:n}):qa.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>qa.createTextNode(e),createComment:e=>qa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qa.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Ja.innerHTML=Wa(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Ja.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xa=Symbol(`_vtc`);function Za(e,t,n){let r=e[Xa];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Qa=Symbol(`_vod`),$a=Symbol(`_vsh`),eo={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Qa]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):to(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),to(e,!0),r.enter(e)):r.leave(e,()=>{to(e,!1)}):to(e,t))},beforeUnmount(e,{value:t}){to(e,t)}};function to(e,t){e.style.display=t?e[Qa]:`none`,e[$a]=!t}var no=Symbol(``),ro=/(?:^|;)\s*display\s*:/;function io(e,t,n){let r=e.style,i=T(n),a=!1;if(n&&!i){if(t){if(T(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??oo(r,t,``)}else for(let e in t)n[e]??oo(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?oo(r,i,``):uo(e,i,!T(t)&&t?t[i]:void 0,o)||oo(r,i,o)}}else if(i){if(t!==n){let e=r[no];e&&(n+=`;`+e),r.cssText=n,a=ro.test(n)}}else t&&e.removeAttribute(`style`);Qa in e&&((!i||t!==n)&&(e[Qa]=a?r.display:``),e[$a]&&(r.display=`none`))}var ao=/\s*!important$/;function oo(e,t,n){if(b(n))n.forEach(n=>oo(e,t,n));else if(n??=``,t.startsWith(`--`))ao.test(n)?e.setProperty(t,n.replace(ao,``),`important`):e.setProperty(t,n);else{let r=lo(e,t);ao.test(n)?e.setProperty(de(r),n.replace(ao,``),`important`):e[r]=n}}var so=[`Webkit`,`Moz`,`ms`],co={};function lo(e,t){let n=co[t];if(n)return n;let r=le(t);if(r!==`filter`&&r in e)return co[t]=r;r=fe(r);for(let n=0;n<so.length;n++){let i=so[n]+r;if(i in e)return co[t]=i}return t}function uo(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&T(r)&&n===r}var fo=`http://www.w3.org/1999/xlink`;function po(e,t,n,r,i,a=Te(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(fo,t.slice(6,t.length)):e.setAttributeNS(fo,t,n):n==null||a&&!Ee(n)?e.removeAttribute(t):e.setAttribute(t,a?``:ee(n)?String(n):n)}function mo(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Wa(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Ee(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ho(e,t,n,r){e.addEventListener(t,n,r)}function go(e,t,n,r){e.removeEventListener(t,n,r)}var _o=Symbol(`_vei`);function vo(e,t,n,r,i=null){let a=e[_o]||(e[_o]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=xo(t);r?ho(e,n,a[t]=To(r,i),s):o&&(go(e,n,o,s),a[t]=void 0)}}var yo=/(Once|Passive|Capture)$/,bo=/^on:?(?:Once|Passive|Capture)$/;function xo(e){let t,n;for(;(n=e.match(yo))&&!bo.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):de(e.slice(2)),t]}var So=0,Co=Promise.resolve(),wo=()=>So||=(Co.then(()=>So=0),Date.now());function To(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(b(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Sn(e,t,5,a)}}else Sn(r,t,5,[e])};return n.value=e,n.attached=wo(),n}var Eo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Do=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Za(e,r,o):t===`style`?io(e,n,r):m(t)?h(t)||vo(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Oo(e,t,r,o))?(mo(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&po(e,t,r,o,a,t!==`value`)):e._isVueCE&&(ko(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!T(r)))?mo(e,le(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),po(e,t,r,o))};function Oo(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Eo(t)&&w(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Eo(t)&&T(n)?!1:t in e}function ko(e,t){let n=e._def.props;if(!n)return!1;let r=le(t);return Array.isArray(n)?n.some(e=>le(e)===r):Object.keys(n).some(e=>le(e)===r)}var Ao=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return b(t)?e=>he(t,e):t};function jo(e){e.target.composing=!0}function Mo(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var No=Symbol(`_assign`),Po=Symbol(`_initialValue`);function Fo(e,t,n){return t&&(e=e.trim()),n&&(e=_e(e)),e}var Io={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Po]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Po]=e.defaultValue.replace(/\r\n?/g,`
|
|
2
|
+
`))),e[No]=Ao(i);let a=r||i.props&&i.props.type===`number`;ho(e,t?`change`:`input`,t=>{t.target.composing||e[No](Fo(e.value,n,a))}),(n||a)&&ho(e,`change`,()=>{e.value=Fo(e.value,n,a)}),t||(ho(e,`compositionstart`,jo),ho(e,`compositionend`,Mo),ho(e,`change`,Mo))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Po];delete e[Po],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[No](Fo(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[No]=Ao(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?_e(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Lo=[`ctrl`,`shift`,`alt`,`meta`],Ro={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Lo.some(n=>e[`${n}Key`]&&!t.includes(n))},zo=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Ro[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Bo={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Vo=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=de(n.key);if(t.some(e=>e===r||Bo[e]===r))return e(n)}))},Ho=g({patchProp:Do},Ya),Uo;function Wo(){return Uo||=Ri(Ho)}var Go=((...e)=>{let t=Wo().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=qo(e);if(!r)return;let i=t._component;!w(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ko(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Ko(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function qo(e){return T(e)?document.querySelector(e):e}var Jo={key:0,class:`cepic`},Yo={class:`cid`},Xo=[`title`],Zo=[`title`],Qo={key:0},$o=ur({__name:`ase-task-board-web-client-title`,props:{id:{},epic:{},title:{},edit:{default:``},effort:{default:``}},setup(e){let t={pending:`✎`,active:`✎…`,failed:`✎✗`},n={pending:`edit by prompt requested`,active:`edit by prompt in progress`,failed:`edit by prompt failed (press E to retry)`},r=e=>e.split(/`([^`]+)`/).map((e,t)=>({text:e,code:t%2==1})).filter(e=>e.text!==``);return(i,a)=>(N(),P(M,null,[e.epic!==``&&e.epic!==e.id?(N(),P(`span`,Jo,`♛ `+k(e.epic)+` ▶`,1)):L(``,!0),F(`span`,Yo,k(e.epic===e.id?`♛ `:``)+`≡ `+k(e.id),1),e.edit===``?L(``,!0):(N(),P(`span`,{key:1,class:`cedit`,title:n[e.edit]},k(t[e.edit]),9,Xo)),e.effort===``?L(``,!0):(N(),P(`span`,{key:2,class:`ceffort`,title:`effort: ${e.effort}`},`⚖ `+k(e.effort),9,Zo)),(N(!0),P(M,null,Fr(r(e.title),(e,t)=>(N(),P(M,{key:t},[e.code?(N(),P(`code`,Qo,k(e.text),1)):(N(),P(M,{key:1},[I(k(e.text),1)],64))],64))),128))],64))}}),es={lanes:`task-lanes`,graph:`task-graph`,stats:`statistics`,agents:`agent-logs`,flow:`agent-graph`},ts=e=>e?[`lanes`,`graph`,`stats`,`agents`,`flow`]:[`lanes`,`graph`,`stats`],ns=(e,t)=>{let n=ts(t),r=n.indexOf(e);return`view ${es[n[(r+1)%n.length]]}/${es[n[(r+n.length-1)%n.length]]}`},rs=(e,t,n)=>{let r=[],i=n.collapsed.includes(e.groups[t].title);return e.groups[t].lanes.forEach((e,a)=>{i||n.minimized.includes(e.status)||e.cards.length===0?r.push({g:t,l:a,id:``}):e.cards.forEach(e=>r.push({g:t,l:a,id:e.id}))}),r},is=(e,t,n)=>e.groups.filter(e=>n<e.lanes.length&&!t.collapsed.includes(e.title)).map(e=>e.lanes[n].status),as=(e,t,n)=>{if(t.id!==``)for(let r=0;r<e.groups.length;r++){let i=e.groups[r].lanes.findIndex(e=>e.cards.some(e=>e.id===t.id));if(i>=0)return n.minimized.includes(e.groups[r].lanes[i].status)||n.collapsed.includes(e.groups[r].title)?{g:r,l:i,id:``}:{g:r,l:i,id:t.id}}let r=rs(e,Math.min(t.g,e.groups.length-1),n);return r.find(e=>e.l===t.l)??r[0]},os=new Map,ss=0,cs=A(null),ls=A(Date.now()),us=null;$n(cs,e=>{e!==null&&us===null?us=setInterval(()=>{ls.value=Date.now()},100):e===null&&us!==null&&(clearInterval(us),us=null)});var ds=R(()=>cs.value===null?``:`${(Math.max(0,ls.value-cs.value.since)/1e3).toFixed(1)}s`),fs=(e,t)=>{let n=/\/api\/([a-z]+)/.exec(e)?.[1]??``;if(n===`move`&&typeof t?.body==`string`){let{id:e,status:n}=JSON.parse(t.body);return{text:`moving task`,id:e,suffix:`to ${n}`}}let r={board:`loading tasks`,graph:`loading graph`,flow:`loading agent graph`,stats:`loading statistics`,new:`preparing new task`,toggle:`saving board state`};if(Object.hasOwn(r,n))return{text:r[n]};let i=t?.method??`GET`,a=/\/api\/task\/([^/?]+)\/edit$/.exec(e)?.[1],o=/\/api\/task\/([^/?]+)\/request$/.exec(e)?.[1];if(o!==void 0)return{text:`requesting task`,id:decodeURIComponent(o)};if(a!==void 0)return{text:i===`POST`?`requesting edit of task`:`loading edit prompt of task`,id:decodeURIComponent(a)};let s=i===`DELETE`?`deleting`:i===`GET`?`loading`:`saving`,c=/\/api\/task\/([^/?]+)/.exec(e)?.[1];return c===void 0?{text:s}:{text:`${s} task`,id:decodeURIComponent(c)}},ps=async(e,t,n=!1)=>{let r=n?0:++ss,i=null;r>0&&(os.set(r,fs(e,t)),i=setTimeout(()=>{cs.value??={label:os.values().next().value??{text:``},since:Date.now()-800}},800));try{return await(await fetch(e,t)).json()}catch(e){return{error:e instanceof Error?e.message:String(e)}}finally{if(r>0){clearTimeout(i),os.delete(r);let e=os.values().next();cs.value!==null&&(cs.value=e.done===!0?null:{...cs.value,label:e.value})}}},z=A(null),ms=A(null),hs=A(null),gs=A(null),B=A(`lanes`),_s=A(``),vs=A(null),ys=A(``),bs=A(null),xs=A(``),V=A(null),Ss=A(null),Cs=A(`total`),H=A(null),U=A({g:0,l:0,id:``}),ws=A(!1),Ts=A(null),Es=A(null),Ds=A(null),Os=A(null),ks=A(null),W=A(null),As=Jt({all:!0,info:``}),js=A(0),Ms=A({}),Ns=Jt({less:!1,more:!1}),Ps=new Map,Fs=A(``),Is=``,Ls=null,Rs=0,zs=0,Bs=0,Vs=0,Hs=0,Us=A(null),Ws=A(null),Gs=A(null),Ks=A(null),qs=A(null),Js=A(null),Ys=A(null),Xs=cn(null),Zs=A(!1),Qs=cn(new Map),$s=e=>{Xs.value=e;let t=new Set(e?.agents.map(e=>e.id)??[]);[...Qs.value.keys()].some(e=>!t.has(e))&&(Qs.value=new Map([...Qs.value].filter(([e])=>t.has(e))))},ec=e=>{let t=new Map(Qs.value);for(let[n,{reset:r,lines:i}]of Object.entries(e))t.set(n,r?i:[...t.get(n)??[],...i].slice(-100));Qs.value=t},tc=R(()=>Xs.value?.agents??[]),nc=A(``),rc=R(()=>tc.value.find(e=>e.id===nc.value)??tc.value[0]??null),ic=A(null),ac=A(!0),oc=e=>{nc.value=e,ac.value=!0},sc=R(()=>z.value?.surface??{view:`lanes`,minimized:[],collapsed:[],titles:!1,keys:!0,standalone:!0}),cc=R(()=>sc.value.titles),lc=R(e=>{let t=new Map;for(let e of Xs.value?.agents??[])for(let n of e.tasks)t.set(n,[...t.get(n)??[],e.name]);return e!==void 0&&JSON.stringify([...e])===JSON.stringify([...t])?e:t}),uc=R(e=>{let t=new Set((Xs.value?.agents??[]).map(e=>e.name));return e!==void 0&&JSON.stringify([...e])===JSON.stringify([...t])?e:t}),dc=(e,t)=>{let n=lc.value.get(e);return n===void 0?t===``?[]:[{icon:uc.value.has(t)?`⚉`:`☺`,name:t}]:n.map(e=>({icon:`⚉`,name:e}))},fc=R(()=>{let e=new Map;for(let t of z.value?.groups??[])for(let n of t.lanes)for(let t of n.cards){let n=dc(t.id,t.assignee);n.length>0&&e.set(t.id,n)}return e}),pc=e=>{let t=Math.max(0,Math.floor(e/1e3));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`},mc=e=>e.name===e.kind?e.name:`${e.name} (${e.kind})`,hc=A(Date.now()),gc=null;$n(B,e=>{e===`agents`&&gc===null?(hc.value=Date.now(),gc=setInterval(()=>{hc.value=Date.now()},1e3)):e!==`agents`&&gc!==null&&(clearInterval(gc),gc=null)},{immediate:!0});var _c=1e3,vc=cn(new Map),yc=null;$n(Xs,e=>{let t=Date.now(),n=new Map,r=!1;for(let i of e?.agents??[]){let e=vc.value.get(i.id);e!==void 0&&e.beat===i.beat?n.set(i.id,e):(n.set(i.id,{beat:i.beat,seen:t}),r=!0)}vc.value=n,r&&(hc.value=t,yc!==null&&clearTimeout(yc),yc=setTimeout(()=>{yc=null,hc.value=Date.now()},_c))});var bc=e=>hc.value-(vc.value.get(e)?.seen??0)<_c;$n(()=>[Zs.value,Xs.value,B.value],()=>{Zs.value&&Xs.value===null&&(B.value===`agents`||B.value===`flow`)&&Xc(`lanes`)});var xc=e=>(Xs.value?.agents??[]).filter(t=>`agent:${t.kind}:${t.mode??``}`===e).sort((e,t)=>(e.started??e.since)-(t.started??t.since)),Sc=e=>{let t=xc(e)[0];t!==void 0&&(oc(t.id),Xc(`agents`))},Cc=R(()=>{let e=z.value?.groups[U.value.g];return e!==void 0&&!sc.value.collapsed.includes(e.title)&&!sc.value.minimized.includes(e.lanes[U.value.l]?.status??``)}),wc=R(()=>ws.value&&Cc.value&&B.value===`lanes`);$n(Cc,e=>{e||(ws.value=!1)});var Tc=()=>{let e=Us.value;if(e===null)return;let t=[...e.querySelectorAll(`.group`)],n=t.map((e,t)=>({g:e,i:t})).filter(({g:t})=>t.offsetLeft+t.offsetWidth>e.scrollLeft+1&&t.offsetLeft<e.scrollLeft+e.clientWidth-1);As.all=n.length===t.length,As.info=n.length===0?``:`groups ${n[0].i+1}–${n[n.length-1].i+1} of ${t.length}`},Ec=e=>Us.value?.scrollBy({left:e,behavior:`smooth`});$n([z,B],()=>Mn(Tc),{deep:!0});var Dc=async(e=!1)=>{let t=++Bs,n=await ps(`/task-board/api/graph?filter=${encodeURIComponent(Is)}`,void 0,e);t===Bs&&(_s.value=n.error===void 0?n.svg===``?`<p class="mute">(no tasks)</p>`:n.svg:`<p class="warn">${n.error.replace(/[&<>]/g,e=>`&#${e.charCodeAt(0)};`)}</p>`,vs.value=n.error===void 0?n.stats:null)},Oc=(e,t)=>{let n=[...e?.querySelectorAll(`path.edge`)??[]];for(let e of n)e.classList.toggle(`sel`,t!==``&&(e.dataset.from===t||e.dataset.to===t));let r=n.filter(e=>e.classList.contains(`sel`)),i=n.findLast(e=>!e.classList.contains(`sel`));i!==void 0&&r.length>0&&i.after(...r)},kc=async(e=!1)=>{let t=++Vs,n=await ps(`/task-board/api/flow`,void 0,e);t===Vs&&(ys.value=n.error===void 0?n.svg===``?`<p class="mute">(no agents running)</p>`:n.svg:`<p class="warn">${n.error.replace(/[&<>]/g,e=>`&#${e.charCodeAt(0)};`)}</p>`,bs.value=n.error===void 0?n.stats:null)},Ac=async(e=!1)=>{let t=++Hs,n=await ps(`/task-board/api/stats?filter=${encodeURIComponent(Is)}&range=${Cs.value}`,void 0,e);t===Hs&&(Ss.value=n.error===void 0?null:n.error,n.error===void 0&&(V.value=n))},jc=[{range:`total`,label:`total`},{range:`30d`,label:`within last 30 days`},{range:`7d`,label:`within last 7 days`}],Mc=e=>{e!==Cs.value&&(Cs.value=e,Ac(!0))},Nc=e=>{let t=jc.findIndex(e=>e.range===Cs.value)+e;t>=0&&t<jc.length&&Mc(jc[t].range)},Pc=()=>{let e=Ks.value?.contentWindow??null;H.value!==null&&e!==null&&Ps.set(js.value,e.scrollY)},Fc=async(e,t=!1)=>{if(Ts.value!==null&&Ts.value.id!==e)return;let n=++Rs;Ls===e?Pc():(js.value=0,Ps.clear()),Ls=e;let r=await ps(`/task-board/api/task/${encodeURIComponent(e)}`,void 0,t);if(n!==Rs)return;if(r.error!==void 0){Ts.value===null?zc():Es.value={kind:`error`,message:r.error};return}let i=Math.min(js.value,r.tabs.length-1),a=i>0?await Bc(e,i,t):``;n===Rs&&(Ms.value=i>0?{[i]:a}:{},H.value=r,js.value=i,Mn(Uc))},Ic=e=>{Ls=e},Lc=[],Rc=e=>{Lc.push(e)},zc=()=>{for(let e of Lc)e();Rs++,Ls=null,H.value=null},Bc=async(e,t,n=!1)=>{let r=await ps(`/task-board/api/task/${encodeURIComponent(e)}/attachment/${t-1}/doc`,void 0,n);return r.error===void 0?r.doc:`<p class="warn">${r.error.replace(/[&<>]/g,e=>`&#${e.charCodeAt(0)};`)}</p>`},Vc=async e=>{if(e===0||H.value===null||Ms.value[e]!==void 0)return;let t=H.value.id,n=await Bc(t,e);H.value?.id===t&&(Ms.value[e]=n)},Hc=async e=>{H.value===null||Ts.value!==null||e<0||e>=H.value.tabs.length||e===js.value||(Pc(),js.value=e,Mn(()=>qs.value?.children[e]?.scrollIntoView({block:`nearest`,inline:`nearest`})),await Vc(e))},Uc=()=>{let e=qs.value;e!==null&&(Ns.less=e.scrollLeft>1,Ns.more=e.scrollLeft+e.clientWidth<e.scrollWidth-1)},Wc=async(e=!1)=>{let t=++zs,n=await ps(`/task-board/api/board?filter=${encodeURIComponent(Is)}`,void 0,e);t===zs&&(n.error===void 0?(ms.value=null,z.value===null&&(B.value=n.surface.view),z.value=n,B.value===`graph`?await Dc(e):B.value===`flow`?await kc(e):B.value===`stats`&&await Ac(e||V.value!==null),Ls!==null&&await Fc(Ls,e)):ms.value=n.error)},Gc=null;$n(Fs,e=>{Gc!==null&&clearTimeout(Gc),Gc=setTimeout(()=>{Gc=null,Is=e,Wc()},e===``?0:250)});var Kc=()=>{Fs.value=``,Js.value?.blur()},qc=e=>{if(z.value===null)return;let t=z.value.surface.titles!==e.titles||z.value.surface.standalone!==e.standalone;z.value.surface=e,t&&B.value===`graph`&&Dc()},Jc=async(e,t)=>{let n=await ps(`/task-board/api/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({list:e,entry:t})});n.error===void 0?(hs.value=null,qc(n)):hs.value=n.error},Yc=(e=!1)=>{let t=ts(Xs.value!==null);Xc(t[(t.indexOf(B.value)+(e?t.length-1:1))%t.length])},Xc=e=>{B.value=e,e!==`lanes`&&(Ys.value=null),e===`graph`?Dc():e===`flow`?kc():e===`stats`&&Ac(V.value!==null),ps(`/task-board/api/view`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({view:e})}).then(e=>{e.error!==void 0&&(hs.value=e.error)})},Zc=null,Qc=null,$c=null,el=A(!1),tl=A(null),nl=()=>{Zc=new EventSource(`/task-board/events`),Zc.addEventListener(`open`,()=>{el.value=!0,Qs.value=new Map,z.value!==null&&Wc(!0)}),Zc.addEventListener(`error`,()=>{el.value=!1,Zc?.readyState===EventSource.CLOSED&&(Zc.close(),$c=setTimeout(nl,5e3))}),Zc.addEventListener(`change`,()=>Wc(!0)),Zc.addEventListener(`surface`,e=>qc(JSON.parse(e.data))),Zc.addEventListener(`store`,e=>{tl.value=JSON.parse(e.data)}),Zc.addEventListener(`agents`,e=>{$s(JSON.parse(e.data)),Zs.value=!0,B.value===`flow`&&kc(!0)}),Zc.addEventListener(`logs`,e=>ec(JSON.parse(e.data)))},rl=()=>{nl(),Qc=setInterval(async()=>{el.value=(await ps(`/task-board/api/ping`,void 0,!0)).error===void 0&&Zc?.readyState===EventSource.OPEN},15e3)},il=()=>{Zc?.close(),$c!==null&&clearTimeout($c),Qc!==null&&clearInterval(Qc),Gc!==null&&clearTimeout(Gc),us!==null&&clearInterval(us),gc!==null&&clearInterval(gc)},al=c(o(((e,t)=>{(function(e,n,r){if(!e)return;for(var i={8:`backspace`,9:`tab`,13:`enter`,16:`shift`,17:`ctrl`,18:`alt`,20:`capslock`,27:`esc`,32:`space`,33:`pageup`,34:`pagedown`,35:`end`,36:`home`,37:`left`,38:`up`,39:`right`,40:`down`,45:`ins`,46:`del`,91:`meta`,93:`meta`,224:`meta`},a={106:`*`,107:`+`,109:`-`,110:`.`,111:`/`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},o={"~":"`","!":`1`,"@":`2`,"#":`3`,$:`4`,"%":`5`,"^":`6`,"&":`7`,"*":`8`,"(":`9`,")":`0`,_:`-`,"+":`=`,":":`;`,'"':`'`,"<":`,`,">":`.`,"?":`/`,"|":`\\`},s={option:`alt`,command:`meta`,return:`enter`,escape:`esc`,plus:`+`,mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?`meta`:`ctrl`},c,l=1;l<20;++l)i[111+l]=`f`+l;for(l=0;l<=9;++l)i[l+96]=l.toString();function u(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent(`on`+t,n)}function d(e){if(e.type==`keypress`){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return i[e.which]?i[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function f(e,t){return e.sort().join(`,`)===t.sort().join(`,`)}function p(e){var t=[];return e.shiftKey&&t.push(`shift`),e.altKey&&t.push(`alt`),e.ctrlKey&&t.push(`ctrl`),e.metaKey&&t.push(`meta`),t}function m(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function h(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function g(e){return e==`shift`||e==`ctrl`||e==`alt`||e==`meta`}function _(){if(!c)for(var e in c={},i)e>95&&e<112||i.hasOwnProperty(e)&&(c[i[e]]=e);return c}function v(e,t,n){return n||=_()[e]?`keydown`:`keypress`,n==`keypress`&&t.length&&(n=`keydown`),n}function y(e){return e===`+`?[`+`]:(e=e.replace(/\+{2}/g,`+plus`),e.split(`+`))}function b(e,t){var n,r,i,a=[];for(n=y(e),i=0;i<n.length;++i)r=n[i],s[r]&&(r=s[r]),t&&t!=`keypress`&&o[r]&&(r=o[r],a.push(`shift`)),g(r)&&a.push(r);return t=v(r,a,t),{key:r,modifiers:a,action:t}}function x(e,t){return e===null||e===n?!1:e===t||x(e.parentNode,t)}function S(e){var t=this;if(e||=n,!(t instanceof S))return new S(e);t.target=e,t._callbacks={},t._directMap={};var r={},i,a=!1,o=!1,s=!1;function c(e){e||={};var t=!1,n;for(n in r)e[n]?t=!0:r[n]=0;t||(s=!1)}function l(e,n,i,a,o,s){var c,l,u=[],d=i.type;if(!t._callbacks[e])return[];for(d==`keyup`&&g(e)&&(n=[e]),c=0;c<t._callbacks[e].length;++c)if(l=t._callbacks[e][c],(a||!l.seq||r[l.seq]==l.level)&&d==l.action&&(d==`keypress`&&!i.metaKey&&!i.ctrlKey||f(n,l.modifiers))){var p=!a&&l.combo==o,m=a&&l.seq==a&&l.level==s;(p||m)&&t._callbacks[e].splice(c,1),u.push(l)}return u}function _(e,n,r,i){t.stopCallback(n,n.target||n.srcElement,r,i)||e(n,r)===!1&&(m(n),h(n))}t._handleKey=function(e,t,n){var r=l(e,t,n),i,a={},u=0,d=!1;for(i=0;i<r.length;++i)r[i].seq&&(u=Math.max(u,r[i].level));for(i=0;i<r.length;++i)if(r[i].seq){if(r[i].level!=u)continue;d=!0,a[r[i].seq]=1,_(r[i].callback,n,r[i].combo,r[i].seq)}else d||_(r[i].callback,n,r[i].combo);var f=n.type==`keypress`&&o;n.type==s&&!g(e)&&!f&&c(a),o=d&&n.type==`keydown`};function v(e){typeof e.which!=`number`&&(e.which=e.keyCode);var n=d(e);n&&(e.type==`keyup`&&a===n?a=!1:t.handleKey(n,p(e),e))}function y(){clearTimeout(i),i=setTimeout(c,1e3)}function x(e,t,n,i){r[e]=0;function o(t){return function(){s=t,++r[e],y()}}function l(t){_(n,t,e),i!==`keyup`&&(a=d(t)),setTimeout(c,10)}for(var u=0;u<t.length;++u){var f=u+1===t.length?l:o(i||b(t[u+1]).action);C(t[u],f,i,e,u)}}function C(e,n,r,i,a){t._directMap[e+`:`+r]=n,e=e.replace(/\s+/g,` `);var o=e.split(` `),s;o.length>1?x(e,o,n,r):(s=b(e,r),t._callbacks[s.key]=t._callbacks[s.key]||[],l(s.key,s.modifiers,{type:s.action},i,e,a),t._callbacks[s.key][i?`unshift`:`push`]({callback:n,modifiers:s.modifiers,action:s.action,seq:i,level:a,combo:e}))}t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)C(e[r],t,n)},u(e,`keypress`,v),u(e,`keydown`,v),u(e,`keyup`,v)}S.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},S.prototype.unbind=function(e,t){var n=this;return n.bind.call(n,e,function(){},t)},S.prototype.trigger=function(e,t){var n=this;return n._directMap[e+`:`+t]&&n._directMap[e+`:`+t]({},e),n},S.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},S.prototype.stopCallback=function(e,t){var n=this;if((` `+t.className+` `).indexOf(` mousetrap `)>-1||x(t,n.target))return!1;if(`composedPath`in e&&typeof e.composedPath==`function`){var r=e.composedPath()[0];r!==e.target&&(t=r)}return t.tagName==`INPUT`||t.tagName==`SELECT`||t.tagName==`TEXTAREA`||t.isContentEditable},S.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},S.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);c=null},S.init=function(){var e=S(n);for(var t in e)t.charAt(0)!==`_`&&(S[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},S.init(),e.Mousetrap=S,t!==void 0&&t.exports&&(t.exports=S),typeof define==`function`&&define.amd&&define(function(){return S})})(typeof window<`u`?window:null,typeof window<`u`?document:null)}))(),1),ol=[],sl=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?sl:ol).push(n+=e[t])})();function cl(e){if(e<768)return!1;for(let t=0,n=ol.length;;){let r=t+n>>1;if(e<ol[r])n=r;else if(e>=sl[r])t=r+1;else return!0;if(t==n)return!1}}function ll(e){return e>=127462&&e<=127487}var ul=8205;function dl(e,t,n=!0,r=!0){return(n?fl:pl)(e,t,r)}function fl(e,t,n){if(t==e.length)return t;t&&hl(e.charCodeAt(t))&&gl(e.charCodeAt(t-1))&&t--;let r=ml(e,t);for(t+=_l(r);t<e.length;){let i=ml(e,t);if(r==ul||i==ul||n&&cl(i))t+=_l(i),r=i;else if(ll(i)){let n=0,r=t-2;for(;r>=0&&ll(ml(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function pl(e,t,n){for(;t>1;){let r=fl(e,t-2,n);if(r<t)return r;t--}return 0}function ml(e,t){let n=e.charCodeAt(t);if(!gl(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return hl(r)?(n-55296<<10)+(r-56320)+65536:n}function hl(e){return e>=56320&&e<57344}function gl(e){return e>=55296&&e<56320}function _l(e){return e<65536?1:2}var vl=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ol(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),bl.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ol(this,e,t);let n=[];return this.decompose(e,t,n,0),bl.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new wl(this),i=new wl(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new wl(this,e)}iterRange(e,t=this.length){return new Tl(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new El(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new yl(t):bl.from(yl.split(t,[]))}},yl=class e extends vl{constructor(e,t=xl(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Dl(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Cl(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=Sl(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Ol(this,t,n);let i=Sl(this.text,Sl(r.text,Cl(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):bl.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
3
|
+
`){[e,t]=Ol(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},bl=class e extends vl{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=Ol(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
4
|
+
`){[e,t]=Ol(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new yl(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof yl&&c&&(n=u[u.length-1])instanceof yl&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new yl(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};vl.empty=new yl([``],0);function xl(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Sl(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Cl(e,t,n){return Sl(e,[``],t,n)}var wl=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof yl?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof yl?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
5
|
+
`,this;e--}else if(r instanceof yl){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof yl?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Tl=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new wl(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},El=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(vl.prototype[Symbol.iterator]=function(){return this.iter()},wl.prototype[Symbol.iterator]=Tl.prototype[Symbol.iterator]=El.prototype[Symbol.iterator]=function(){return this});var Dl=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Ol(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function kl(e,t,n=!0,r=!0){return dl(e,t,n,r)}function Al(e){return e>=56320&&e<57344}function jl(e){return e>=55296&&e<56320}function Ml(e,t){let n=e.charCodeAt(t);if(!jl(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Al(r)?(n-55296<<10)+(r-56320)+65536:n}function Nl(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Pl(e){return e<65536?1:2}var Fl=/\r\n?|\n/,Il=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Il||={}),Ll=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){Vl(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:Ul(this,e)}mapDesc(e,t=!1){return e.empty?this:Hl(this,e,t)}mapPos(e,t=-1,n=Il.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=Il.Simple&&c>=e&&(n==Il.TrackDel&&r<e&&c>e||n==Il.TrackBefore&&r<e||n==Il.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},Rl=class e extends Ll{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Vl(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Hl(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(vl.empty);r.push(a?t.slice(i,i+a):vl.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:Ul(this,e,!0)}map(e,t=!1){return e.empty?this:Hl(this,e,t,!0)}iterChanges(e,t=!1){Vl(this,e,t)}get desc(){return Ll.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Wl(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);zl(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;zl(n,e,t),t>0&&Bl(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);zl(n,e,-1),zl(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Ll.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&zl(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?vl.of(l.split(r||Fl)):l:vl.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&zl(i,e-o,-1),zl(i,s-e,d),Bl(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(vl.empty);r[e]=vl.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function zl(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Bl(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(vl.empty);e.push(n)}}function Vl(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=vl.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Hl(e,t,n,r=!1){let i=[],a=r?[]:null,o=new Wl(e),s=new Wl(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);zl(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(zl(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(zl(i,0,o.ins),a&&Bl(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;zl(i,t,e<o.i?o.ins:0),a&&e<o.i&&Bl(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?Rl.createSet(i,a):Ll.create(i);else throw Error(`Mismatched change set lengths`)}function Ul(e,t,n=!1){let r=[],i=n?[]:null,a=new Wl(e),o=new Wl(t);for(let e=!1;;)if(a.done&&o.done)return i?Rl.createSet(r,i):Ll.create(r);else if(a.ins==0)zl(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)zl(r,0,o.ins,e),i&&Bl(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;zl(r,t,n,e),i&&n&&Bl(i,r,o.text)}else o.ins==-1?(zl(r,a.off?0:a.len,t,e),i&&Bl(i,r,a.textBit(t))):(zl(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Bl(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var Wl=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?vl.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?vl.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Gl=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return G.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return G.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return G.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},G=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>Gl.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return Gl.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?Gl.create(t,e,a|32,n):Gl.create(e,t,a,n)}static undirectionalRange(e,t){return Gl.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function Kl(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var ql=0,K=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ql++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:Jl),!!t.static,t.enables)}of(e){return new Yl([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Yl(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Yl(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function Jl(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var Yl=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ql++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||Zl(e,c)){let r=t(e);if(a?!Xl(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=uu(o,c);if(this.dependencies.every(t=>t instanceof K?o.facet(t)===e.facet(t):t instanceof eu?o.field(t,!1)==e.field(t,!1):!0)||(a?Xl(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function Xl(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Zl(e,t){let n=!1;for(let r of t)lu(e,r)&1&&(n=!0);return n}function Ql(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=uu(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)lu(e,t);return e.values[o]=s(e),1},update(e,n){if(!Zl(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=Zl(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&Jl(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var $l=K.define({static:!0}),eu=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(ql++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet($l).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet($l),i=n.facet($l),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,$l.of({field:this,create:e})]}get extension(){return this}},tu={lowest:4,low:3,default:2,high:1,highest:0};function nu(e){return t=>new iu(t,e)}var ru={highest:nu(tu.highest),high:nu(tu.high),default:nu(tu.default),low:nu(tu.low),lowest:nu(tu.lowest)},iu=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},au=class e{of(e){return new ou(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},ou=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},su=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of cu(t,n,o))e instanceof eu?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,Jl(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Ql(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function cu(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof ou&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof ou){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof iu)a(e.inner,e.prec);else if(e instanceof eu)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof Yl)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,tu.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,tu.default),r.reduce((e,t)=>e.concat(t))}function lu(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function uu(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var du=K.define(),fu=K.define({combine:e=>e.some(e=>e),static:!0}),pu=K.define({combine:e=>e.length?e[0]:void 0,static:!0}),mu=K.define(),hu=K.define(),gu=K.define(),_u=K.define({combine:e=>e.length?e[0]:!1}),vu=class{constructor(e,t){this.type=e,this.value=t}static define(){return new yu}},yu=class{of(e){return new vu(this,e)}},bu=class{constructor(e){this.map=e}of(e){return new xu(this,e)}},xu=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new bu(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};xu.reconfigure=xu.define(),xu.appendConfig=xu.define();var Su=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Kl(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};Su.time=vu.define(),Su.userEvent=vu.define(),Su.addToHistory=vu.define(),Su.remote=vu.define();function Cu(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function wu(e,t,n){let r,i,a;return n?(r=t.changes,i=Rl.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:xu.mapEffects(e.effects,r).concat(xu.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Tu(e,t,n){let r=t.selection,i=Au(t.annotations);return t.userEvent&&(i=i.concat(Su.userEvent.of(t.userEvent))),{changes:t.changes instanceof Rl?t.changes:Rl.of(t.changes||[],n,e.facet(pu)),selection:r&&(r instanceof G?r:G.single(r.anchor,r.head)),effects:Au(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Eu(e,t,n){let r=Tu(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=wu(r,Tu(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=Su.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Ou(n?Du(i):i)}function Du(e){let t=e.startState,n=!0;for(let r of t.facet(mu)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Cu(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=Rl.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=Su.create(t,r,e.selection&&e.selection.map(i),xu.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(hu);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof Su?i:Array.isArray(i)&&i.length==1&&i[0]instanceof Su?i[0]:Eu(t,Au(i),!1)}return e}function Ou(e){let t=e.startState,n=t.facet(gu),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=wu(r,Tu(t,a,e.changes.newLength),!0))}return r==e?e:Su.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var ku=[];function Au(e){return e==null?ku:Array.isArray(e)?e:[e]}var ju=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(ju||={}),Mu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Nu;try{Nu=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Pu(e){if(Nu)return Nu.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Mu.test(n)))return!0}return!1}function Fu(e){return t=>{if(!/\S/.test(t))return ju.Space;if(Pu(t))return ju.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return ju.Word;return ju.Other}}var Iu=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)lu(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`)}else return lu(this,n),uu(this,n)}update(...e){return Eu(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(au.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(xu.reconfigure)?(n=null,r=e.value):e.is(xu.appendConfig)&&(n=null,r=Au(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=su.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(fu)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:G.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Au(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=xu.mapEffects(a,c).concat(xu.mapEffects(Au(o.effects),l))}return{changes:r,selection:G.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof Rl?t:Rl.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return vl.of(t.split(this.facet(e.lineSeparator)||Fl))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(lu(this,t),uu(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof eu&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:G.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=su.resolve(t.extensions||[],new Map),r=t.doc instanceof vl?t.doc:vl.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||Fl)),i=t.selection?t.selection instanceof G?t.selection:G.single(t.selection.anchor,t.selection.head):G.single(0);return Kl(i,r.length),n.staticFacet(fu)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
6
|
+
`}get readOnly(){return this.facet(_u)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(du))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return Fu(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=kl(t,a,!1);if(i(t.slice(e,a))!=ju.Word)break;a=e}for(;o<r;){let e=kl(t,o);if(i(t.slice(o,e))!=ju.Word)break;o=e}return a==o?null:G.range(a+n,o+n)}};Iu.allowMultipleSelections=fu,Iu.tabSize=K.define({combine:e=>e.length?e[0]:4}),Iu.lineSeparator=pu,Iu.readOnly=_u,Iu.phrases=K.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),Iu.languageData=du,Iu.changeFilter=mu,Iu.transactionFilter=hu,Iu.transactionExtender=gu,au.reconfigure=xu.define();function Lu(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var Ru=class{eq(e){return this==e}range(e,t=e){return Bu.create(e,t,this)}};Ru.prototype.startSide=Ru.prototype.endSide=0,Ru.prototype.point=!1,Ru.prototype.mapMode=Il.TrackDel;function zu(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var Bu=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function Vu(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var Hu=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return Wu(this.to)}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},Uu=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Vu)),this.isEmpty)return n.length?e.of(n):this;let s=new Ju(this,null,-1).goto(0),c=0,l=[],u=new Ku;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value,!1)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value,!1)||l.push(Bu.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1,a,o=(e,t,n)=>{a||=new Ku,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[Wu(r)+Wu(n).length,Wu(Wu(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:new e(r,n,s||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Yu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Yu.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=qu(a,o,n),c=new Zu(a,s,i),l=new Zu(o,s,i);n.iterGaps((e,t,n)=>Qu(c,e,l,t,n,r)),n.empty&&n.length==0&&Qu(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=qu(i,a),s=new Zu(i,o,0).goto(n),c=new Zu(a,o,0).goto(n);for(;;){if(s.to!=c.to||!$u(s.active,c.active)||s.point&&(!c.point||!zu(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new Zu(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new Ku;for(let r of e instanceof Bu?[e]:t?Gu(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=Wu(t);for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};Uu.empty=new Uu([],[],null,-1);function Wu(e){return e[e.length-1]}function Gu(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(Vu(t,r)>0)return e.slice().sort(Vu);t=r}return e}Uu.empty.nextLayer=Uu.empty;var Ku=class e{finishChunk(e){this.chunks.push(new Hu(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addRange(e,t,n,!0)}addRange(t,n,r,i){this.addInner(t,n,r,i)||(this.nextLayer||=new e).addRange(t,n,r,i)}addInner(e,t,n,r){let i=e-this.lastTo||n.startSide-this.last.endSide;if(r&&i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Uu.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Uu.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function qu(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var Ju=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},Yu=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new Ju(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Xu(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Xu(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Xu(this.heap,0)}}};function Xu(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var Zu=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Yu.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ed(this.active,e),ed(this.activeTo,e),ed(this.activeRank,e),this.minActive=nd(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;td(this.active,t,n),td(this.activeTo,t,r),td(this.activeRank,t,i),e&&td(e,t,this.cursor.from),this.minActive=nd(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ed(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function Qu(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&zu(e.point,n.point)&&$u(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&=(a.boundChange(s),!1),d>s&&!$u(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function $u(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!zu(e[n],t[n]))return!1;return!0}function ed(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function td(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function nd(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function rd(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=kl(e,i));return r}function id(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=kl(e,r)}return r===!0?-1:e.length}for(var ad=`ͼ`,od=typeof Symbol>`u`?`__ͼ`:Symbol.for(ad),sd=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),cd=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},ld=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
7
|
+
`)}static newName(){let e=cd[od]||1;return cd[od]=e+1,ad+e.toString(36)}static mount(e,t,n){let r=e[sd],i=n&&n.nonce;r?i&&r.setNonce(i):r=new dd(e,i),r.mount(Array.isArray(t)?t:[t],e)}},ud=new Map,dd=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=ud.get(n);if(t)return e[sd]=t;this.sheet=new r.CSSStyleSheet,ud.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[sd]=this}mount(e,t){let n=this.sheet,r=0,i=0,a=!1;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),a=!0,i--,s=-1),s==-1){if(this.modules.splice(i++,0,o),a=!0,n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(a){let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
8
|
+
`;this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},fd={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},pd={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},md=typeof navigator<`u`&&/Mac/.test(navigator.platform),hd=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),gd=0;gd<10;gd++)fd[48+gd]=fd[96+gd]=String(gd);for(var gd=1;gd<=24;gd++)fd[gd+111]=`F`+gd;for(var gd=65;gd<=90;gd++)fd[gd]=String.fromCharCode(gd+32),pd[gd]=String.fromCharCode(gd);for(var _d in fd)pd.hasOwnProperty(_d)||(pd[_d]=fd[_d]);function vd(e){var t=!(md&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||hd&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?pd:fd)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function yd(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)bd(e,arguments[t]);return e}function bd(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)bd(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var xd=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Sd=typeof document<`u`?document:{documentElement:{style:{}}},Cd=/Edge\/(\d+)/.exec(xd.userAgent),wd=/MSIE \d/.test(xd.userAgent),Td=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xd.userAgent),Ed=!!(wd||Td||Cd),Dd=!Ed&&/gecko\/(\d+)/i.test(xd.userAgent),Od=!Ed&&/Chrome\/(\d+)/.exec(xd.userAgent),kd=`webkitFontSmoothing`in Sd.documentElement.style,Ad=!Ed&&/Apple Computer/.test(xd.vendor),jd=Ad&&(/Mobile\/\w+/.test(xd.userAgent)||xd.maxTouchPoints>2),q={mac:jd||/Mac/.test(xd.platform),windows:/Win/.test(xd.platform),linux:/Linux|X11/.test(xd.platform),ie:Ed,ie_version:wd?Sd.documentMode||6:Td?+Td[1]:Cd?+Cd[1]:0,gecko:Dd,gecko_version:Dd?+(/Firefox\/(\d+)/.exec(xd.userAgent)||[0,0])[1]:0,chrome:!!Od,chrome_version:Od?+Od[1]:0,ios:jd,android:/Android\b/.test(xd.userAgent),webkit:kd,webkit_version:kd?+(/\bAppleWebKit\/(\d+)/.exec(xd.userAgent)||[0,0])[1]:0,safari:Ad,safari_version:Ad?+(/\bVersion\/(\d+(\.\d+)?)/.exec(xd.userAgent)||[0,0])[1]:0,tabSize:Sd.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Md(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Nd=Object.create(null);function Pd(e,t,n){if(e==t)return!0;e||=Nd,t||=Nd;let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Fd(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Id(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Ld(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var Rd=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},zd=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(zd||={}),Bd=class extends Ru{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Vd(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Ud(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Wd(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Ud(e,n,r,t,e.widget||null,!0)}static line(e){return new Hd(e)}static set(e,t=!1){return Uu.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Bd.none=Uu.empty;var Vd=class e extends Bd{constructor(e){let{start:t,end:n}=Wd(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Md(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Nd}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Pd(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};Vd.prototype.point=!1;var Hd=class e extends Bd{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Pd(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};Hd.prototype.mapMode=Il.TrackBefore,Hd.prototype.point=!0;var Ud=class e extends Bd{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?Il.TrackBefore:Il.TrackAfter:Il.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?zd.WidgetBefore:zd.WidgetAfter:zd.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Gd(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};Ud.prototype.point=!0;function Wd(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Gd(e,t){return e==t||!!(e&&t&&e.compare(t))}function Kd(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var qd=class e extends Ru{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Pd(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Nd,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return Uu.of(e,t)}};qd.prototype.startSide=qd.prototype.endSide=-1;var Jd=e=>e.nodeType==1,Yd=e=>e.nodeType==3;function Xd(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Zd(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Qd(e,t){if(!t.anchorNode)return!1;try{return Zd(e,t.anchorNode)}catch{return!1}}function $d(e){return Yd(e)?_f(e,0,e.nodeValue.length).getClientRects():Jd(e)?e.getClientRects():[]}function ef(e,t,n,r){return n?rf(e,t,n,r,-1)||rf(e,t,n,r,1):!1}function tf(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function nf(e){return Jd(e)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function rf(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:af(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||!Jd(n))return!1;t=tf(e)+(i<0?0:1),e=n}else if(Jd(e)){if(e=e.childNodes[t+(i<0?-1:0)],Jd(e)&&(e.nodeName==`IMG`||e.nodeName==`BR`||e.contentEditable==`false`))return!1;t=i<0?af(e):0}else return!1}}function af(e){return Yd(e)?e.nodeValue.length:e.childNodes.length}function of(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function sf(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function cf(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function lf(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(Jd(u)){let e,f=u==c.body,p=1,m=1;if(f)e=sf(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=cf(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function uf(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(Jd(a))!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var df=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?af(t):0),n,Math.min(e.focusOffset,n?af(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function ff(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)Jd(n)&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function pf(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var mf=null;q.safari&&q.safari_version>=26&&(mf=!1);function hf(e){if(e.setActive)return e.setActive();if(mf)return e.focus(mf);let t=ff(e);e.focus(mf==null?{get preventScroll(){return mf={preventScroll:!0},!0}}:void 0),mf||(mf=!1,pf(t))}var gf;function _f(e,t,n=t){let r=gf||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function vf(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function yf(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function bf(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,af(n));;)if(r){if(!Jd(n))return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=af(n))}else if(n==e)return!0;else r=tf(n),n=n.parentNode}function xf(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Sf(e,t){for(let n=e,r=t;;)if(Yd(n)&&r>0)return{node:n,offset:r};else if(Jd(n)&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=af(n)}else if(n.parentNode&&!nf(n))r=tf(n),n=n.parentNode;else return null}function Cf(e,t){for(let n=e,r=t;;)if(Yd(n)&&r<n.nodeValue.length)return{node:n,offset:r};else if(Jd(n)&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!nf(n))r=tf(n)+1,n=n.parentNode;else return null}var wf=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,tf(t),n)}static after(t,n){return new e(t.parentNode,tf(t)+1,n)}},Tf=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(Tf||={}),Ef=Tf.LTR,Df=Tf.RTL;function Of(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var kf=Of(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),Af=Of(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),jf=Object.create(null),Mf=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);jf[t]=n,jf[n]=-t}function Nf(e){return e<=247?kf[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Af[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var Pf=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Ff=class{get dir(){return this.level%2?Df:Ef}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function If(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!If(r.inner,i.inner))return!1}return!0}var Lf=[];function Rf(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=Nf(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),Lf[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=Lf[e];if(i==128)e<s-1&&t==Lf[e+1]&&t&24?i=Lf[e]=t:Lf[e]=256;else if(i==64){let i=e+1;for(;i<s&&Lf[i]==64;)i++;let a=e&&t==8||i<n&&Lf[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)Lf[t]=a;e=i-1}else i==8&&r==1&&(Lf[e]=1);t=i,i&7&&(r=i)}}}function zf(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=jf[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(Mf[e+1]==-r){let n=Mf[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(Lf[t]=Lf[Mf[e]]=r),s=e;break}}else if(Mf.length==189)break;else Mf[s++]=t,Mf[s++]=n,Mf[s++]=c}else if((o=Lf[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=Mf[t+2];if(n&2)break;if(e)Mf[t+2]|=2;else{if(n&4)break;Mf[t+2]|=4}}}}}function Bf(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=Lf[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(Lf[o]==256)o++;else break;let l=a==1,u=l==((o<t?Lf[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),Lf[--t]=u;c=o}else a=o,c++}}}function Vf(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=Lf[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(Lf[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new Ff(c,m.from,f)),Hf(e,m.direction==Ef==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?Lf[p]!=s:Lf[p]==s))break;else p++;d?Vf(e,c,p,r+1,i,d,o):c<p&&o.push(new Ff(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=Lf[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(Lf[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new Ff(m.to,c,f)),Hf(e,m.direction==Ef==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?Lf[p-1]!=s:Lf[p-1]==s))break;else p--;d?Vf(e,p,c,r+1,i,d,o):p<c&&o.push(new Ff(p,c,f)),c=p}}function Hf(e,t,n,r,i,a,o){let s=t%2?2:1;Rf(e,i,a,r,s),zf(e,i,a,r,s),Bf(i,a,r,s),Vf(e,i,a,t,n,r,o)}function Uf(e,t,n){if(!e)return[new Ff(0,0,+(t==Df))];if(t==Ef&&!n.length&&!Pf.test(e))return Wf(e.length);if(n.length)for(;e.length>Lf.length;)Lf[Lf.length]=256;let r=[],i=t==Ef?0:1;return Hf(e,i,i,n,0,e.length,r),r}function Wf(e){return[new Ff(0,e,0)]}var Gf=``;function Kf(e,t,n,r,i){if(!e.length)return null;let a=r.head-e.from,o;if(r.head==e.from&&r.assoc<0){if(!i)return null;a=t[o=0].side(!1,n)}else if(r.head==e.to&&r.assoc>0){if(i)return null;a=t[o=t.length-1].side(!0,n)}else o=Ff.find(t,a,r.bidiLevel??-1,r.assoc);let s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=kl(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),Gf=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];if(l==c){if(!u)return i?G.cursor(e.to,1):G.cursor(e.from,-1);if(u.level+ +!i<s.level)return G.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level)}return G.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function qf(e,t,n){for(let r=t;r<n;r++){let t=Nf(e.charCodeAt(r));if(t==1)return Ef;if(t==2||t==4)return Df}return Ef}var Jf=K.define(),Yf=K.define(),Xf=K.define(),Zf=K.define(),Qf=K.define(),$f=K.define(),ep=K.define(),tp=K.define(),np=K.define(),rp=K.define({combine:e=>e.some(e=>e)}),ip=K.define({combine:e=>e.some(e=>e)}),ap=K.define(),op=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(G.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},sp=xu.define({map:(e,t)=>e.map(t)}),cp=xu.define();function lp(e,t,n){let r=e.facet(Zf);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var up=K.define({combine:e=>!e.length||e[0]}),dp=0,fp=K.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),pp=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(fp.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(fp.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(dp++,t,r,i,e=>{let t=[];return o&&t.push(_p.of(t=>{let n=t.plugin(e);return n?o(n):Bd.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},mp=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){lp(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(lp(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){lp(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},hp=K.define(),gp=K.define(),_p=K.define(),vp=K.define(),yp=K.define(),bp=K.define(),xp=K.define();function Sp(e,t){let n=e.state.facet(xp);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return Uu.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=qf(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var Cp=K.define();function wp(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(Cp)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var Tp=K.define(),Ep=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},Dp=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Rl.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new Ep(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Op=[],kp=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Op}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Fd(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=tf(this.dom),r=this.length?e>0:t>0;return new wf(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Mp)return e;return null}static get(e){return e.cmTile}},Ap=class extends kp{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=jp(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=jp(r);this.length=a}};function jp(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Mp=class extends Ap{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=kp.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof Np)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},Np=class e extends Ap{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Pp=class e extends Ap{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n=!1){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||n&&a.isHidden&&(t>0&&!(a.flags&32)||n&&Ip(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!(n&&d.isHidden)&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):Fp(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new wf(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new wf(e.dom,0);e==n.tile&&(a=!0)}}return new wf(this.dom,0)}};function Fp(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=$d(t);return n[n.length-1]||null}function Ip(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var Lp=class e extends Ap{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Rp=class e extends kp{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?q.chrome||q.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=_f(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return q.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:of(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},zp=class e extends kp{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return of(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return of(n,!r)}}get overrideDOMText(){if(!this.length)return vl.empty;let{root:e}=this;if(!e)return vl.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},Bp=class extends kp{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return vl.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:of(r,t>0==n)}},Vp=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Hp=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},Up=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new Rp(a.dom,a.text+e);t.parent=i}else i.append(r||Rp.of(e,this.cache.find(Rp)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?$p(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Lp&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM($p(n.dom)),r=i;else{let{dom:e}=n;this.cache.reused.get(n)&&kp.get(n.dom)&&(e=$p(n.dom));let t=Lp.of(n.mark,e);r.append(t),r=t}this.cache.reused.set(n,2)}let i=kp.get(e.text);i&&this.cache.reused.set(i,2);let a=new Rp(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=Xp;let n=Pp.start(e,t||this.cache.find(Pp)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof Lp&&a.mark.eq(i))n=a,t--;else{let e=Lp.of(i,this.cache.find(Lp,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Jp(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(q.ios&&Jp(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(tm,0,32)||new zp(tm.toDOM(),0,tm,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new Hp(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof Np&&n.wrapper.eq(t.wrapper))e=n;else{let n=Np.of(t.wrapper,this.cache.find(Np,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Bp,void 0,1);return n&&(n.flags=t),n||new Bp(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Wp=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},Gp=[zp,Pp,Rp,Lp,Bp,Np,Mp];for(let e=0;e<Gp.length;e++)Gp[e].bucket=e;var Kp=class{constructor(e){this.view=e,this.buckets=Gp.map(()=>[]),this.index=Gp.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new zp(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},qp=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new Kp(e),this.text=new Wp(e.state.doc),this.builder=new Up(this.cache,new Mp(e,e.contentDOM),Uu.iter(n)),this.cache.reused.set(t,2),this.old=new Vp(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=Qp(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?zp.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Bp)this.cache.add(e);else if(e instanceof Lp)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Lp&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof Lp&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=Uu.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof Ud){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?em.block:em.inline),c=Yp(a),l=this.cache.findWidget(i,t-e,c)||zp.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=Zp(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=kp.get(r);if(r==this.view.contentDOM)break;e instanceof Lp?t.push(e):e?.isLine()?n=e:e instanceof Np||(r.nodeName==`DIV`&&!n?n=new Pp(r,Xp):n||t.push(Lp.of(new Vd({tagName:r.nodeName.toLowerCase(),attributes:Ld(r)}),r)))}return n?{line:n,marks:t}:null}};function Jp(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function Yp(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var Xp={class:`cm-line`};function Zp(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||={class:`cm-line`},n&&Md(n,e),r&&(e.class+=` `+r)),e}function Qp(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Lp&&t.push(r.mark)}return t}function $p(e){let t=kp.get(e);return t&&t.setDOM(e.cloneNode()),e}var em=class extends Rd{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};em.inline=new em(`span`),em.block=new em(`div`);var tm=new class extends Rd{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},nm=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Bd.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Mp(e,e.contentDOM),this.updateInner([new Ep(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!pm(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?om(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new Ep(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(q.ie||q.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=lm(i,this.decorations,e.changes);o.length&&(t=Ep.extendWithRanges(t,o));let s=dm(a,this.blockWrappers,e.changes);return s.length&&(t=Ep.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new qp(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&kp.get(t.text)&&r.cache.reused.set(kp.get(t.text),2),this.tile=r.run(e,t),rm(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=q.chrome||q.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof mm&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(cp)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(up)||n.tabIndex>-1)&&Qd(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),q.gecko&&s.empty&&!this.hasComposition&&im(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new wf(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!ef(c.node,c.offset,u.anchorNode,u.anchorOffset)||!ef(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{q.android&&q.chrome&&n.contains(u.focusNode)&&fm(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Xd(this.view.root);if(e){if(s.empty){if(q.gecko){let e=sm(c.node,c.offset);if(e&&e!=3){let t=(e==1?Sf:Cf)(c.node,c.offset);t&&(c=new wf(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new wf(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new wf(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ef(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Xd(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=af(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!kp.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof mm?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=kl(e.text,t);if(n==t)return null;let r=_f(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==Tf.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof Np)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?$d(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?Tf.RTL:Tf.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=$d(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=$d(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Bd.replace({widget:new mm(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return Bd.set(e)}updateDeco(){let e=1,t=this.view.state.facet(_p).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(yp).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(Uu.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(vp).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(ap))try{if(t(this.view,e.range,e))return!0}catch(e){lp(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=wp(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(lf(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==Tf.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=ff(e.dom);e.dom.scrollIntoView({block:`nearest`}),pf(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){rm(this.tile)}};function rm(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)rm(n,t)}}function im(e){return Jd(e.node)&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function am(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Sf(n.focusNode,n.focusOffset),i=Cf(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=kp.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=kp.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function om(e,t,n){let r=am(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new Ep(c.mapPos(a),c.mapPos(o),a,o),text:i}}function sm(e,t){return Jd(e)?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var cm=class{constructor(){this.changes=[]}compareRange(e,t){Kd(e,t,this.changes)}comparePoint(e,t){Kd(e,t,this.changes)}boundChange(e){Kd(e,e,this.changes)}};function lm(e,t,n){let r=new cm;return Uu.compare(e,t,n,r),r.changes}var um=class{constructor(){this.changes=[]}compareRange(e,t){Kd(e,t,this.changes)}comparePoint(){}boundChange(e){Kd(e,e,this.changes)}};function dm(e,t,n){let r=new um;return Uu.compare(e,t,n,r),r.changes}function fm(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(Jd(n)&&n.contentEditable==`false`)return!0;return!1}function pm(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var mm=class extends Rd{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function hm(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return G.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=kl(i.text,a,!1):s=kl(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=kl(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=kl(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return G.undirectionalRange(o+i.from,s+i.from)}function gm(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+id(o,a,e.state.tabSize)}function _m(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==zd.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function vm(e,t,n,r){let i=_m(e,t.head,t.assoc||-1),a=!r||i.type!=zd.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==Tf.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return G.cursor(o,n?-1:1)}return G.cursor(n?i.to:i.from,n?-1:1)}function ym(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=Kf(i,a,o,s,n),l=Gf;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
9
|
+
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=n?G.cursor(i.from,-1):G.cursor(i.to,1)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function bm(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==ju.Space&&(i=t),i==t}}function xm(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return G.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Em(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return G.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return G.cursor(i.pos,i.assoc,void 0,o)}}function Sm(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Cm(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Sm(e,i.from,0);t!=i.from&&(a=G.cursor(t,-1))}else{let t=Sm(e,i.from,-1),n=Sm(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?G.undirectionalRange(i.from,i.to):G.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?G.create(n,t.mainIndex):t}function wm(e,t,n){let r=Sm(e.state.facet(bp).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:G.cursor(r,r<n.from?1:-1)}var Tm=class{constructor(e,t){this.pos=e,this.assoc=t}};function Em(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new Tm(0,1);if(c>e.viewState.docHeight)return new Tm(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==zd.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==zd.Text){let t=gm(e,i,l,o,s);return new Tm(t,t==l.from?1:-1)}}if(l.type!=zd.Text)return c<(l.top+l.bottom)/2?new Tm(l.from,1):new Tm(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new Dm(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var Dm=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Ff.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Ff.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==Tf.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==Tf.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=kl(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return _f(e.dom,i,a).getClientRects()});return r.after?new Tm(n[r.i+1],-1):new Tm(n[r.i],1)}scanTile(e,t){if(!e.length)return new Tm(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(Jd(n.dom)?n.dom:_f(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new Tm(n[r.i+1],-1):new Tm(a,1)}},Om=``,km=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(Iu.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Om}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=kp.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=kp.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:nf(r))||nf(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!jm(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=kp.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else Yd(e)?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():Jd(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(Yd(e)?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Am(e,n.node,n.offset)?t:0))}};function Am(e,t,n){for(;;){if(!t||n<af(t))return!1;if(t==e)return!0;n=tf(t)+1,t=t.parentNode}}function jm(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=kp.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var Mm=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Nm=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Pm(e.docView.tile,t,n,0))){let t=i||a?[]:zm(e),n=new km(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=Bm(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Zd(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Zd(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((q.ios||q.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(G.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=G.create([G.cursor(n,r)])}else this.newSel=G.single(r,n)}}};function Pm(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Pm(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function Fm(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||q.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,Om),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:vl.of(t.text.slice(a.from-e,u).split(Om))}:(d=Rm(l,t.text,s-e,c))&&(q.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:vl.of(t.text.slice(d.from,d.toB).split(Om))})}else r&&(!e.hasFocus&&i.facet(up)||Vm(r,a))&&(r=null);if(!n&&!r)return!1;if((q.mac||q.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=G.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:vl.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:q.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
10
|
+
`&&e.lineWrapping&&(r&&=G.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:vl.of([` `])}),n)return Im(e,n,r,o);if(r&&!Vm(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Cm(i.facet(bp).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function Im(e,t,n,r=-1){if(q.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(q.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&vf(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&vf(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&vf(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Lm(e,t,n);return e.state.facet($f).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Lm(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Sm(i.facet(bp).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:G.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&am(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?G.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Rm(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function zm(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new Mm(n,r)),(i!=n||a!=r)&&t.push(new Mm(i,a))),t}function Bm(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n<0||r<0?null:n==r?G.create([G.cursor(r+t,-1)]):G.single(n+t,r+t)}function Vm(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Hm=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,q.safari&&e.contentDOM.addEventListener(`input`,()=>null),q.gecko&&Th(e.contentDOM.ownerDocument)}handleEvent(e){nh(this.view,e)&&!this.ignoreDuringComposition(e)&&(e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e))))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Gm(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Jm.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),q.android&&q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(Km.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||qm.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&q.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Um(this.view.win)&&(t.shiftKey=!1);let n=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==n&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,vf(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:q.safari&&!q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Um(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Wm(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){lp(n.state,e)}}}function Gm(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Wm(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Wm(t.value,r))}}for(let e in rh)n(e).handlers.push(rh[e]);for(let e in ih)n(e).observers.push(ih[e]);return t}var Km=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],qm=`dthko`,Jm=[16,17,18,20,91,92,224,225],Ym=6;function Xm(e){return Math.max(0,e)*.7+8}function Zm(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var Qm=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=uf(e.contentDOM),this.atoms=e.state.facet(bp).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Iu.allowMultipleSelections)&&$m(e,t),this.dragging=th(e,t)&&mh(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=wp(this.view);e.clientX-s.left<=r+Ym?t=-Xm(r-e.clientX):e.clientX+s.right>=a-Ym&&(t=Xm(e.clientX-a)),e.clientY-s.top<=i+Ym?n=-Xm(i-e.clientY):e.clientY+s.bottom>=o-Ym&&(n=Xm(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Cm(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function $m(e,t){let n=e.state.facet(Jf);return n.length?n[0](t):q.mac?t.metaKey:t.ctrlKey}function eh(e,t){let n=e.state.facet(Yf);return n.length?n[0](t):q.mac?!t.altKey:!t.ctrlKey}function th(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Xd(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function nh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=kp.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var rh=Object.create(null),ih=Object.create(null),ah=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function oh(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),ch(e,n.value)},50)}function sh(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function ch(e,t){t=sh(e.state,tp,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(bh!=null&&n.selection.ranges.every(e=>e.empty)&&bh==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:G.cursor(r.from+c.length,-1)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:G.cursor(e.from+t.length,-1)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}ih.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,q.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},ih.wheel=ih.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},rh.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ih.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},ih.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},ih.touchend=(e,t)=>{e.inputState.touchActive=!1},rh.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Xf))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=hh(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Qm(e,t,n,r)),r&&e.observer.ignore(()=>{hf(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function lh(e,t,n,r){if(r==1)return G.cursor(t,n);if(r==2)return hm(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,G.undirectionalRange(a,o)}}var uh=q.ie&&q.ie_version<=11,dh=null,fh=0,ph=0;function mh(e){if(!uh)return e.detail;let t=dh,n=ph;return dh=e,ph=Date.now(),fh=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(fh+1)%3:1}function hh(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=mh(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=lh(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=lh(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?G.range(i,a,l.assoc):G.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=gh(i,s.pos))?c:o?i.addRange(l):G.create([l])}}}function gh(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return G.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}rh.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=G.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,sh(e.state,np,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},rh.dragend=e=>(e.inputState.draggedContent=null,!1);function _h(e,t,n,r){if(n=sh(e.state,tp,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&eh(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}rh.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&_h(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return _h(e,t,n,!0),!0}return!1},rh.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=ah?null:t.clipboardData;return n?(ch(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(oh(e),!1)};function vh(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function yh(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:sh(e,np,t.join(e.lineBreak)),ranges:n,linewise:r}}var bh=null;rh.copy=rh.cut=(e,t)=>{if(!Qd(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=yh(e.state);if(!n&&!i)return!1;bh=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=ah?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(vh(e,n),!1)};var xh=vu.define();function Sh(e,t){let n=[];for(let r of e.facet(ep)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:xh.of(!0)}):null}function Ch(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Sh(e.state,t);n?e.dispatch(n):e.update([])}},10)}ih.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Ch(e)},ih.blur=e=>{e.observer.clearSelectionRange(),Ch(e)},ih.compositionstart=ih.compositionupdate=(e,t)=>{if(!e.observer.editContext&&(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;!t.empty&&e.lineBlockAt(t.from).from!=e.lineBlockAt(t.to).from&&!e.state.readOnly&&e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:`input`}),e.inputState.composing=0}},ih.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,q.chrome&&q.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},ih.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},rh.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Im(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(q.chrome&&q.android&&(n=Km.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return q.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),q.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>ih.compositionend(e,t),20),!1};var wh=new Set;function Th(e){wh.has(e)||(wh.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var Eh=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],Dh=!1;function Oh(){Dh=!1}var kh=class{constructor(e){this.lineWrapping=e,this.doc=vl.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Eh.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=Eh.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},Ah=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},jh=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?zd.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ud?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},Mh=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(Mh||={}),Nh=.001,Ph=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Nh&&(Dh=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,Mh.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,Mh.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,Mh.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=Uh.build(n.setDoc(a),e,l,u);i=Fh(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new Rh(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=!1;return t[n-1]==null?(o=!0,n--):t[n]??(o=!0,r++),new Bh(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function Fh(e,t){return e==t?e:(e.constructor!=t.constructor&&(Dh=!0),t)}Ph.prototype.size=1;var Ih=Bd.replace({}),Lh=class extends Ph{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new jh(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new jh(r,0,n,this.spaceAbove,Ih):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,Mh.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Rh=class e extends Lh{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new jh(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof zh&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof zh?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Ph.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},zh=class e extends Ph{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new jh(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new jh(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==Mh.ByHeight)return this.blockAt(e,n,r,i);if(t==Mh.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new jh(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new jh(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new jh(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return Ph.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=Nh&&(s=-2);let c=new Rh(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=Ph.of(r);return(s<0||Math.abs(c.height-this.height)>=Nh||Math.abs(s-this.heightMetrics(t,n).perLine)>=Nh)&&(Dh=!0),Fh(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},Bh=class extends Ph{constructor(e,t,n){super(e.length+ +!!t+n.length,e.height+n.height,+!!t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==Mh.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==Mh.ByPosNoHeight?Mh.ByPosNoHeight:Mh.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,Mh.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,Math.min(t,c.from-1),n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(Math.max(e,c.to+1),t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Vh(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Vh(i,e)}return Ph.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ph.of(this.break?[e,null,t]:[e,t]):(this.left=Fh(this.left,e),this.right=Fh(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function Vh(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof zh&&(r=e[t+1])instanceof zh&&e.splice(t-1,3,new zh(n.length+1+r.length))}var Hh=5,Uh=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Rh?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Rh(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Lh(a,r,n)):(a||i||r>=Hh)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Rh(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new zh(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Rh)return e;let t=new Rh(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Rh)&&!this.isCovered?this.nodes.push(new Rh(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof Rh&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return Uu.spans(n,r,i,a,0),a.finish(r)}};function Wh(e,t,n){let r=new Gh;return Uu.compare(e,t,n,r,0),r.changes}var Gh=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Kd(e,t,this.changes,5)}};function Kh(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(Jd(t)){let n=window.getComputedStyle(t);if((t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&n.overflow!=`visible`){let n=t.getBoundingClientRect();a=Math.max(a,n.left),o=Math.min(o,n.right),s=Math.max(s,n.top),c=Math.min(t==e.parentNode?i.innerHeight:c,n.bottom)}t=n.position==`absolute`||n.position==`fixed`?t.offsetParent:t.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function qh(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function Jh(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var Yh=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return Bd.replace({widget:new Xh(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},Xh=class extends Rd{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},Zh=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rg,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Tf.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(gp).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new kh(n),this.stateDeco=ig(t),this.heightMap=Ph.empty().applyChanges(this.stateDeco,vl.empty,this.heightOracle.setDoc(t.doc),[new Ep(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Bd.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new Qh(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?rg:new ag(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(og(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=ig(this.state);let r=e.changedRanges,i=Ep.extendWithRanges(r,Wh(n,this.stateDeco,e?e.changes:Rl.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Oh(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Dh)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ip)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?Tf.RTL:Tf.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=cf(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=uf(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=xf(this.scrollParent||e.win);let m=(this.printing?Jh:Kh)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!qh(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),Oh();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?Ph.empty().applyChanges(this.stateDeco,vl.empty,this.heightOracle,[new Ep(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new Ah(n.from,i))}Dh&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new Qh(r.lineAt(a-n*1e3,Mh.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,Mh.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,Mh.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new Qh(r.lineAt(o-500,Mh.ByHeight,i,0,0).from,r.lineAt(o+n+500,Mh.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Qh(this.heightMap.lineAt(n,Mh.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Mh.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Mh.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,Mh.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Yh(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=Tf.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=ng(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(G.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new Yh(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=zd.Text)return;let i=$h(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=tg(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=eg(i,n),l=eg(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=tg(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=eg(i,f),l=eg(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=tg(r,n)-tg(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Yh.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Bd.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];Uu.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||og(this.heightMap.lineAt(e,Mh.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||og(this.heightMap.lineAt(this.scaler.fromDOM(e),Mh.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return og(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Qh=class{constructor(e,t){this.from=e,this.to=t}};function $h(e,t,n){let r=[],i=e,a=0;return Uu.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function eg({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function tg(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function ng(e,t){for(let n of e)if(t(n))return n}var rg={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ig(e){let t=e.facet(_p).filter(e=>typeof e!=`function`),n=e.facet(yp).filter(e=>typeof e!=`function`);return n.length&&t.push(Uu.join(n)),t}var ag=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,Mh.ByPos,e,0,0).top,o=t.lineAt(i,Mh.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function og(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new jh(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>og(e,t)):e._content)}var sg=K.define({combine:e=>e.join(` `)}),cg=K.define({combine:e=>e.indexOf(!0)>-1}),lg=ld.newName(),ug=ld.newName(),dg=ld.newName(),fg={"&light":`.`+ug,"&dark":`.`+dg};function pg(e,t,n){return new ld(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var mg=pg(`.`+lg,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`baseline`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{background:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat`,backgroundSize:`.4em`,backgroundPosition:`calc(min(50%, 0px)) center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},fg),hg={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},gg=q.ie&&q.ie_version<=11,_g=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new df,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&q.android&&e.constructor.EDIT_CONTEXT!==!1&&!(q.chrome&&q.chrome_version<126)&&(this.editContext=new xg(e),e.state.facet(up)&&(e.contentDOM.editContext=this.editContext.editContext)),gg&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type!=`change`&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(up)?n.root.activeElement!=this.dom:!Qd(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);i&&i.isWidget()&&i.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(q.ie&&q.ie_version<=11||q.android&&q.chrome)&&!n.state.selection.main.empty&&r.focusNode&&ef(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Xd(e.root);if(!t)return!1;let n=q.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&bg(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Qd(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&bf(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(Jd(n))!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,hg),gg&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),gg&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&vf(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Qd(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Nm(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.selectionChanged,n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Fm(this.view,n);return this.view.state==r&&(n.domChanged||t)&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=vg(t,e.previousSibling||e.target.previousSibling,-1),r=vg(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(up)!=e.state.facet(up)&&(e.view.contentDOM.editContext=e.state.facet(up)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function vg(e,t,n){for(;t;){let r=kp.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function yg(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return ef(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function bg(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return yg(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?yg(e,n):null}var xg=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Rm(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=G.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Vm(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:vl.of(n.text.slice(l.from,l.toB).split(`
|
|
11
|
+
`))};if((q.mac||q.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:vl.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Im(e,u,G.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(Bd.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:cp.of(Bd.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=Xd(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},J=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||yf(e.parent)||document,this.viewState=new Zh(this,e.state||Iu.create(e)),e.scrollTo&&e.scrollTo.is(sp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(fp).map(e=>new mp(e));for(let e of this.plugins)e.update(this);this.observer=new _g(this),this.inputState=new Hm(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nm(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Su?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(xh))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=Sh(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(Iu.phrases)!=this.state.facet(Iu.phrases))return this.setState(a);i=Dp.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new op(t.empty?t:G.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(sp)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=wg.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Tp)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(sg)!=i.state.facet(sg)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(Qf))try{e(i)}catch(e){lp(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!Fm(this,u)&&l.force&&vf(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Zh(this,e),this.plugins=e.facet(fp).map(e=>new mp(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new nm(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(fp),n=e.state.facet(fp);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new mp(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){lp(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a,scaleY:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(xf(n||this.win))i=-1,a=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}o=this.viewState.scaleY}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let l=c.map(e=>{try{return e.read(this)}catch(e){return lp(this.state,e),Cg}}),u=Dp.create(this,this.state,[]),d=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let e=0;e<c.length;e++)if(l[e]!=Cg)try{let t=c[e];t.write&&t.write(l[e],this)}catch(e){lp(this.state,e)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)/this.viewState.scaleY-a/o;if((e>1||e<-1)&&!(q.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Qf))e(t)}get themeClasses(){return lg+` `+(this.state.facet(cg)?dg:ug)+` `+this.state.facet(sg)}updateAttrs(){let e=Tg(this,hp,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(up)?`true`:`false`,class:`cm-content`,style:`${q.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Tg(this,gp,t);let n=this.observer.ignore(()=>{let n=Id(this.contentDOM,this.contentAttrs,t),r=Id(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&=(this.announceDOM.textContent=``,this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=`\xA0`},200),!1);let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Tp);let t=this.state.facet(e.cspNonce);ld.mount(this.root,this.styleModules.concat(mg).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return wm(this,e,ym(this,e,t,n))}moveByGroup(e,t){return wm(this,e,ym(this,e,t,t=>bm(this,e.head,t)))}visualLineSide(e,t){return t?G.cursor(e.to,1):G.cursor(e.from,-1)}moveToLineBoundary(e,t,n=!0){return vm(this,e,t,n)}moveVertically(e,t,n){return wm(this,e,xm(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Em(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Em(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[Ff.find(r,e-n.from,-1,t)];return n.length&&(e==n.from&&t<0||e==n.to&&t>0)&&i.dir!=this.textDirectionAt(n.from)&&(e==n.to?(e=n.from+i.from,t=1):(e=n.from+i.to,t=-1)),this.docView.coordsAt(e,t,i.dir==Tf.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(rp)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Sg)return Wf(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||If(r.isolates,n=Sp(this,e))))return r.order;n||=Sp(this,e);let r=Uf(e.text,t,n);return this.bidiCache.push(new wg(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||q.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{hf(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return sp.of(new op(typeof e==`number`?G.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return sp.of(new op(G.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return pp.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return pp.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=ld.newName(),r=[sg.of(n),Tp.of(pg(`.${n}`,e))];return t&&t.dark&&r.push(cg.of(!0)),r}static baseTheme(e){return ru.lowest(Tp.of(pg(`.`+lg,e,fg)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&kp.get(t)||kp.get(e))?.root?.view||null}};J.styleModule=Tp,J.inputHandler=$f,J.clipboardInputFilter=tp,J.clipboardOutputFilter=np,J.scrollHandler=ap,J.focusChangeEffect=ep,J.perLineTextDirection=rp,J.exceptionSink=Zf,J.updateListener=Qf,J.editable=up,J.mouseSelectionStyle=Xf,J.dragMovesSelection=Yf,J.clickAddsSelectionRange=Jf,J.decorations=_p,J.blockWrappers=vp,J.outerDecorations=yp,J.atomicRanges=bp,J.bidiIsolatedRanges=xp,J.cursorScrollMargin=K.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),J.scrollMargins=Cp,J.darkTheme=cg,J.cspNonce=K.define({combine:e=>e.length?e[0]:``}),J.contentAttributes=gp,J.editorAttributes=hp,J.lineWrapping=J.contentAttributes.of({class:`cm-lineWrapping`}),J.announce=xu.define();var Sg=4096,Cg={},wg=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Tf.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function Tg(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Md(a,n)}return n}var Eg=q.mac?`mac`:q.windows?`win`:q.linux?`linux`:`key`;function Dg(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function Og(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var kg=ru.default(J.domEventHandlers({keydown(e,t){return Rg(Mg(t.state),e,t,`editor`)}})),Ag=K.define({enables:kg}),jg=new WeakMap;function Mg(e){let t=e.facet(Ag),n=jg.get(t);return n||jg.set(t,n=Ig(t.reduce((e,t)=>e.concat(t),[]))),n}function Ng(e,t,n){return Rg(Mg(e.state),t,e,n)}var Pg=null,Fg=4e3;function Ig(e,t=Eg){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>Dg(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Pg={view:t,prefix:n,scope:e};return setTimeout(()=>{Pg==r&&(Pg=null)},Fg),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Lg))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var Lg=null;function Rg(e,t,n,r){Lg=t;let i=vd(t),a=Pl(Ml(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Pg&&Pg.view==n&&Pg.scope==r&&(o=Pg.prefix+` `,Jm.indexOf(t.keyCode)<0&&(c=!0,Pg=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+Og(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(q.windows&&t.ctrlKey&&t.altKey)&&!(q.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=fd[t.keyCode])&&p!=i?(d(f[o+Og(p,t,!0)])||t.shiftKey&&(m=pd[t.keyCode])!=i&&m!=p&&d(f[o+Og(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Og(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Lg=null,s}var zg=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=Bg(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return Hg(t,n,r)}};function Bg(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Tf.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Vg(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Hg(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==Tf.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=Bg(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=_m(e,r,1),m=_m(e,i,-1),h=p.type==zd.Text?p:null,g=m.type==zd.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Vg(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Vg(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==zd.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new zg(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);p&&m&&(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==Tf.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function Ug(e,t){return e.constructor==t.constructor&&e.eq(t)}var Wg=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Gg)!=e.state.facet(Gg)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Gg);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!Ug(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,q.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Gg=K.define();function Kg(e){return[pp.define(t=>new Wg(t,e)),Gg.of(e)]}var qg=!q.ios,Jg=K.define({combine(e){return Lu(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Yg(e={}){return[Jg.of(e),Qg,e_,n_,ip.of(!0)]}function Xg(e){return e.facet(Jg)}function Zg(e){return e.startState.facet(Jg)!=e.state.facet(Jg)}var Qg=Kg({above:!0,markers(e){let{state:t}=e,n=t.facet(Jg),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&q.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:G.cursor(i.head,i.assoc);for(let i of zg.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=Zg(e);return n&&$g(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){$g(t.state,e)},class:`cm-cursorLayer`});function $g(e,t){t.style.animationDuration=e.facet(Jg).cursorBlinkRate+`ms`}var e_=Kg({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty&&(qg||i!=n))for(let n of zg.forRange(e,`cm-selectionBackground`,i))t.push(n);if(q.ios&&!n.empty&&e.state.facet(Jg).iosSelectionHandles){for(let r of zg.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,G.cursor(n.from,1)))t.push(r);for(let r of zg.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,G.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||Zg(e)},class:`cm-selectionLayer`}),t_=q.gecko&&q.gecko_version==153?`#ffffff01`:`transparent`,n_=ru.highest(J.theme({".cm-line":{...qg?{"& ::selection, &::selection":{backgroundColor:`${t_} !important`}}:{},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,...qg?{"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}:{}}}}));/x/.unicode;var r_=`-10000px`,i_=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function a_(e){let t=e.dom.ownerDocument.documentElement,n=t.clientWidth,r=getComputedStyle(t);if(!/stable/.test(r.scrollbarGutter||``))return{left:0,right:n};let i=t.getBoundingClientRect(),a=e.win.scrollX;return{left:Math.max(0,i.left+a-parseFloat(r.marginLeft)),right:Math.min(n,i.right+a+parseFloat(r.marginRight))}}function o_(e){let{left:t,right:n}=a_(e);return{top:0,left:t,right:n,bottom:e.dom.ownerDocument.documentElement.clientHeight}}var s_=K.define({combine:e=>({position:q.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||o_})}),c_=new WeakMap,l_=pp.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s_);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new i_(e,p_,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(s_);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=r_,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1,r=0;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(q.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}else r=a_(this.view).left;let i=this.view.scrollDOM.getBoundingClientRect(),a=wp(this.view);return{visible:{left:i.left+a.left,top:i.top+a.top,right:i.right-a.right,bottom:i.bottom-a.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(s_).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n,fixedLeft:r}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=r_;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=c_.get(c)??d.bottom-d.top,g=c.offset||f_,_=this.view.textDirection==Tf.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=r_;continue}c_.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,u_(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,u_(l,(v-e.fixedLeft)/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=r_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function u_(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var d_=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),f_={x:0,y:0},p_=K.define({enables:[l_,d_]}),m_=K.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function h_(e,t){let n=e.plugin(g_),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var g_=pp.fromClass(class{constructor(e){this.input=e.state.facet(y_),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(m_);this.top=new __(e,!0,t.topContainer),this.bottom=new __(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(m_);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new __(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new __(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(y_);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>J.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),__=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=v_(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=v_(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function v_(e){let t=e.nextSibling;return e.remove(),t}var y_=K.define({enables:g_}),b_=class extends Ru{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};b_.prototype.elementClass=``,b_.prototype.toDOM=void 0,b_.prototype.mapMode=Il.TrackBefore,b_.prototype.startSide=b_.prototype.endSide=-1,b_.prototype.point=!0;var x_=1024,S_=0,C_=class{constructor(e,t){this.from=e,this.to=t}},Y=class{constructor(e={}){this.id=S_++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=E_.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Y.closedBy=new Y({deserialize:e=>e.split(` `)}),Y.openedBy=new Y({deserialize:e=>e.split(` `)}),Y.group=new Y({deserialize:e=>e.split(` `)}),Y.isolate=new Y({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Y.contextHash=new Y({perNode:!0}),Y.lookAhead=new Y({perNode:!0}),Y.mounted=new Y({perNode:!0});var w_=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Y.mounted.id]}},T_=Object.create(null),E_=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):T_,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Y.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Y.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};E_.none=new E_(``,Object.create(null),0,8);var D_=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new E_(e.name,r,e.id,e.flags):e)}return new e(n)}},O_=new WeakMap,k_=new WeakMap,A_;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(A_||={});var j_=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=w_.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new G_(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new G_(O_.get(this)||this.topNode);return r.moveTo(e,t),O_.set(this,r._tree),r}get topNode(){return new L_(this,0,0,null)}resolve(e,t=0){let n=F_(O_.get(this)||this.topNode,e,t,!1);return O_.set(this,n),n}resolveInner(e,t=0){let n=F_(k_.get(this)||this.topNode,e,t,!0);return k_.set(this,n),n}resolveStack(e,t=0){return W_(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&A_.IncludeAnonymous)>0;for(let e=this.cursor(a|A_.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:X_(E_.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(E_.none,t,n,r)))}static build(e){return q_(e)}};j_.empty=new j_(E_.none,[],[],0);var M_=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},N_=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return E_.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(P_(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function P_(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function F_(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof L_&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:A_.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof L_&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var I_=class{cursor(e=0){return new G_(this,e)}getChild(e,t=null,n=null){let r=R_(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return R_(this,e,t,n)}resolve(e,t=0){return F_(this,e,t,!1)}resolveInner(e,t=0){return F_(this,e,t,!0)}matchContext(e){return z_(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},L_=class e extends I_{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(a&A_.EnterBracketed&&l instanceof j_&&(d=w_.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length||P_(i,r,u,u+l.length)){if(l instanceof N_){if(a&A_.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new V_(new B_(o,l,t,u),null,e)}else if(a&A_.IncludeAnonymous||!l.type.isAnonymous||K_(l)){let s;if(!(a&A_.IgnoreMounts)&&(s=w_.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&A_.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&A_.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&A_.IgnoreOverlays)&&(i=w_.get(this._tree))&&i.overlay){let a=t-this.from,o=r&A_.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function R_(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function z_(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var B_=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},V_=class e extends I_{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&A_.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new j_(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function H_(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof L_&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new U_(i,n)}var U_=class{constructor(e,t){this.heads=e,this.node=t}get next(){return H_(this.heads)}};function W_(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof L_?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=w_.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new L_(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(F_(o,t,n,!1))}}return i?H_(i):r}var G_=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~A_.EnterBracketed,e instanceof L_)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof L_?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&A_.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&A_.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&A_.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&A_.IncludeAnonymous||e instanceof N_||!e.type.isAnonymous||K_(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new V_(this.buffer,t,this.stack[e]);return this.bufferNode=new V_(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return z_(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return z_(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function K_(e){return e.children.some(e=>e instanceof N_||!e.type.isAnonymous||K_(e))}function q_(e){let{buffer:t,nodeSet:n,maxBufferLength:r=x_,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new M_(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,ee=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let E=s[x],te,ne,re=S-e;if(C-S<=r&&(ne=h(o.pos-t,y))){let t=new Uint16Array(ne.size-ne.skip),r=o.pos-ne.size,i=t.length;for(;o.pos>r;)i=g(ne.start,t,i);te=new N_(t,C-ne.start,n),re=ne.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,ee),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,ee),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(E,ee);te=X_(E,t,n,0,t.length,0,C-S,e,e)}else te=m(E,t,n,C-S,T-C,ee)}_.push(te),v.push(re)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new N_(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof j_){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Y.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Y.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Y.lookAhead,i];o=o?[e].concat(o):[e]}return new j_(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new j_(s[e.topID],_.reverse(),v.reverse(),y)}var J_=new WeakMap;function Y_(e,t){if(!e.isAnonymous||t instanceof N_||t.type!=e)return 1;let n=J_.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof j_)){n=1;break}n+=Y_(e,r)}J_.set(t,n)}return n}function X_(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=Y_(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=Y_(e,t[s]);for(s++;s<i;s++){let n=Y_(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(X_(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var Z_=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof V_?this.setBuffer(e.context.buffer,e.index,t):e instanceof L_&&this.map.set(e.tree,t)}get(e){return e instanceof V_?this.getBuffer(e.context.buffer,e.index):e instanceof L_?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Q_=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},$_=class{startParse(e,t,n){return typeof e==`string`&&(e=new ev(e)),n=n?n.length?n.map(e=>new C_(e.from,e.to)):[new C_(0,0)]:[new C_(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},ev=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function tv(e){return(t,n,r,i)=>new ov(t,e,n,r,i)}var nv=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function rv(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var iv=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},av=new Y({perNode:!0}),ov=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new j_(e.type,e.children,e.positions,e.length,e.propValues.concat([[av,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Y.mounted.id]=new w_(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new dv(this.fragments),t=null,n=null,r=new G_(new L_(this.baseTree,this.ranges[0].from,0,null),A_.IncludeAnonymous|A_.IgnoreMounts);scan:for(let i,a;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let e=t.mounts.find(e=>e.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let i=n.from+e.pos,a=n.to+e.pos;i>=r.from&&a<=r.to&&!t.ranges.some(e=>e.from<a&&e.to>i)&&t.ranges.push({from:i,to:a})}}o=!1}else if(n&&(a=sv(n.ranges,r.from,r.to)))o=a!=2;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from<r.to||!i.overlay)){r.tree||(lv(r),t&&t.depth++,n&&n.depth++);let a=e.findMounts(r.from,i.parser);if(typeof i.overlay==`function`)t=new iv(i.parser,i.overlay,a,this.inner.length,r.from,!!i.bracketed,r.tree,t);else{let e=fv(this.ranges,i.overlay||(r.from<r.to?[new C_(r.from,r.to)]:[]));e.length&&rv(e),(e.length||!i.overlay)&&this.inner.push(new nv(i.parser,e.length?i.parser.startParse(this.input,mv(a,e),e):i.parser.startParse(``),i.overlay?i.overlay.map(e=>new C_(e.from-r.from,e.to-r.from)):null,!!i.bracketed,r.tree,e.length?e[0].from:r.from)),i.overlay?e.length&&(n={ranges:e,depth:0,prev:n}):o=!1}}else if(t&&(s=t.predicate(r))&&(s===!0&&(s=new C_(r.from,r.to)),s.from<s.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==s.from?t.ranges[e]={from:t.ranges[e].from,to:s.to}:t.ranges.push(s)}if(o&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break scan;if(t&&!--t.depth){let e=fv(this.ranges,t.ranges);e.length&&(rv(e),this.inner.splice(t.index,0,new nv(t.parser,t.parser.startParse(this.input,mv(t.mounts,e),e),t.ranges.map(e=>new C_(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function sv(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function cv(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function lv(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),o=i.children[a],s=o.buffer,c=[a];function l(e,r,i,a,u,d){let f=n[d],p=[],m=[];cv(o,e,f,p,m,a);let h=s[f+1],g=s[f+2];c.push(p.length);let _=d?l(f+4,s[f+3],o.set.types[s[f]],h,g-h,d-1):t.toTree();return p.push(_),m.push(h-a),cv(o,s[f+3],r,p,m,a),new j_(i,p,m,u)}i.children[a]=l(0,s.length,E_.none,0,o.length,n.length-1);for(let t of c){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new L_(n,r+e.from,t,e._tree))}}var uv=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(A_.IncludeAnonymous|A_.IgnoreMounts|A_.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=n&&t.enter(n,1,A_.IncludeAnonymous|A_.IgnoreOverlays|A_.ExcludeBuffers))){if(t.to<=n)t.next(!1)||(this.done=!0);else break}}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof j_)t=t.children[0];else break}return!1}},dv=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(av)??t.to,this.inner=new uv(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(av)??e.to,this.inner=new uv(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=e.tree?.prop(Y.mounted);if(r&&r.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let i=this.fragments[t];if(i.from>=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}};function fv(e,t){let n=null,r=t;for(let i=1,a=0;i<e.length;i++){let o=e[i-1].to,s=e[i].from;for(;a<r.length;a++){let e=r[a];if(e.from>=s)break;e.to<=o||(n||(r=n=t.slice()),e.from<o?(n[a]=new C_(e.from,o),e.to>s&&n.splice(a+1,0,new C_(s,e.to))):e.to>s?n[a--]=new C_(s,e.to):n.splice(a--,1))}}return r}function pv(e,t,n,r){let i=0,a=0,o=!1,s=!1,c=-1e9,l=[];for(;;){let u=i==e.length?1e9:o?e[i].to:e[i].from,d=a==t.length?1e9:s?t[a].to:t[a].from;if(o!=s){let e=Math.max(c,n),t=Math.min(u,d,r);e<t&&l.push(new C_(e,t))}if(c=Math.min(u,d),c==1e9)break;u==c&&(o?(o=!1,i++):o=!0),d==c&&(s?(s=!1,a++):s=!0)}return l}function mv(e,t){let n=[];for(let{pos:r,mount:i,frag:a}of e){let e=r+(i.overlay?i.overlay[0].from:0),o=e+i.tree.length,s=Math.max(a.from,e),c=Math.min(a.to,o);if(i.overlay){let o=pv(t,i.overlay.map(e=>new C_(e.from+r,e.to+r)),s,c);for(let t=0,r=s;;t++){let s=t==o.length,l=s?c:o[t].from;if(l>r&&n.push(new Q_(r,l,i.tree,-e,a.from>=r||a.openStart,a.to<=l||a.openEnd)),s)break;r=o[t].to}}else n.push(new Q_(s,c,i.tree,-e,a.from>=e||a.openStart,a.to<=o||a.openEnd))}return n}var hv=0,gv=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=hv++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new vv(e);return e=>e.modified.indexOf(t)>-1?e:vv.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},_v=0,vv=class e{constructor(e){this.name=e,this.instances=[],this.id=_v++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&yv(n,e.modified));if(r)return r;let i=[],a=new gv(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=bv(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function yv(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function bv(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function xv(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Cv(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return Sv.add(t)}var Sv=new Y({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Cv(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),Cv=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Cv.empty=new Cv([],2,null);function wv(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function Tv(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function Ev(e,t,n,r=0,i=e.length){let a=new Dv(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var Dv=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=Ov(e)||Cv.empty,u=Tv(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(Y.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function Ov(e){let t=e.type.prop(Sv);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var X=gv.define,kv=X(),Av=X(),jv=X(Av),Mv=X(Av),Nv=X(),Pv=X(Nv),Fv=X(Nv),Iv=X(),Lv=X(Iv),Rv=X(),zv=X(),Bv=X(),Vv=X(Bv),Hv=X(),Z={comment:kv,lineComment:X(kv),blockComment:X(kv),docComment:X(kv),name:Av,variableName:X(Av),typeName:jv,tagName:X(jv),propertyName:Mv,attributeName:X(Mv),className:X(Av),labelName:X(Av),namespace:X(Av),macroName:X(Av),literal:Nv,string:Pv,docString:X(Pv),character:X(Pv),attributeValue:X(Pv),number:Fv,integer:X(Fv),float:X(Fv),bool:X(Nv),regexp:X(Nv),escape:X(Nv),color:X(Nv),url:X(Nv),keyword:Rv,self:X(Rv),null:X(Rv),atom:X(Rv),unit:X(Rv),modifier:X(Rv),operatorKeyword:X(Rv),controlKeyword:X(Rv),definitionKeyword:X(Rv),moduleKeyword:X(Rv),operator:zv,derefOperator:X(zv),arithmeticOperator:X(zv),logicOperator:X(zv),bitwiseOperator:X(zv),compareOperator:X(zv),updateOperator:X(zv),definitionOperator:X(zv),typeOperator:X(zv),controlOperator:X(zv),punctuation:Bv,separator:X(Bv),bracket:Vv,angleBracket:X(Vv),squareBracket:X(Vv),paren:X(Vv),brace:X(Vv),content:Iv,heading:Lv,heading1:X(Lv),heading2:X(Lv),heading3:X(Lv),heading4:X(Lv),heading5:X(Lv),heading6:X(Lv),contentSeparator:X(Iv),list:X(Iv),quote:X(Iv),emphasis:X(Iv),strong:X(Iv),link:X(Iv),monospace:X(Iv),strikethrough:X(Iv),inserted:X(),deleted:X(),changed:X(),invalid:X(),meta:Hv,documentMeta:X(Hv),annotation:X(Hv),processingInstruction:X(Hv),definition:gv.defineModifier(`definition`),constant:gv.defineModifier(`constant`),function:gv.defineModifier(`function`),standard:gv.defineModifier(`standard`),local:gv.defineModifier(`local`),special:gv.defineModifier(`special`)};for(let e in Z){let t=Z[e];t instanceof gv&&(t.name=e)}wv([{tag:Z.link,class:`tok-link`},{tag:Z.heading,class:`tok-heading`},{tag:Z.emphasis,class:`tok-emphasis`},{tag:Z.strong,class:`tok-strong`},{tag:Z.keyword,class:`tok-keyword`},{tag:Z.atom,class:`tok-atom`},{tag:Z.bool,class:`tok-bool`},{tag:Z.url,class:`tok-url`},{tag:Z.labelName,class:`tok-labelName`},{tag:Z.inserted,class:`tok-inserted`},{tag:Z.deleted,class:`tok-deleted`},{tag:Z.literal,class:`tok-literal`},{tag:Z.string,class:`tok-string`},{tag:Z.number,class:`tok-number`},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:`tok-string2`},{tag:Z.variableName,class:`tok-variableName`},{tag:Z.local(Z.variableName),class:`tok-variableName tok-local`},{tag:Z.definition(Z.variableName),class:`tok-variableName tok-definition`},{tag:Z.special(Z.variableName),class:`tok-variableName2`},{tag:Z.definition(Z.propertyName),class:`tok-propertyName tok-definition`},{tag:Z.typeName,class:`tok-typeName`},{tag:Z.namespace,class:`tok-namespace`},{tag:Z.className,class:`tok-className`},{tag:Z.macroName,class:`tok-macroName`},{tag:Z.propertyName,class:`tok-propertyName`},{tag:Z.operator,class:`tok-operator`},{tag:Z.comment,class:`tok-comment`},{tag:Z.meta,class:`tok-meta`},{tag:Z.invalid,class:`tok-invalid`},{tag:Z.punctuation,class:`tok-punctuation`}]);function Uv(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}var Wv=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Uv(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??Uv(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}},Gv=new Y;function Kv(e){return K.define({combine:e?t=>t.concat(e):void 0})}var qv=new Y,Jv=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,Iu.prototype.hasOwnProperty(`tree`)||Object.defineProperty(Iu.prototype,"tree",{get(){return Zv(this)}}),this.parser=t,this.extension=[sy.of(this),Iu.languageData.of((e,t,n)=>{let r=Yv(e,t,n),i=r.type.prop(Gv);if(!i)return[];let a=e.facet(i),o=r.type.prop(qv);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return Yv(e,t,n).type.prop(Gv)==this.data}findRegions(e){let t=e.facet(sy);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Gv)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Y.mounted);if(i){if(i.tree.prop(Gv)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof j_&&r(i,e.positions[n]+t)}};return r(Zv(e),0),n}get allowsNesting(){return!0}};Jv.setState=xu.define();function Yv(e,t,n){let r=e.facet(sy),i=Zv(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,A_.ExcludeBuffers|A_.EnterBracketed))e.type.isTop&&(i=e);return i}var Xv=class e extends Jv{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=Kv(t.languageData);return new e(n,t.parser.configure({props:[Gv.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function Zv(e){let t=e.field(Jv.state,!1);return t?t.tree:j_.empty}function Qv(e,t,n=50){let r=e.field(Jv.state,!1)?.context;if(!r)return null;let i=r.viewport;r.updateViewport({from:0,to:t});let a=r.isDone(t)||r.work(n,t)?r.tree:null;return r.updateViewport(i),a}var $v=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ey=null,ty=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],j_.empty,0,r,[],null)}startParse(){return this.parser.startParse(new $v(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=j_.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(Q_.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Q_.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ey;ey=this;try{return e()}finally{ey=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ny(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=Q_.applyChanges(r,e),i=j_.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=ny(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends $_{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ey;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new j_(E_.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ey}};function ny(e,t,n){return Q_.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var ry=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=ty.create(t.facet(sy).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Jv.state=eu.define({create:ry.init,update(e,t){for(let e of t.effects)if(e.is(Jv.setState))return e.value;return t.startState.facet(sy)==t.state.facet(sy)?e.apply(t):ry.init(t.state)}});var iy=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(iy=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var ay=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,oy=pp.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Jv.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Jv.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=iy(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Jv.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!ay?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>ay&&ay()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Jv.setState.of(new ry(i.context))})),this.chunkBudget>0&&(!s||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>lp(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sy=K.define({combine(e){return e.length?e[0]:null},enables:e=>[Jv.state,oy,J.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),cy=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},ly=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},uy=K.define(),dy=K.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function fy(e){let t=e.facet(dy);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function py(e,t){let n=``,r=e.tabSize,i=e.facet(dy)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function my(e,t){e instanceof Iu&&(e=new hy(e));for(let n of e.state.facet(uy)){let r=n(e,t);if(r!==void 0)return r}let n=Zv(e.state);return n.length>=t?_y(e,n,t):null}var hy=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=fy(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return rd(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},gy=new Y;function _y(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return vy(r,e,n)}function vy(e,t,n){for(let r=e;r;r=r.next){let e=by(r.node);if(e)return e(Sy.create(t,n,r))}return 0}function yy(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function by(e){let t=e.type.prop(gy);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Y.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>Ey(e,!0,1,void 0,n&&!yy(e)?t.from:void 0)}return e.parent==null?xy:null}function xy(){return 0}var Sy=class e extends hy{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Cy(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return vy(this.context.next,this.base,this.pos)}};function Cy(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function wy(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function Ty({closing:e,align:t=!0,units:n=1}){return r=>Ey(r,t,n,e)}function Ey(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?wy(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}var Dy=e=>e.baseIndent;function Oy({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var ky=K.define(),Ay=new Y;function jy(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function My(e,t,n){let r=Zv(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Ay);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Ny(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Ny(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Py(e,t,n){for(let r of e.facet(ky)){let i=r(e,t,n);if(i)return i}return My(e,t,n)}function Fy(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var Iy=xu.define({map:Fy}),Ly=xu.define({map:Fy});function Ry(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var zy=eu.define({create(){return Bd.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=By(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Iy)&&!Hy(e,r.value.from,r.value.to)?n.push(r.value):r.is(Ly)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(qy),i=n.map(e=>(r?Bd.replace({widget:new Zy(r(t.state,e))}):Xy).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=By(e,t.selection.main.head)),e},provide:e=>J.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(Xy.range(r,i))}return Bd.set(t,!0)}});function By(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Vy(e,t,n){var r;let i=null;return(r=e.field(zy,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Hy(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Uy(e,t){return e.field(zy,!1)?t:t.concat(xu.appendConfig.of(Jy()))}var Wy=e=>{for(let t of Ry(e)){let n=Py(e.state,t.from,t.to);if(n)return e.dispatch({effects:Uy(e.state,[Iy.of(n),Gy(e,n)])}),!0}return!1};function Gy(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return J.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Ky={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},qy=K.define({combine(e){return Lu(e,Ky)}});function Jy(e){let t=[zy,Qy];return e&&t.push(qy.of(e)),t}function Yy(e,t){let{state:n}=e,r=n.facet(qy),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Vy(e.state,n.from,n.to);r&&e.dispatch({effects:Ly.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var Xy=Bd.replace({widget:new class extends Rd{toDOM(e){return Yy(e,null)}}}),Zy=class extends Rd{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Yy(e,this.value)}},Qy=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),$y=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=ld.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof Jv?e=>e.prop(Gv)==a.data:a?e=>e==a:void 0,this.style=wv(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new ld(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},eb=K.define(),tb=K.define({combine(e){return e.length?[e[0]]:null}});function nb(e){let t=e.facet(eb);return t.length?t:e.facet(tb)}function rb(e,t){let n=[ab],r;return e instanceof $y&&(e.module&&n.push(J.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(tb.of(e)):r?n.push(eb.computeN([J.darkTheme],t=>t.facet(J.darkTheme)==(r==`dark`)?[e]:[])):n.push(eb.of(e)),n}var ib=class{constructor(e){this.markCache=Object.create(null),this.tree=Zv(e.state),this.decorations=this.buildDeco(e,nb(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Zv(e.state),n=nb(e.state),r=n!=nb(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Bd.none;let n=new Ku;for(let{from:r,to:i}of e.visibleRanges)Ev(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Bd.mark({class:r})))},r,i);return n.finish()}},ab=ru.high(pp.fromClass(ib,{decorations:e=>e.decorations}));Z.meta,Z.link,Z.heading,Z.emphasis,Z.strong,Z.strikethrough,Z.keyword,Z.atom,Z.bool,Z.url,Z.contentSeparator,Z.labelName,Z.literal,Z.inserted,Z.string,Z.deleted,Z.regexp,Z.escape,Z.string,Z.variableName,Z.variableName,Z.typeName,Z.namespace,Z.className,Z.variableName,Z.macroName,Z.propertyName,Z.comment,Z.invalid;var ob=1e4,sb=`()[]{}`,cb=new Y;function lb(e,t,n){let r=e.prop(t<0?Y.openedBy:Y.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function ub(e){let t=e.type.prop(cb);return t?t(e.node):e}function db(e,t,n,r={}){let i=r.maxScanDistance||ob,a=r.brackets||sb,o=Zv(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=lb(r.type,n,a);if(i&&r.from<r.to){let o=ub(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return fb(e,t,n,r,o,i,a)}}return pb(e,t,n,o,s.type,i,a)}function fb(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=ub(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(lb(u.type,n,o))l++;else if(lb(u.type,-n,o)){if(l==0){let e=ub(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function pb(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var mb=Object.create(null),hb=[E_.none],gb=[],_b=Object.create(null),vb=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])vb[e]=bb(mb,t);function yb(e,t){gb.indexOf(e)>-1||(gb.push(e),console.warn(t))}function bb(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Z[n];r?typeof r==`function`?t.length?t=t.map(r):yb(n,`Modifier ${n} used at start of tag`):t.length?yb(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:yb(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=_b[i];if(a)return a.id;let o=_b[i]=E_.define({id:hb.length,name:r,props:[xv({[r]:n})]});return hb.push(o),o.id}Tf.RTL,Tf.LTR;var xb=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Eb(e.state,n.from);return r.line?Cb(e):r.block?Tb(e):!1};function Sb(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var Cb=Sb(jb,0),wb=Sb(Ab,0),Tb=Sb((e,t)=>Ab(e,t,kb(t)),0);function Eb(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var Db=50;function Ob(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Db,r),o=e.sliceDoc(i,i+Db),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+Db),d=e.sliceDoc(i-Db,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function kb(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function Ab(e,t,n=t.selection.ranges){let r=n.map(e=>Eb(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Ob(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function jb(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Eb(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var Mb=vu.define(),Nb=vu.define(),Pb=K.define(),Fb=K.define({combine(e){return Lu(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Ib=eu.define({create(){return tx.empty},update(e,t){let n=t.state.facet(Fb),r=t.annotation(Mb);if(r){let i=Ub.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Wb(o,o.length,n.minDepth,i):Xb(o,t.startState.selection),new tx(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Nb);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Su.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Ub.fromTransaction(t),o=t.annotation(Su.time),s=t.annotation(Su.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new tx(e.done.map(Ub.fromJSON),e.undone.map(Ub.fromJSON))}});function Lb(e={}){return[Ib,Fb.of(e),J.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?zb:e.inputType==`historyRedo`?Bb:null;return n?(e.preventDefault(),n(t)):!1}})]}function Rb(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Ib,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var zb=Rb(0,!1),Bb=Rb(1,!1),Vb=Rb(0,!0),Hb=Rb(1,!0),Ub=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&Rl.fromJSON(t.changes),[],t.mapped&&Ll.fromJSON(t.mapped),t.startSelection&&G.fromJSON(t.startSelection),t.selectionsAfter.map(G.fromJSON))}static fromTransaction(t,n){let r=Jb;for(let e of t.startState.facet(Pb)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Jb)}static selection(t){return new e(void 0,Jb,void 0,void 0,t)}};function Wb(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Gb(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Kb(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function qb(e,t){return e.length?t.length?e.concat(t):e:t}var Jb=[],Yb=200;function Xb(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Yb));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Wb(e,e.length-1,1e9,n.setSelAfter(r)))}return[Ub.selection([t])]}function Zb(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Qb(e,t){if(!e.length)return e;let n=e.length,r=Jb;for(;n;){let i=$b(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ub.selection(r)]:Jb}function $b(e,t,n){let r=qb(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Jb,n);if(!e.changes)return Ub.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Ub(i,xu.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var ex=/^(input\.type|delete)($|\.)/,tx=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||ex.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Gb(s.changes,t.changes))||r==`input.type.compose`)?Wb(o,o.length-1,i.minDepth,new Ub(t.changes.compose(s.changes),qb(xu.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Jb)):Wb(o,o.length,i.minDepth,t),new e(o,Jb,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Jb;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Kb(a[a.length-1],t)?this:new e(Xb(this.done,t),this.undone,n,r)}addMapping(t){return new e(Qb(this.done,t),Qb(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Mb.of({side:e,rest:Zb(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Jb:r.slice(0,r.length-1);return i.mapped&&(n=Qb(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Mb.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};tx.empty=new tx(Jb,Jb);var nx=[{key:`Mod-z`,run:zb,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Bb,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Bb,preventDefault:!0},{key:`Mod-u`,run:Vb,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Hb,preventDefault:!0}];function rx(e,t){return G.create(e.ranges.map(t),e.mainIndex)}function ix(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function ax({state:e,dispatch:t},n){let r=rx(e.selection,n);return!r.eq(e.selection,!0)&&(t(ix(e,r)),!0)}function ox(e,t){return G.cursor(t?e.to:e.from)}function sx(e,t){return ax(e,n=>n.empty?e.moveByChar(n,t):ox(n,t))}function cx(e){return e.textDirectionAt(e.state.selection.main.head)==Tf.LTR}var lx=e=>sx(e,!cx(e)),ux=e=>sx(e,cx(e)),dx=e=>sx(e,!0),fx=e=>sx(e,!1);function px(e,t){return ax(e,n=>n.empty?e.moveByGroup(n,t):ox(n,t))}var mx=e=>px(e,!cx(e)),hx=e=>px(e,cx(e));typeof Intl<`u`&&Intl.Segmenter;function gx(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function _x(e,t,n){let r=Zv(e).resolveInner(t.head),i=n?Y.closedBy:Y.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;gx(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?db(e,r.from,1):db(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,G.cursor(s,n?-1:1)}var vx=e=>ax(e,t=>_x(e.state,t,!cx(e))),yx=e=>ax(e,t=>_x(e.state,t,cx(e)));function bx(e,t){return ax(e,n=>{if(!n.empty)return ox(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var xx=e=>bx(e,!1),Sx=e=>bx(e,!0);function Cx(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(J.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function wx(e,t){let n=Cx(e),{state:r}=e,i=rx(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):ox(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=J.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(ix(r,i),{effects:a}),!0}var Tx=e=>wx(e,!1),Ex=e=>wx(e,!0);function Dx(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=G.cursor(r.from+n))}return i}var Ox=e=>ax(e,t=>Dx(e,t,!0)),kx=e=>ax(e,t=>Dx(e,t,!1)),Ax=e=>ax(e,t=>Dx(e,t,!cx(e))),jx=e=>ax(e,t=>Dx(e,t,cx(e))),Mx=e=>ax(e,t=>e.moveToLineBoundary(t,!1,!1)),Nx=e=>ax(e,t=>e.moveToLineBoundary(t,!0,!1));function Px(e,t,n){let r=!1,i=rx(e.selection,t=>{let i=db(e,t.head,-1)||db(e,t.head,1)||t.head>0&&db(e,t.head-1,1)||t.head<e.doc.length&&db(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?G.range(t.anchor,a):G.cursor(a)});return r?(t(ix(e,i)),!0):!1}var Fx=({state:e,dispatch:t})=>Px(e,t,!1);function Ix(e,t,n){let r=rx(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=G.range(e.head,e.anchor));let r=n(e);return G.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(ix(e.state,r)),!0)}function Lx(e,t){return Ix(e,t,n=>e.moveByChar(n,t))}var Rx=e=>Lx(e,!cx(e)),zx=e=>Lx(e,cx(e)),Bx=e=>Lx(e,!0),Vx=e=>Lx(e,!1);function Hx(e,t){return Ix(e,t,n=>e.moveByGroup(n,t))}var Ux=e=>Hx(e,!cx(e)),Wx=e=>Hx(e,cx(e)),Gx=e=>Hx(e,!0),Kx=e=>Hx(e,!1),qx=e=>{let t=!cx(e);return Ix(e,t,n=>_x(e.state,n,t))},Jx=e=>{let t=cx(e);return Ix(e,t,n=>_x(e.state,n,t))};function Yx(e,t){return Ix(e,t,n=>e.moveVertically(n,t))}var Xx=e=>Yx(e,!1),Zx=e=>Yx(e,!0);function Qx(e,t){return Ix(e,t,n=>e.moveVertically(n,t,Cx(e).height))}var $x=e=>Qx(e,!1),eS=e=>Qx(e,!0),tS=e=>Ix(e,!0,t=>Dx(e,t,!0)),nS=e=>Ix(e,!1,t=>Dx(e,t,!1)),rS=e=>{let t=!cx(e);return Ix(e,t,n=>Dx(e,n,t))},iS=e=>{let t=cx(e);return Ix(e,t,n=>Dx(e,n,t))},aS=e=>Ix(e,!1,t=>G.cursor(e.lineBlockAt(t.head).from)),oS=e=>Ix(e,!0,t=>G.cursor(e.lineBlockAt(t.head).to)),sS=({state:e,dispatch:t})=>(t(ix(e,{anchor:0})),!0),cS=({state:e,dispatch:t})=>(t(ix(e,{anchor:e.doc.length})),!0),lS=({state:e,dispatch:t})=>(t(ix(e,{anchor:e.selection.main.anchor,head:0})),!0),uS=({state:e,dispatch:t})=>(t(ix(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),dS=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),fS=({state:e,dispatch:t})=>{let n=jS(e).map(({from:t,to:n})=>G.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:G.create(n),userEvent:`select`})),!0},pS=({state:e,dispatch:t})=>{let n=rx(e.selection,t=>{let n=Zv(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;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 G.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(ix(e,n)),!0)};function mS(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(ix(n,G.create(i,i.length-1))),!0)}var hS=e=>mS(e,!1),gS=e=>mS(e,!0),_S=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=G.create([n.main]):n.main.empty||(r=G.create([G.cursor(n.main.head)])),r?(t(ix(e,r)),!0):!1};function vS(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=yS(e,o,!1)):o>i&&(n=`delete.forward`,o=yS(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=yS(e,i,!1),a=yS(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:G.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?J.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function yS(e,t,n){if(e instanceof J)for(let r of e.state.facet(J.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var bS=(e,t,n)=>vS(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=rd(s,a.tabSize)%fy(a)||fy(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=kl(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=kl(o.text,c-o.from,!1,!1)+o.from);return c}),xS=e=>bS(e,!1,!0),SS=e=>bS(e,!0,!1),CS=(e,t)=>vS(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=kl(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),wS=e=>CS(e,!1),TS=e=>CS(e,!0),ES=e=>vS(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),DS=e=>vS(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),OS=e=>vS(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),kS=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:vl.of([``,``])},range:G.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},AS=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:kl(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:kl(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:G.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function jS(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function MS(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of jS(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(G.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(G.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:G.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var NS=({state:e,dispatch:t})=>MS(e,t,!1),PS=({state:e,dispatch:t})=>MS(e,t,!0);function FS(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of jS(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var IS=({state:e,dispatch:t})=>FS(e,t,!1),LS=({state:e,dispatch:t})=>FS(e,t,!0),RS=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(jS(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=rx(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function zS(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Zv(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Y.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var BS=HS(!1),VS=HS(!0);function HS(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&zS(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new hy(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=my(s,r);for(c??=rd(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,py(t,c)];return o&&l.push(py(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:vl.of(l)},range:G.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function US(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:G.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var WS=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new hy(e,{overrideIndentation:e=>n[e]??-1}),i=US(e,(t,i,a)=>{let o=my(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=py(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},GS=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(US(e,(t,n)=>{n.push({from:t.from,insert:e.facet(dy)})}),{userEvent:`input.indent`})),!0),KS=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(US(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=rd(r,e.tabSize),a=0,o=py(e,Math.max(0,i-fy(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),qS=e=>(e.setTabFocusMode(),!0),JS=[{key:`Ctrl-b`,run:lx,shift:Rx,preventDefault:!0},{key:`Ctrl-f`,run:ux,shift:zx},{key:`Ctrl-p`,run:xx,shift:Xx},{key:`Ctrl-n`,run:Sx,shift:Zx},{key:`Ctrl-a`,run:Mx,shift:aS},{key:`Ctrl-e`,run:Nx,shift:oS},{key:`Ctrl-d`,run:SS},{key:`Ctrl-h`,run:xS},{key:`Ctrl-k`,run:ES},{key:`Ctrl-Alt-h`,run:wS},{key:`Ctrl-o`,run:kS},{key:`Ctrl-t`,run:AS},{key:`Ctrl-v`,run:Ex}],YS=[{key:`ArrowLeft`,run:lx,shift:Rx,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:mx,shift:Ux,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Ax,shift:rS,preventDefault:!0},{key:`ArrowRight`,run:ux,shift:zx,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:hx,shift:Wx,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:jx,shift:iS,preventDefault:!0},{key:`ArrowUp`,run:xx,shift:Xx,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:sS,shift:lS},{mac:`Ctrl-ArrowUp`,run:Tx,shift:$x},{key:`ArrowDown`,run:Sx,shift:Zx,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:cS,shift:uS},{mac:`Ctrl-ArrowDown`,run:Ex,shift:eS},{key:`PageUp`,run:Tx,shift:$x},{key:`PageDown`,run:Ex,shift:eS},{key:`Home`,run:kx,shift:nS,preventDefault:!0},{key:`Mod-Home`,run:sS,shift:lS},{key:`End`,run:Ox,shift:tS,preventDefault:!0},{key:`Mod-End`,run:cS,shift:uS},{key:`Enter`,run:BS,shift:BS},{key:`Mod-a`,run:dS},{key:`Backspace`,run:xS,shift:xS,preventDefault:!0},{key:`Delete`,run:SS,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:wS,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:TS,preventDefault:!0},{mac:`Mod-Backspace`,run:DS,preventDefault:!0},{mac:`Mod-Delete`,run:OS,preventDefault:!0}].concat(JS.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),XS=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:vx,shift:qx},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:yx,shift:Jx},{key:`Alt-ArrowUp`,run:NS},{key:`Shift-Alt-ArrowUp`,run:IS},{key:`Alt-ArrowDown`,run:PS},{key:`Shift-Alt-ArrowDown`,run:LS},{key:`Mod-Alt-ArrowUp`,run:hS},{key:`Mod-Alt-ArrowDown`,run:gS},{key:`Escape`,run:_S},{key:`Mod-Enter`,run:VS},{key:`Alt-l`,mac:`Ctrl-l`,run:fS},{key:`Mod-i`,run:pS,preventDefault:!0},{key:`Mod-[`,run:KS},{key:`Mod-]`,run:GS},{key:`Mod-Alt-\\`,run:WS},{key:`Shift-Mod-k`,run:RS},{key:`Shift-Mod-\\`,run:Fx},{key:`Mod-/`,run:xb},{key:`Alt-A`,mac:`Ctrl-A`,run:wb},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:qS}].concat(YS),ZS={key:`Tab`,run:GS,shift:KS},QS=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Zv(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(aC(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&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 eC(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=$S(t)+$S(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function tC(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:eC(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function nC(e,t){return n=>{for(let t=Zv(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)}}var rC=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function iC(e){return e.selection.main.from}function aC(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var oC=vu.define();function sC(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:G.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var cC=new WeakMap;function lC(e){if(!Array.isArray(e))return e;let t=cC.get(e);return t||cC.set(e,t=tC(e)),t}var uC=xu.define(),dC=xu.define(),fC=class{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=Ml(e,t),r=Pl(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(Ml(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=Ml(e,0),i=Pl(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=Ml(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=Pl(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=Ml(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=Nl(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=Pl(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?Pl(Ml(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},pC=class{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 n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},mC=K.define({combine(e){return Lu(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:gC,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>hC(e(n),t(n)),optionClass:(e,t)=>n=>hC(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function hC(e,t){return e?t?e+` `+t:e:t}function gC(e,t,n,r,i,a){let o=e.textDirection==Tf.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var _C=xu.define();function vC(e){let t=e.addToOptions.slice();return e.icons&&t.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}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),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}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function yC(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 r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var bC=class{constructor(e,t,n){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 r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(mC);this.optionContent=vC(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=yC(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:_C.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(mC).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:dC.of(null)})}),this.showOptions(i,r.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){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=yC(r.length,i,e.state.facet(mC).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}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=yC(t.options.length,t.selected,this.view.state.facet(mC).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>lp(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),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(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&SC(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=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 r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(mC).positionInfo(this.view,t,r,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 r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function xC(e,t){return n=>new bC(n,e,t)}function SC(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function CC(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function wC(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(mC);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new rC(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new pC(n):new fC(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new rC(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):CC(e.completion)>CC(c)&&(s[s.length-1]=e),c=e.completion}return s}var TC=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,AC(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=wC(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(mC).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,AC(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:zC,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},EC=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(jC,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(mC),i=(r.override||n.languageDataAt(`autocomplete`,iC(n)).map(lC)).map(e=>(this.active.find(t=>t.source==e)||new NC(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(IC));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!DC(i,this.active)||o?a=TC.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new NC(e.source,0):e));for(let e of t.effects)e.is(_C)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?OC:kC}};function DC(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var OC={"aria-autocomplete":`list`},kC={};function AC(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var jC=[];function MC(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(oC);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:e.docChanged?16:0}var NC=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=MC(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(uC))i=new e(i.source,1,n.value);else if(n.is(dC))i=new e(i.source,0);else if(n.is(IC))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(iC(e.state))}},PC=class e extends NC{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=iC(t.state);if(o>a||!r||n&2&&(iC(t.startState)==this.from||o<this.limit))return new NC(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return FC(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new QS(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??iC(t.state)):new NC(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new NC(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function FC(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):aC(e,!0).test(i)}var IC=xu.define({map(e,t){return e.map(e=>e.map(t))}}),LC=eu.define({create(){return EC.start()},update(e,t){return e.update(t)},provide:e=>[p_.from(e,e=>e.tooltip),J.contentAttributes.from(e,e=>e.attrs)]});function RC(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(LC).active.find(e=>e.source==t.source);return r instanceof PC&&(typeof n==`string`?e.dispatch({...sC(e.state,n,r.from,r.to),annotations:oC.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var zC=xC(LC,RC),BC=e=>e.state.field(LC,!1)?(e.dispatch({effects:uC.of(!0)}),!0):!1;typeof navigator==`object`&&navigator.platform;var VC=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),HC=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},UC=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,Il.TrackDel),r=t.mapPos(this.to,1,Il.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},WC=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(dy);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new UC(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1;t===0&&(t=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new HC(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},GC=Bd.widget({widget:new class extends Rd{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),KC=Bd.mark({class:`cm-snippetField`}),qC=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=Bd.set(e.map(e=>(e.from==e.to?GC:KC).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,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))}},JC=xu.define({map(e,t){return e&&e.map(t)}}),YC=xu.define(),XC=eu.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(JC))return n.value;if(n.is(YC)&&e)return new qC(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=>J.decorations.from(e,e=>e?e.deco:Bd.none)});function ZC(e,t){return G.create(e.filter(e=>e.field==t).map(e=>G.range(e.from,e.to)))}function QC(e){let t=WC.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:vl.of(a)},scrollIntoView:!0,annotations:n?[oC.of(n),Su.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=ZC(o,0)),o.some(e=>e.field>0)){let t=new qC(o,0),n=c.effects=[JC.of(t)];e.state.field(XC,!1)===void 0&&n.push(xu.appendConfig.of([XC,nw,iw,VC]))}e.dispatch(e.state.update(c))}}function $C(e){return({state:t,dispatch:n})=>{let r=t.field(XC,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:ZC(r.ranges,i),effects:JC.of(a?null:new qC(r.ranges,i)),scrollIntoView:!0})),!0}}var ew=[{key:`Tab`,run:$C(1),shift:$C(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(XC,!1)?(t(e.update({effects:JC.of(null)})),!0):!1}],tw=K.define({combine(e){return e.length?e[0]:ew}}),nw=ru.highest(Ag.compute([tw],e=>e.facet(tw)));function rw(e,t){return{...t,apply:QC(e)}}var iw=J.domEventHandlers({mousedown(e,t){let n=t.state.field(XC,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:ZC(n.ranges,i.field),effects:JC.of(n.ranges.some(e=>e.field>i.field)?new qC(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),aw=new class extends Ru{};aw.startSide=1,aw.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function ow(e){let t=e.field(LC,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}var sw=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[Y.contextHash,r]]}addChild(e,t){e.prop(Y.contextHash)!=this.hash&&(e=new j_(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new j_(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new j_(E_.none,e,t,n,this.hashProp)})}},Q;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(Q||={});var cw=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},lw=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return pw(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function uw(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==Q.OrderedList?bw:yw)(n,t,!1);return r>0&&(e.type!=Q.BulletList||_w(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var dw={[Q.Blockquote](e,t,n){return n.next==62&&(n.markers.push(Jw(Q.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(fw(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[Q.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Q.OrderedList]:uw,[Q.BulletList]:uw,[Q.Document](){return!0}};function fw(e){return e==32||e==9||e==10||e==13}function pw(e,t=0){for(;t<e.length&&fw(e.charCodeAt(t));)t++;return t}function mw(e,t,n){for(;t>n&&fw(e.charCodeAt(t-1));)t--;return t}function hw(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function gw(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function _w(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!fw(n))return-1}return n&&e.next==45&&Sw(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Pw.SetextHeading)>-1||r<3?-1:1}function vw(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function yw(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||fw(e.text.charCodeAt(e.pos+1)))&&(!n||vw(t,Q.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function bw(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!fw(e.text.charCodeAt(r+1))||n&&!vw(t,Q.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function xw(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function Sw(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&fw(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var Cw=/^[ \t]*$/,ww=/-->/,Tw=/\?>/,Ew=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,ww],[/^\s*<\?/,Tw],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Cw],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Cw]];function Dw(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=Ew.length-+!!n;e<t;e++)if(Ew[e][0].test(r))return e;return-1}function Ow(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function kw(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==Q.CodeText?e[r].to=n:e.push(Jw(Q.CodeText,t,n))}var Aw={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(kw(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){kw(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==Q.CodeText?kw(o,e.from,e.to):o.push(e);s=[]}kw(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&kw(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=Q.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(Q.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=hw(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=mw(t.text,t.text.length,o),c=[Jw(Q.CodeMark,r,r+a)];o<s&&c.push(Jw(Q.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&kw(c,e.lineStart-1,e.lineStart),c.push(Jw(Q.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(kw(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(kw(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(Q.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=gw(t);return n<0?!1:(e.startContext(Q.Blockquote,t.pos),e.addNode(Q.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(_w(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(Q.HorizontalRule,n),!0},BulletList(e,t){let n=yw(t,e,!1);if(n<0)return!1;e.block.type!=Q.BulletList&&e.startContext(Q.BulletList,t.basePos,t.next);let r=Ow(t,t.pos+1);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=bw(t,e,!1);if(n<0)return!1;e.block.type!=Q.OrderedList&&e.startContext(Q.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ow(t,t.pos+n);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=xw(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=mw(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!fw(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(Q.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(Q.HeaderMark,o-r,a-r);let c=s.finish(Q.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Dw(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=Ew[n][1],a=[],o=i!=Cw;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==ww?Q.CommentBlock:i==Tw?Q.ProcessingInstructionBlock:Q.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},jw=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
12
|
+
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&pw(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,Jw(Q.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(oT(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Jw(Q.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(iT(e,pw(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=pw(e,this.pos),n=0;if(t>this.pos){let r=aT(e,t,this.start);if(r){let t=Mw(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=Mw(e,this.pos),n>0&&n<e.length?n:-1}else return Mw(e,this.pos)}};function Mw(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!fw(n))return-1}return t}var Nw=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:Sw(t),i=t.next;if(r<0)return!1;let a=Jw(Q.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,Jw(i==61?Q.SetextHeading1:Q.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Pw={LinkReference(e,t){return t.content.charCodeAt(0)==91?new jw(t):null},SetextHeading(){return new Nw}},Fw=[(e,t)=>xw(t)>=0,(e,t)=>hw(t)>=0,(e,t)=>gw(t)>=0,(e,t)=>yw(t,e,!0)>=0,(e,t)=>bw(t,e,!0)>=0,(e,t)=>_w(t,e,!0)>=0,(e,t)=>Dw(t,e,!0)>=0],Iw={text:``,end:0},Lw=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new lw,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=sw.create(Q.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new uT(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new cw(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
13
|
+
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=dT(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Iw;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+Q[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
14
|
+
`?``:t;else{let e=t.indexOf(`
|
|
15
|
+
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=sw.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new j_(this.parser.nodeSet.types[e],Ww,Ww,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(cT(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Rw(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=cT(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Q.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?Jw(this.parser.getNodeType(e),t,n,r):new qw(e,t)}get buffer(){return new Gw(this.parser.nodeSet)}};function Rw(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=Rw(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new j_(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var zw=class e extends $_{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Lw(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=Vw(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(Bw(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=Q.ATXHeading1&&c<=Q.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(E_.define({id:c,name:n,props:l&&[[Y.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof gv?t[n]=s:Object.assign(t,s))}r=new D_(e),t&&(r=r.extend(xv(t)))}if(Bw(n.props)&&(r=r.extend(...n.props)),Bw(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(Bw(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?Hw(s,e.before):e.after?Hw(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(Bw(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?Hw(l,e.before):e.after?Hw(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new sT(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function Bw(e){return e!=null&&e.length>0}function Vw(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=Vw(e[0]);if(e.length==1)return t;let n=Vw(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||Ww).concat(t||Ww),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function Hw(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Uw=[E_.none];for(let e=1,t;t=Q[e];e++)Uw[e]=E_.define({id:e,name:t,props:e>=Q.Escape?[]:[[Y.group,e in dw?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var Ww=[],Gw=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return j_.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},Kw=class{constructor(e,t,n,r=Ww){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Gw(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},qw=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Ww}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function Jw(e,t,n,r){return new Kw(e,t,n,r)}var Yw={resolve:`Emphasis`,mark:`EmphasisMark`},Xw={resolve:`Emphasis`,mark:`EmphasisMark`},Zw={},Qw={},$w=class{constructor(e,t,n,r,i=n-t){this.type=e,this.from=t,this.to=n,this.side=r,this.size=i}},eT=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,tT=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{tT=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var nT={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(eT.charCodeAt(t)==r)return e.append(Jw(Q.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(Jw(Q.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(Jw(Q.InlineCode,n,r+1,[Jw(Q.CodeMark,n,n+i),Jw(Q.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(Jw(Q.Autolink,n,n+1+i[0].length,[Jw(Q.LinkMark,n,n+1),Jw(Q.URL,n+1,n+i[0].length),Jw(Q.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(Jw(Q.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(Jw(Q.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(Jw(Q.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=tT.test(i),s=tT.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new $w(t==95?Yw:Xw,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Jw(Q.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(Jw(Q.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new $w(Zw,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new $w(Qw,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof $w&&(r.type==Zw||r.type==Qw)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=rT(e,i,r.type==Zw?Q.Link:Q.Image,r.from,n+1);if(r.type==Zw)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof $w&&t.type==Zw&&(t.side=0)}return a.to}}return-1}};function rT(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(Jw(Q.LinkMark,r,r+(n==Q.Image?2:1))),t.push(Jw(Q.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=iT(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=aT(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(Jw(Q.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(Jw(Q.LinkMark,n,s)))}else if(o==91){let n=oT(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return Jw(n,r,s,t)}function iT(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return Jw(Q.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(fw(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?Jw(Q.URL,t+n,i+n):i==e.length&&null}}function aT(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return Jw(Q.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function oT(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&Jw(Q.LinkLabel,t+n,a+1+n);else{if(r&&!fw(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var sT=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new $w(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof $w&&(t.type==Zw||t.type==Qw))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof $w&&n.type.resolve&&n.side&2))continue;let r=n.type==Yw||n.type==Xw,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof $w&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.size+n.size)%3==0&&(e.size%3||n.size%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof Kw&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new $w(a.type,a.from,l,a.side,a.size):null,(this.parts[t]=r&&n.to!=u?new $w(n.type,u,n.to,n.side,n.size):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof Kw&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof $w&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof $w?t:null}skipSpace(e){return pw(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?Jw(this.parser.getNodeType(e),t,n,r):new qw(e,t)}};sT.linkStart=Zw,sT.imageStart=Qw,sT.emphasisAsterisk=Xw,sT.emphasisUnderscore=Yw;function cT(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof Kw&&(n[r]=new Kw(t.type,t.from,t.to,cT(t.children,[e])))}else n.splice(r++,0,e)}return n}var lT=[Q.CodeBlock,Q.ListItem,Q.OrderedList,Q.BulletList],uT=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
16
|
+
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Y.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r||t.to-n>e.to){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=dT(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new j_(e.parser.nodeSet.types[Q.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(lT.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function dT(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var fT=xv({"Blockquote/...":Z.quote,HorizontalRule:Z.contentSeparator,"ATXHeading1/... SetextHeading1/...":Z.heading1,"ATXHeading2/... SetextHeading2/...":Z.heading2,"ATXHeading3/...":Z.heading3,"ATXHeading4/...":Z.heading4,"ATXHeading5/...":Z.heading5,"ATXHeading6/...":Z.heading6,"Comment CommentBlock":Z.comment,Escape:Z.escape,Entity:Z.character,"Emphasis/...":Z.emphasis,"StrongEmphasis/...":Z.strong,"Link/... Image/...":Z.link,"OrderedList/... BulletList/...":Z.list,"BlockQuote/...":Z.quote,"InlineCode CodeText":Z.monospace,"URL Autolink":Z.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":Z.processingInstruction,"CodeInfo LinkLabel":Z.labelName,LinkTitle:Z.string,Paragraph:Z.content}),pT=new zw(new D_(Uw).extend(fT),Object.keys(Aw).map(e=>Aw[e]),Object.keys(Aw).map(e=>Pw[e]),Object.keys(Aw),Fw,dw,Object.keys(nT).map(e=>nT[e]),Object.keys(nT),[]);function mT(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function hT(e){let{codeParser:t,htmlParser:n}=e;return{wrap:tv((e,r)=>{let i=e.type.id;if(t&&(i==Q.CodeBlock||i==Q.FencedCode)){let n=``;if(i==Q.FencedCode){let t=e.node.getChild(Q.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Q.CodeText,bracketed:i==Q.FencedCode}}else if(n&&(i==Q.HTMLBlock||i==Q.HTMLTag||i==Q.CommentBlock))return{parser:n,overlay:mT(e.node,e.from,e.to)};return null})}}var gT={resolve:`Strikethrough`,mark:`StrikethroughMark`},_T={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":Z.strikethrough}},{name:`StrikethroughMark`,style:Z.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=tT.test(r),c=tT.test(i);return e.addDelimiter(gT,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function vT(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function yT(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var bT=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,xT=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&bT.test(r=t.text.slice(t.pos))){let i=[];vT(e,n.content,0,i,n.start)==vT(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];vT(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},ST={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":Z.heading}},`TableRow`,{name:`TableCell`,style:Z.content},{name:`TableDelimiter`,style:Z.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return yT(t.content,0)?new xT:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof xT)||!yT(t.text,t.basePos))return!1;let r=e.peekLine();return bT.test(r)&&vT(e,t.text,t.basePos)==vT(e,r,t.basePos)},before:`SetextHeading`}]},CT=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},wT={defineNodes:[{name:`Task`,block:!0,style:Z.list},{name:`TaskMarker`,style:Z.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new CT:null},after:`SetextHeading`}]},TT=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ET=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,DT=/[\w-]+\.[\w-]+($|[/:])/,OT=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,kT=/\/[a-zA-Z\d@.]+/gy;function AT(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function jT(e,t){ET.lastIndex=t;let n=ET.exec(e);if(!n||DT.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&AT(e,t,r,`)`)>AT(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function MT(e,t){OT.lastIndex=t;let n=OT.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var NT=[ST,wT,_T,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;TT.lastIndex=r;let i=TT.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=jT(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=MT(e.text,r):(a=MT(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(kT.lastIndex=a,i=kT.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function PT(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),fw(s))break}return-1}}var FT={defineNodes:[{name:`Superscript`,style:Z.special(Z.content)},{name:`SuperscriptMark`,style:Z.processingInstruction}],parseInline:[{name:`Superscript`,parse:PT(94,`Superscript`,`SuperscriptMark`)}]},IT={defineNodes:[{name:`Subscript`,style:Z.special(Z.content)},{name:`SubscriptMark`,style:Z.processingInstruction}],parseInline:[{name:`Subscript`,parse:PT(126,`Subscript`,`SubscriptMark`)}]},LT={defineNodes:[{name:`Emoji`,style:Z.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},RT=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new zT(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new BT(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new zT(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},zT=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},BT=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},VT=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function HT(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var UT=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},WT=new UT,GT=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=WT,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=WT,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},KT=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;YT(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};KT.prototype.contextual=KT.prototype.fallback=KT.prototype.extend=!1;var qT=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?HT(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(YT(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};qT.prototype.contextual=KT.prototype.fallback=KT.prototype.extend=!1;var JT=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function YT(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||ZT(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function XT(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function ZT(e,t,n,r){let i=XT(n,r,t);return i<0||XT(n,r,e)<i}var QT=typeof process<`u`&&/\bparse\b/.test({}.LOG),$T=null;function eE(e,t,n){let r=e.cursor(A_.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var tE=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?eE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?eE(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof j_){let n=a>this.lastRepeatPos&&i.type.id>=this.minRepeat;if(a==e||n){let t=a+i.length,r;if(a>=this.safeFrom&&t<=this.safeTo&&(!(r=i.prop(Y.lookAhead))||t+r<this.fragment.to)){if(n&&(this.lastRepeat=i,this.lastRepeatPos=a),a==e)return i}else if(a==e)return null}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},nE=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new UT)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new UT,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new UT,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=lE(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(lE(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(lE(o,s+1),t,n,r))}return r}},rE=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new GT(t,r),this.tokens=new nE(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[RT.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new tE(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&uE(r);if(e)return QT&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw QT&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return QT&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(e,t,n,r){if(!n)return null;let i=e.curContext&&e.curContext.tracker.strict,a=i?e.curContext.hash:0;for(;n;){let o=this.parser.nodeSet.types[n.type.id]==n.type?this.parser.getGoto(e.state,n.type.id):-1;if(o>-1&&n.length&&(!i||(n.prop(Y.contextHash)||0)==a))return e.useNode(n,o,t),n;if(n.children.length==0||n.positions[0]>0)break;let s=n.children[0];if(s instanceof j_&&(!r||s.type.id>=this.parser.minRepeatTerm))n=s;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=QT?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return QT&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),QT&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),QT&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return iE(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=QT?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),QT&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(QT&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)QT&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))QT&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),QT&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),iE(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),j_.build({buffer:VT.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=($T||=new WeakMap).get(e);return t||$T.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function iE(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var aE=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},oE=e=>e,sE=class{constructor(e){this.start=e.start,this.shift=e.shift||oE,this.reduce=e.reduce||oE,this.reuse=e.reuse||oE,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},cE=class e extends $_{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Y[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new D_(t.map((t,i)=>E_.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=x_;let a=HT(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(dE),this.states=HT(e.states,Uint32Array),this.data=HT(e.stateData),this.goto=HT(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new KT(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new rE(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=lE(n,i+2)];else if(n[i+1]==2)return lE(n,i+2);else break}if(a==t||a==0)return lE(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=lE(this.data,n+2);else break}r=t(lE(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=lE(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=dE(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new aE(e,n,r)}static deserialize(t){return new e(t)}};function lE(e,t){return e[t]|e[t+1]<<16}function uE(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function dE(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var fE=55,pE=1,mE=56,hE=2,gE=57,_E=3,vE=4,yE=5,bE=6,xE=7,SE=8,CE=9,wE=10,TE=11,EE=12,DE=13,OE=58,kE=14,AE=15,jE=59,ME=21,NE=23,PE=24,FE=25,IE=27,LE=28,RE=29,zE=32,BE=35,VE=37,HE=38,UE=0,WE=1,GE={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},KE={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},qE={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function JE(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var YE=null,XE=null,ZE=0;function QE(e,t){let n=e.pos+t;if(ZE==n&&XE==e)return YE;let r=e.peek(t),i=``;for(;JE(r);)i+=String.fromCharCode(r),r=e.peek(++t);return XE=e,ZE=n,YE=i?i.toLowerCase():r==nD||r==rD?void 0:null}var $E=60,eD=62,tD=47,nD=63,rD=33,iD=45;function aD(e,t){this.name=e,this.parent=t}var oD=[bE,wE,xE,SE,CE],sD=new sE({start:null,shift(e,t,n,r){return oD.indexOf(t)>-1?new aD(QE(r,1)||``,e):e},reduce(e,t){return t==ME&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==bE||i==VE?new aD(QE(r,1)||``,e):e},strict:!1}),cD=new JT((e,t)=>{if(e.next!=$E){e.next<0&&t.context&&e.acceptToken(OE);return}e.advance();let n=e.next==tD;n&&e.advance();let r=QE(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?AE:kE);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(TE);if(i&&KE[i])return e.acceptToken(OE,-2);if(t.dialectEnabled(UE))return e.acceptToken(EE);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(DE)}else{if(r==`script`)return e.acceptToken(xE);if(r==`style`)return e.acceptToken(SE);if(r==`textarea`)return e.acceptToken(CE);if(GE.hasOwnProperty(r))return e.acceptToken(wE);i&&qE[i]&&qE[i][r]?e.acceptToken(OE,-1):e.acceptToken(bE)}},{contextual:!0}),lD=new JT(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(jE);break}if(e.next==iD)t++;else if(e.next==eD&&t>=2){n>=3&&e.acceptToken(jE,-2);break}else t=0;e.advance()}});function uD(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var dD=new JT((e,t)=>{if(e.next==tD&&e.peek(1)==eD){let n=t.dialectEnabled(WE)||uD(t.context);e.acceptToken(n?yE:vE,2)}else e.next==eD&&e.acceptToken(vE,1)});function fD(e,t,n){let r=2+e.length;return new JT(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==$E||a==1&&i.next==tD||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==eD){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var pD=fD(`script`,fE,pE),mD=fD(`style`,mE,hE),hD=fD(`textarea`,gE,_E),gD=xv({"Text RawText IncompleteTag IncompleteCloseTag":Z.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Z.angleBracket,TagName:Z.tagName,"MismatchedCloseTag/TagName":[Z.tagName,Z.invalid],AttributeName:Z.attributeName,"AttributeValue UnquotedAttributeValue":Z.attributeValue,Is:Z.definitionOperator,"EntityReference CharacterReference":Z.character,Comment:Z.blockComment,ProcessingInst:Z.processingInstruction,DoctypeDecl:Z.documentMeta}),_D=cE.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!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a^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:sD,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[gD],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'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'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pD,mD,hD,dD,cD,lD,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function vD(e,t){let n=Object.create(null);for(let r of e.getChildren(PE)){let e=r.getChild(FE),i=r.getChild(IE)||r.getChild(LE);e&&(n[t.read(e.from,e.to)]=i?i.type.id==IE?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function yD(e,t){let n=e.getChild(NE);return n?t.read(n.from,n.to):` `}function bD(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=vD(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function xD(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return tv((e,t)=>{let s=e.type.id;if(s==RE)return bD(e,t,n);if(s==zE)return bD(e,t,r);if(s==BE)return bD(e,t,i);if(s==ME&&a.length){let n=e.node,r=n.firstChild,i=r&&yD(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=vD(r,t)))){let t=n.lastChild,i=t.type.id==HE?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==PE){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=yD(n.parent,t))continue;let e=n.lastChild;if(e.type.id==IE){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==LE)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var SD=148,CD=1,wD=149,TD=150,ED=2,DD=151,OD=3,kD=4,AD=152,jD=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],MD=58,ND=40,PD=95,FD=91,ID=45,LD=46,RD=35,zD=37,BD=38,VD=92,HD=10,UD=42;function WD(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function GD(e){return e>=48&&e<=57}function KD(e){return GD(e)||e>=97&&e<=102||e>=65&&e<=70}var qD=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(WD(c)||c==ID||c==PD||a&&GD(c))!a&&(c!=ID||s>0)&&(a=!0),o===s&&c==ID&&o++,r.advance();else if(c==VD&&r.peek(1)!=HD){if(r.advance(),KD(r.next)){do r.advance();while(KD(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o>=2&&i.canShift(ED)?t:c==ND?n:e);break}}},JD=new JT(qD(wD,ED,TD),{contextual:!0}),YD=new JT(qD(DD,OD,kD),{contextual:!0}),XD=new JT(e=>{if(jD.includes(e.peek(-1))){let{next:t}=e;(WD(t)||t==PD||t==RD||t==LD||t==UD||t==FD||t==MD&&WD(e.peek(1))||t==ID||t==BD)&&e.acceptToken(SD)}}),ZD=new JT(e=>{if(!jD.includes(e.peek(-1))){let{next:t}=e;if(t==zD&&(e.advance(),e.acceptToken(CD)),WD(t)){do e.advance();while(WD(e.next)||GD(e.next));e.acceptToken(CD)}}});function QD(e){let t=e.length;return(t==4||t==5||t==7||t==9)&&/^#[a-f\d]+$/i.test(e)?AD:-1}var $D=xv({"AtKeyword import charset namespace keyframes media supports font-feature-values":Z.definitionKeyword,"from to selector scope MatchFlag":Z.keyword,NamespaceName:Z.namespace,KeyframeName:Z.labelName,KeyframeRangeName:Z.operatorKeyword,TagName:Z.tagName,ClassName:Z.className,PseudoClassName:Z.constant(Z.className),IdName:Z.labelName,"FeatureName PropertyName":Z.propertyName,AttributeName:Z.attributeName,NumberLiteral:Z.number,KeywordQuery:Z.keyword,UnaryQueryOp:Z.operatorKeyword,"CallTag ValueName FontName":Z.atom,VariableName:Z.variableName,Callee:Z.operatorKeyword,Unit:Z.unit,"UniversalSelector NestingSelector":Z.definitionOperator,"MatchOp CompareOp":Z.compareOperator,"ChildOp SiblingOp, LogicOp":Z.logicOperator,BinOp:Z.arithmeticOperator,Important:Z.modifier,Comment:Z.blockComment,ColorLiteral:Z.color,"ParenthesizedContent StringLiteral":Z.string,":":Z.punctuation,PseudoOp:Z.derefOperator,"; , |":Z.separator,"( )":Z.paren,"[ ]":Z.squareBracket,"{ }":Z.brace}),eO={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:88,url:158,"url-prefix":158,domain:158,regexp:158},tO={__proto__:null,or:102,and:102,not:112,only:112,layer:212},nO={__proto__:null,selector:118,style:124,layer:208},rO={__proto__:null,"@import":204,"@media":216,"@charset":220,"@namespace":224,"@keyframes":230,"@supports":242,"@scope":246,"@font-feature-values":252},iO={__proto__:null,to:249},aO=cE.deserialize({version:14,states:"MrQYQdOOO$TQdOOP$[O`OOO%XQaO'#CfOOQP'#Ce'#CeO%`QdO'#CgO%eQ`O'#CgO%jQaO'#FrO&eQdO'#CkO'XQaO'#CcO'cQdO'#CnOOQP'#ES'#ESOOQP'#ER'#ERO'nQdO'#ETO'yQdO'#E[O'yQdO'#E_OOQP'#Fr'#FrO)`QhO'#FQOOQS'#Fq'#FqOOQS'#FT'#FTQYQdOOO)gQdO'#EeO*vQhO'#EkO)gQdO'#EmO*}QdO'#EoO+YQdO'#ErO*[QhO'#ExO+bQdO'#EzO+mQdO'#E}O+rQaO'#CfO+yQ`O'#EbO,OQ`O'#GPO,ZQdO'#GPQOQ`OOP,eO&jO'#CaPOOO)CAa)CAaOOQP'#Ci'#CiOOQP,59R,59RO%`QdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&eQdO,59VO,pQdO,59YOOQP,5:m,5:mO'nQdO,5:oO'yQdO,5:vO'yQdO,5:xO'yQdO,5:yO'yQdO'#F[O,{Q`O,58}O-TQdO'#EaOOQS,58},58}OOQP'#Cq'#CqOOQO'#EP'#EPOOQP,59Y,59YO-[Q`O,59YO-aQ`O,59YO-fQpO'#EUO-qQdO'#EVO-vQ`O'#EVO-{QpO,5:oO.iQaO,5:vO/PQaO,5:yOOQW'#D]'#D]O0OQhO'#DgO0cQhO,5;lO*[QhO'#DeO0pQ`O'#DnO0uQhO'#D{OOQW'#Fx'#FxOOQS,5;l,5;lO0zQ`O'#DhO1PQ`O'#DkOOQS-E9R-E9ROOQ['#Cv'#CvO1UQdO'#CwO1iQdO'#C|O1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#x!bS#|!c$PQ$R!dQ%d#}Q%e$OQ%i$SS&O$i&QQ&T$lR'o&uQ#{!bW%s$W%m&z'uQ&t%bQ'w&}Q(U'mR(d(ZQ%u$WQ&y%mQ't&zR(Y'uR%k$SR%Z#oQqPR#n!SQ!zfQ$f!rR%}$g",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery ColorLiteral CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector StyleQuery style ParenthesedQuery CallQuery ArgList PropertyName , PropertyName UnaryQuery ParenthesedQuery BinaryQuery ParenthesedQuery ParenthesedQuery StyleFeature PropertyName StyleRange PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:176,nodeProps:[[`isolate`,-2,5,38,``],[`openedBy`,23,`(`,30,`[`,33,`{`],[`closedBy`,24,`)`,31,`]`,34,`}`]],propSources:[$D],skippedNodes:[0,5,130],repeatNodeCount:17,tokenData:"IO~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu/wuv%Zvw0qwx1Sxy2qyz3Sz{3X{|3r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S;=`%{<%lO%jbDvU!r`Oy%jz#h%j#h#iEY#i;'S%j;'S;=`%{<%lO%jbE_U!r`Oy%jz#T%j#T#UEq#U;'S%j;'S;=`%{<%lO%jbEvU!r`Oy%jz#b%j#b#cFY#c;'S%j;'S;=`%{<%lO%jbF_U!r`Oy%jz#h%j#h#iFq#i;'S%j;'S;=`%{<%lO%jbFxS$tQ!r`Oy%jz;'S%j;'S;=`%{<%lO%jjGZSrYOy%jz;'S%j;'S;=`%{<%lO%jfGlU$gUOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%jjHTSqYOy%jz;'S%j;'S;=`%{<%lO%jfHfU#SQOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%j`H{P;=`<%l%Z",tokenizers:[XD,ZD,JD,YD,1,2,3,4,new qT(`m~RRYZ[z{a~~g~aO$c~~dP!P!Qg~lO$d~~`,28,156)],topRules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:172,get:(e,t)=>QD(e)<<1,external:QD},{term:150,get:e=>eO[e]||-1},{term:151,get:e=>tO[e]||-1},{term:4,get:e=>nO[e]||-1},{term:28,get:e=>rO[e]||-1},{term:149,get:e=>iO[e]||-1}],tokenPrec:2433}),oO=null;function sO(){if(!oO&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));oO=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return oO||[]}var cO=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),lO=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),uO=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),dO=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),fO=/^(\w[\w-]*|-\w[\w-]*|)$/,pO=/^-(-[\w-]*)?$/;function mO(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`&&t.sliceString(n.from,n.to)==`var`}var hO=new Z_,gO=[`Declaration`];function _O(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function vO(e,t,n){if(t.to-t.from>4096){let r=hO.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(A_.IncludeAnonymous);if(o.firstChild())do for(let t of vO(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return hO.set(t,i),i}{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(gO)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var yO=(e=>t=>{let{state:n,pos:r}=t,i=Zv(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:sO(),validFor:fO};if(i.name==`ValueName`)return{from:i.from,options:lO,validFor:fO};if(i.name==`PseudoClassName`)return{from:i.from,options:cO,validFor:fO};if(e(i)||(t.explicit||a)&&mO(i,n.doc))return{from:e(i)||a?i.from:r,options:vO(n.doc,_O(i),e),validFor:pO};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:sO(),validFor:fO};return{from:i.from,options:uO,validFor:fO}}if(i.name==`AtKeyword`)return{from:i.from,options:dO,validFor:fO};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:cO,validFor:fO}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:lO,validFor:fO}:o.name==`Block`||o.name==`Styles`?{from:r,options:sO(),validFor:fO}:null})(e=>e.name==`VariableName`),bO=Xv.define({name:`css`,parser:aO.configure({props:[gy.add({Declaration:Oy()}),Ay.add({"Block KeyframeList":jy})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function xO(){return new cy(bO,bO.data.of({autocomplete:yO}))}var SO=317,CO=318,wO=1,TO=2,EO=3,DO=4,OO=319,kO=321,AO=322,jO=5,MO=6,NO=0,PO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],FO=125,IO=59,LO=47,RO=42,zO=43,BO=45,VO=60,HO=44,UO=63,WO=46,GO=91,KO=new sE({start:!1,shift(e,t){return t==jO||t==MO||t==kO?e:t==AO},strict:!1}),qO=new JT((e,t)=>{let{next:n}=e;(n==FO||n==-1||t.context)&&e.acceptToken(OO)},{contextual:!0,fallback:!0}),JO=new JT((e,t)=>{let{next:n}=e,r;PO.indexOf(n)>-1||(n!=LO||(r=e.peek(1))!=LO&&r!=RO)&&n!=FO&&n!=IO&&n!=-1&&!t.context&&e.acceptToken(SO)},{contextual:!0}),YO=new JT((e,t)=>{e.next==GO&&!t.context&&e.acceptToken(CO)},{contextual:!0}),XO=new JT((e,t)=>{let{next:n}=e;if(n==zO||n==BO){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(wO);e.acceptToken(n?wO:TO)}}else n==UO&&e.peek(1)==WO&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(EO))},{contextual:!0});function ZO(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var QO=new JT((e,t)=>{if(e.next!=VO||!t.dialectEnabled(NO)||(e.advance(),e.next==LO))return;let n=0;for(;PO.indexOf(e.next)>-1;)e.advance(),n++;if(ZO(e.next,!0)){for(e.advance(),n++;ZO(e.next,!1);)e.advance(),n++;for(;PO.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==HO)return;for(let t=0;;t++){if(t==7){if(!ZO(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(DO,-n)}),$O=xv({"get set async static":Z.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Z.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Z.operatorKeyword,"let var const using function class extends":Z.definitionKeyword,"import export from":Z.moduleKeyword,"with debugger new":Z.keyword,TemplateString:Z.special(Z.string),super:Z.atom,BooleanLiteral:Z.bool,this:Z.self,null:Z.null,Star:Z.modifier,VariableName:Z.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Z.function(Z.variableName),VariableDefinition:Z.definition(Z.variableName),Label:Z.labelName,PropertyName:Z.propertyName,PrivatePropertyName:Z.special(Z.propertyName),"CallExpression/MemberExpression/PropertyName":Z.function(Z.propertyName),"FunctionDeclaration/VariableDefinition":Z.function(Z.definition(Z.variableName)),"ClassDeclaration/VariableDefinition":Z.definition(Z.className),"NewExpression/VariableName":Z.className,PropertyDefinition:Z.definition(Z.propertyName),PrivatePropertyDefinition:Z.definition(Z.special(Z.propertyName)),UpdateOp:Z.updateOperator,"LineComment Hashbang":Z.lineComment,BlockComment:Z.blockComment,Number:Z.number,String:Z.string,Escape:Z.escape,ArithOp:Z.arithmeticOperator,LogicOp:Z.logicOperator,BitOp:Z.bitwiseOperator,CompareOp:Z.compareOperator,RegExp:Z.regexp,Equals:Z.definitionOperator,Arrow:Z.function(Z.punctuation),": Spread":Z.punctuation,"( )":Z.paren,"[ ]":Z.squareBracket,"{ }":Z.brace,"InterpolationStart InterpolationEnd":Z.special(Z.brace),".":Z.derefOperator,", ;":Z.separator,"@":Z.meta,TypeName:Z.typeName,TypeDefinition:Z.definition(Z.typeName),"type enum interface implements namespace module declare":Z.definitionKeyword,"abstract global Privacy readonly override":Z.modifier,"is keyof unique infer asserts":Z.operatorKeyword,JSXAttributeValue:Z.attributeValue,JSXText:Z.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Z.angleBracket,"JSXIdentifier JSXNameSpacedName":Z.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Z.attributeName,"JSXBuiltin/JSXIdentifier":Z.standard(Z.tagName)}),ek={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:237,private:237,protected:237,readonly:239,instanceof:258,satisfies:261,import:294,keyof:351,unique:355,infer:361,asserts:397,is:399,abstract:419,implements:421,type:423,let:426,var:428,using:431,interface:437,enum:441,namespace:447,module:449,declare:453,global:457,defer:473,for:478,of:487,while:490,with:494,do:498,if:502,else:504,switch:508,case:514,try:520,catch:524,finally:528,return:532,throw:536,break:540,continue:544,debugger:548},tk={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:403},nk={__proto__:null,"<":193},rk=cE.deserialize({version:14,states:"$GSQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Im'#ImO1XQ`O'#GtO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JsO6[Q!0MxO'#JtO6uQ`O'#F^O6zQ,UO'#FuOOQ!0Lf'#Fg'#FgO7VO7dO'#FgO9XQMhO'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l%e(i(j(k+`.].^._.a3^3_7VS*^$x*cQ/v*_Q2W,qQ2m-WQ4b/rQ6s2fQ7u4cQ9Y6tT=n'X+^V#aW%h*ZU#`W%h*ZS(V#W(_U([#Z+[/oS-]'X+^T.Q(U.VV'_!e%i*[Q$lfR)y$qT)n$l)oR4X/WT*`$x*cT*i${*ZQ0y+hQ1i,XQ3a.hQ5v1kQ6R1sQ7Z3eQ8t6UQ9e7YQ:`8sQ:r9dQ;]:bQ;e:tQ;p;^R;s;fnqOXst!Z#d%m&r&t&u&w,u,z2^2aQ&l!VR,j&itmOXst!U!V!Z#d%m&i&r&t&u&w,u,z2^2aR,q&oT%lm,qR1m,ZR,i&gQ&U|S,P&V&WR1`,QR+u&PT&p!W&sT&q!W&sT2`,z2a",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty VariableDefinition Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:381,context:KO,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,208,212,216,217,219,222,225,235,238,244,246,248,250,253,259,265,267,269,271,273,275,276,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,121,122,137,140,142,143,144,145,146,148,149,168,170,172,`Expression`,-23,31,33,37,41,43,45,174,176,178,179,181,182,183,185,186,187,189,190,191,202,204,206,207,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,161,`JSXStartCloseTag`],[`closedBy`,-2,24,169,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{term:344,get:e=>tk[e]||-1},{term:95,get:e=>nk[e]||-1}],tokenPrec:15205}),ik=[rw("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),rw("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),rw("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),rw(`do {
|
|
17
|
+
\${}
|
|
18
|
+
} while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),rw(`while (\${}) {
|
|
19
|
+
\${}
|
|
20
|
+
}`,{label:`while`,detail:`loop`,type:`keyword`}),rw(`try {
|
|
21
|
+
\${}
|
|
22
|
+
} catch (\${error}) {
|
|
23
|
+
\${}
|
|
24
|
+
}`,{label:`try`,detail:`/ catch block`,type:`keyword`}),rw(`if (\${}) {
|
|
25
|
+
\${}
|
|
26
|
+
}`,{label:`if`,detail:`block`,type:`keyword`}),rw(`if (\${}) {
|
|
27
|
+
\${}
|
|
28
|
+
} else {
|
|
29
|
+
\${}
|
|
30
|
+
}`,{label:`if`,detail:`/ else block`,type:`keyword`}),rw(`class \${name} {
|
|
31
|
+
constructor(\${params}) {
|
|
32
|
+
\${}
|
|
33
|
+
}
|
|
34
|
+
}`,{label:`class`,detail:`definition`,type:`keyword`}),rw('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),rw('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],ak=ik.concat([rw(`interface \${name} {
|
|
35
|
+
\${}
|
|
36
|
+
}`,{label:`interface`,detail:`definition`,type:`keyword`}),rw("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),rw(`enum \${name} {
|
|
37
|
+
\${}
|
|
38
|
+
}`,{label:`enum`,detail:`definition`,type:`keyword`})]),ok=new Z_,sk=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function ck(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var lk=[`FunctionDeclaration`],uk={FunctionDeclaration:ck(`function`),ClassDeclaration:ck(`class`),ClassExpression:()=>!0,EnumDeclaration:ck(`constant`),TypeAliasDeclaration:ck(`type`),NamespaceDeclaration:ck(`namespace`),VariableDefinition(e,t){e.matchContext(lk)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function dk(e,t){let n=ok.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(A_.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=uk[t.name];if(e&&e(t,a)||sk.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of dk(e,t.node))r.push(n);return!1}}),ok.set(t,r),r}var fk=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,pk=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function mk(e){let t=Zv(e.state).resolveInner(e.pos,-1);if(pk.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&fk.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)sk.has(n.name)&&(r=r.concat(dk(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:fk}}var hk=Xv.define({name:`javascript`,parser:rk.configure({props:[gy.add({IfStatement:Oy({except:/^\s*({|else\b)/}),TryStatement:Oy({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Dy,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ty({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Oy({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Ay.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":jy,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),gk={test:e=>/^JSX/.test(e.name),facet:Kv({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},_k=hk.configure({dialect:`ts`},`typescript`),vk=hk.configure({dialect:`jsx`,props:[qv.add(e=>e.isTop?[gk]:void 0)]}),yk=hk.configure({dialect:`jsx ts`,props:[qv.add(e=>e.isTop?[gk]:void 0)]},`typescript`),bk=e=>({label:e,type:`keyword`}),xk=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(bk),Sk=xk.concat([`declare`,`implements`,`private`,`protected`,`public`].map(bk));function Ck(e={}){let t=e.jsx?e.typescript?yk:vk:e.typescript?_k:hk,n=e.typescript?ak.concat(Sk):ik.concat(xk);return new cy(t,[hk.data.of({autocomplete:nC(pk,tC(n))}),hk.data.of({autocomplete:mk}),e.jsx?Dk:[]])}function wk(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function Tk(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var Ek=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Dk=J.inputHandler.of((e,t,n,r,i)=>{if((Ek?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!hk.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=Zv(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=Tk(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:G.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=wk(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=Tk(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),Ok=[`_blank`,`_self`,`_top`,`_parent`],kk=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],Ak=[`get`,`post`,`put`,`delete`],jk=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],Mk=[`true`,`false`],$={},Nk={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ok,hreflang:null}},abbr:$,address:$,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:$,aside:$,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:$,base:{attrs:{href:null,target:Ok}},bdi:$,bdo:$,blockquote:{attrs:{cite:null}},body:$,br:$,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:jk,formmethod:Ak,formnovalidate:[`novalidate`],formtarget:Ok,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:$,center:$,cite:$,code:$,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:$,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:$,div:$,dl:$,dt:$,em:$,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:$,figure:$,footer:$,form:{attrs:{action:null,name:null,"accept-charset":kk,autocomplete:[`on`,`off`],enctype:jk,method:Ak,novalidate:[`novalidate`],target:Ok}},h1:$,h2:$,h3:$,h4:$,h5:$,h6:$,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:$,hgroup:$,hr:$,html:{attrs:{manifest:null}},i:$,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:jk,formmethod:Ak,formnovalidate:[`novalidate`],formtarget:Ok,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:$,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:$,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:$,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:kk,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:$,noscript:$,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:$,param:{attrs:{name:null,value:null}},pre:$,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:$,rt:$,ruby:$,samp:$,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:kk}},section:$,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:$,source:{attrs:{src:null,type:null,media:null}},span:$,strong:$,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:$,summary:$,sup:$,table:$,tbody:$,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:$,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:$,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:$,time:{attrs:{datetime:null}},title:$,tr:$,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:$,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:$},Pk={accesskey:null,class:null,contenteditable:Mk,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:Mk,autocorrect:Mk,autocapitalize:Mk,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":Mk,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":Mk,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":Mk,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":Mk,"aria-hidden":Mk,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":Mk,"aria-multiselectable":Mk,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":Mk,"aria-relevant":null,"aria-required":Mk,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Fk=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of Fk)Pk[e]=null;var Ik=class{constructor(e,t){this.tags={...Nk,...e},this.globalAttrs={...Pk,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Ik.default=new Ik;function Lk(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function Rk(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`){if(t)t=!1;else return e}return null}function zk(e,t,n){return n.tags[Lk(e,Rk(t))]?.children||n.allTags}function Bk(e,t){let n=[];for(let r=Rk(t);r&&!r.type.isTop;r=Rk(r.parent)){let i=Lk(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var Vk=/^[:\-\.\w\u00b7-\uffff]*$/;function Hk(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=Rk(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:zk(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(Bk(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Uk(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:Bk(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:Vk}}function Wk(e,t,n,r){let i=[],a=0;for(let r of zk(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of Bk(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Gk(e,t,n,r,i){let a=Rk(n),o=a?t.tags[Lk(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:Vk}}function Kk(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=Rk(n),i=r?t.tags[Lk(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function qk(e,t){let{state:n,pos:r}=t,i=Zv(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?Uk(n,i,i.from,r):Hk(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?Hk(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?Uk(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?Gk(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?Kk(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?Wk(n,e,i,r):null}function Jk(e){return qk(Ik.default,e)}function Yk(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new Ik(t,n):Ik.default;return e=>qk(r,e)}var Xk=hk.parser.configure({top:`SingleExpression`}),Zk=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:_k.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:vk.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:yk.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Xk},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:hk.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:bO.parser}],Qk=[{name:`style`,parser:bO.parser.configure({top:`Styles`})}].concat(Fk.map(e=>({name:e,parser:hk.parser}))),$k=Xv.define({name:`html`,parser:_D.configure({props:[gy.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),Ay.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),cb.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),eA=$k.configure({wrap:xD(Zk,Qk)});function tA(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=xD((e.nestedLanguages||[]).concat(Zk),(e.nestedAttributes||[]).concat(Qk))),new cy(n?$k.configure({wrap:n,dialect:t}):t?eA.configure({dialect:t}):eA,[eA.data.of({autocomplete:Yk(e)}),e.autoCloseTags===!1?[]:iA,Ck().support,xO().support])}var nA=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `));function rA(e,t,n){for(;;){if(t.lastChild?.name!=`CloseTag`)return!1;let r=t.parent;if(!r||Lk(e,r)!=n)return!0;t=r}}var iA=J.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!eA.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=Zv(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if((a=Lk(o.doc,t.parent,n))&&!nA.has(a)&&!rA(o.doc,t.parent,a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=Lk(o.doc,e,n))&&!nA.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:G.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),aA=Kv({commentTokens:{block:{open:`<!--`,close:`-->`}}}),oA=new Y,sA=pT.configure({props:[Ay.add(e=>!e.is(`Block`)||e.is(`Document`)||cA(e)!=null||lA(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),oA.add(cA),gy.add({Document:()=>null}),Gv.add({Document:aA})]});function cA(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function lA(e){return e.name==`OrderedList`||e.name==`BulletList`}function uA(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=cA(e.type))!=null&&r<=t)break;n=e}return n.to}var dA=ky.of((e,t,n)=>{for(let r=Zv(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(oA);if(e==null)continue;let t=uA(r,e);if(t>n)return{from:n,to:t}}return null});function fA(e){return new Jv(aA,e,[],`markdown`)}var pA=fA(sA),mA=fA(sA.configure([NT,IT,FT,LT,{props:[Ay.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function hA(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):ly.matchLanguageName(e,n,!0),t instanceof ly)return t.support?t.support.language.parser:ty.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var gA=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+vA(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function _A(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new gA(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new gA(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new gA(i.parent,s,s+t,a[1],e,n,i))}}return r}function vA(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function yA(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=vA(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function bA(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(dy)!=` `)return e;let r=rd(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var xA=((e={})=>({state:t,dispatch:n})=>{let r=Zv(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!mA.isActiveAt(t,n.from,-1)&&!mA.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=_A(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){if(l.item.from<s.from&&!/^[\s>]*$/.test(s.text.slice(0,l.to)))return a={range:n};let r=l.node.firstChild,u=l.node.getChild(`ListItem`,`ListItem`);if(r.to>=o||u&&u.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&yA(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&yA(e.item,i,r),{range:G.cursor(t+n.length),changes:r}}{let e=wA(c,t,s);return{range:G.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&yA(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?rd(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=bA(p,t),CA(l.node,t.doc)&&(p=wA(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:G.cursor(m+p.length+1),changes:d}});return!a&&(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function SA(e){return e.name==`QuoteMark`||e.name==`ListMark`}function CA(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function wA(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?rd(n.text,4,e[t+1].from)-r.length:null,t<i);return bA(r,t)}function TA(e,t){let n=e.resolveInner(t,-1),r=t;SA(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(SA(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var EA=[{key:`Enter`,run:xA},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=Zv(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&mA.isActiveAt(e,t.from)){let t=a.lineAt(i),r=_A(TA(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:G.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(rd(t.text,4,n.to)-rd(t.text,4,n.from));return r==t.from&&(i=bA(i,e)),{range:G.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:G.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],DA=tA({matchClosingTags:!1});function OA(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=pA,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=DA}=e;if(!(i instanceof zw))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,dA],u;o&&l.push(NA),n instanceof cy?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?hA(t,u):void 0;c.push(hT({codeParser:d,htmlParser:s.language.parser})),r&&l.push(ru.high(Ag.of(EA)));let f=fA(i.configure(c));return a&&l.push(f.data.of({autocomplete:kA})),new cy(f,l)}function kA(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=Zv(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:jA(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var AA=null;function jA(){if(AA)return AA;let e=Jk(new QS(Iu.create({extensions:DA}),0,!0));return AA=e?e.options:[]}var MA=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,NA=J.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!mA.isActiveAt(t.state,n.from,1)))return!1;let i=Zv(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||MA.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),!a&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function PA(e){var t=e.Pos;function n(e,t,n){if(t.line===n.line&&t.ch>=n.ch-1){var r=e.getLine(t.line).charCodeAt(t.ch);55296<=r&&r<=55551&&(n.ch+=1)}return{start:t,end:n}}var r=[{keys:`<Left>`,type:`keyToKey`,toKeys:`h`},{keys:`<Right>`,type:`keyToKey`,toKeys:`l`},{keys:`<Up>`,type:`keyToKey`,toKeys:`k`},{keys:`<Down>`,type:`keyToKey`,toKeys:`j`},{keys:`g<Up>`,type:`keyToKey`,toKeys:`gk`},{keys:`g<Down>`,type:`keyToKey`,toKeys:`gj`},{keys:`<Space>`,type:`keyToKey`,toKeys:`l`},{keys:`<BS>`,type:`keyToKey`,toKeys:`h`},{keys:`<Del>`,type:`keyToKey`,toKeys:`x`},{keys:`<C-Space>`,type:`keyToKey`,toKeys:`W`},{keys:`<C-BS>`,type:`keyToKey`,toKeys:`B`},{keys:`<S-Space>`,type:`keyToKey`,toKeys:`w`},{keys:`<S-BS>`,type:`keyToKey`,toKeys:`b`},{keys:`<C-n>`,type:`keyToKey`,toKeys:`j`},{keys:`<C-p>`,type:`keyToKey`,toKeys:`k`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`s`,type:`keyToKey`,toKeys:`cl`,context:`normal`},{keys:`s`,type:`keyToKey`,toKeys:`c`,context:`visual`},{keys:`S`,type:`keyToKey`,toKeys:`cc`,context:`normal`},{keys:`S`,type:`keyToKey`,toKeys:`VdO`,context:`visual`},{keys:`<Home>`,type:`keyToKey`,toKeys:`0`},{keys:`<End>`,type:`keyToKey`,toKeys:`$`},{keys:`<PageUp>`,type:`keyToKey`,toKeys:`<C-b>`},{keys:`<PageDown>`,type:`keyToKey`,toKeys:`<C-f>`},{keys:`<CR>`,type:`keyToKey`,toKeys:`j^`,context:`normal`},{keys:`<Ins>`,type:`keyToKey`,toKeys:`i`,context:`normal`},{keys:`<Ins>`,type:`action`,action:`toggleOverwrite`,context:`insert`},{keys:`H`,type:`motion`,motion:`moveToTopLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`M`,type:`motion`,motion:`moveToMiddleLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`L`,type:`motion`,motion:`moveToBottomLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`h`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!1}},{keys:`l`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!0}},{keys:`j`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,linewise:!0}},{keys:`k`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,linewise:!0}},{keys:`gj`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!0}},{keys:`gk`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!1}},{keys:`w`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1}},{keys:`W`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:`e`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:`E`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`b`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1}},{keys:`B`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:`ge`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:`gE`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`{`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`}`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`(`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!1}},{keys:`)`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!0}},{keys:`<C-f>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!0}},{keys:`<C-b>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!1}},{keys:`<C-d>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!0,explicitRepeat:!0}},{keys:`<C-u>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!1,explicitRepeat:!0}},{keys:`gg`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`G`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`g$`,type:`motion`,motion:`moveToEndOfDisplayLine`},{keys:`g^`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`g0`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`0`,type:`motion`,motion:`moveToStartOfLine`},{keys:`^`,type:`motion`,motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`+`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0}},{keys:`-`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,toFirstChar:!0}},{keys:`_`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:`$`,type:`motion`,motion:`moveToEol`,motionArgs:{inclusive:!0}},{keys:`%`,type:`motion`,motion:`moveToMatchedSymbol`,motionArgs:{inclusive:!0,toJumplist:!0}},{keys:`f<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`F<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!1}},{keys:`t<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`T<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!1}},{keys:`;`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!0}},{keys:`,`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!1}},{keys:`'<register>`,type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0}},{keys:"]`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0}},{keys:"[`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1}},{keys:`]'`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0,linewise:!0}},{keys:`['`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1,linewise:!0}},{keys:`]p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:`[p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:`]<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`[<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`|`,type:`motion`,motion:`moveToColumn`},{keys:`o`,type:`motion`,motion:`moveToOtherHighlightedEnd`,context:`visual`},{keys:`O`,type:`motion`,motion:`moveToOtherHighlightedEnd`,motionArgs:{sameLine:!0},context:`visual`},{keys:`d`,type:`operator`,operator:`delete`},{keys:`y`,type:`operator`,operator:`yank`},{keys:`c`,type:`operator`,operator:`change`},{keys:`=`,type:`operator`,operator:`indentAuto`},{keys:`>`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!0}},{keys:`<`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!1}},{keys:`g~`,type:`operator`,operator:`changeCase`},{keys:`gu`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},isEdit:!0},{keys:`gU`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},isEdit:!0},{keys:`gc`,type:`operator`,operator:`toggleComment`,isEdit:!0},{keys:`n`,type:`motion`,motion:`findNext`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`N`,type:`motion`,motion:`findNext`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`gn`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!0}},{keys:`gN`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!1}},{keys:`gq`,type:`operator`,operator:`hardWrap`},{keys:`gw`,type:`operator`,operator:`hardWrap`,operatorArgs:{keepCursor:!0}},{keys:`g?`,type:`operator`,operator:`rot13`},{keys:`x`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:`X`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:`D`,type:`operatorMotion`,operator:`delete`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`D`,type:`operator`,operator:`delete`,operatorArgs:{linewise:!0},context:`visual`},{keys:`Y`,type:`operatorMotion`,operator:`yank`,motion:`expandToLine`,motionArgs:{linewise:!0},context:`normal`},{keys:`Y`,type:`operator`,operator:`yank`,operatorArgs:{linewise:!0},context:`visual`},{keys:`C`,type:`operatorMotion`,operator:`change`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`C`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0},context:`visual`},{keys:`~`,type:`operatorMotion`,operator:`changeCase`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:`normal`},{keys:`~`,type:`operator`,operator:`changeCase`,context:`visual`},{keys:`<C-u>`,type:`operatorMotion`,operator:`delete`,motion:`moveToStartOfLine`,context:`insert`},{keys:`<C-w>`,type:`operatorMotion`,operator:`delete`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1},context:`insert`},{keys:`<C-w>`,type:`idle`,context:`normal`},{keys:`<C-i>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!0}},{keys:`<C-o>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!1}},{keys:`<C-e>`,type:`action`,action:`scroll`,actionArgs:{forward:!0,linewise:!0}},{keys:`<C-y>`,type:`action`,action:`scroll`,actionArgs:{forward:!1,linewise:!0}},{keys:`a`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`charAfter`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`eol`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`endOfSelectedArea`},context:`visual`},{keys:`i`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`inplace`},context:`normal`},{keys:`gi`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`lastEdit`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`firstNonBlank`},context:`normal`},{keys:`gI`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`bol`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`startOfSelectedArea`},context:`visual`},{keys:`o`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:`normal`},{keys:`O`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:`normal`},{keys:`v`,type:`action`,action:`toggleVisualMode`},{keys:`V`,type:`action`,action:`toggleVisualMode`,actionArgs:{linewise:!0}},{keys:`<C-v>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`<C-q>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`gv`,type:`action`,action:`reselectLastSelection`},{keys:`J`,type:`action`,action:`joinLines`,isEdit:!0},{keys:`gJ`,type:`action`,action:`joinLines`,actionArgs:{keepSpaces:!0},isEdit:!0},{keys:`p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:`P`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:`r<character>`,type:`action`,action:`replace`,isEdit:!0},{keys:`@<register>`,type:`action`,action:`replayMacro`},{keys:`q<register>`,type:`action`,action:`enterMacroRecordMode`},{keys:`R`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{replace:!0},context:`normal`},{keys:`R`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0,fullLine:!0},context:`visual`,exitVisualBlock:!0},{keys:`u`,type:`action`,action:`undo`,context:`normal`},{keys:`u`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},context:`visual`,isEdit:!0},{keys:`U`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},context:`visual`,isEdit:!0},{keys:`<C-r>`,type:`action`,action:`redo`},{keys:`m<register>`,type:`action`,action:`setMark`},{keys:`"<register>`,type:`action`,action:`setRegister`},{keys:`<C-r><register>`,type:`action`,action:`insertRegister`,context:`insert`,isEdit:!0},{keys:`<C-o>`,type:`action`,action:`oneNormalCommand`,context:`insert`},{keys:`zz`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`}},{keys:`z.`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zt`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`}},{keys:`z<CR>`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zb`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`}},{keys:`z-`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`.`,type:`action`,action:`repeatLastEdit`},{keys:`<C-a>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:`<C-x>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:`<C-t>`,type:`action`,action:`indent`,actionArgs:{indentRight:!0},context:`insert`},{keys:`<C-d>`,type:`action`,action:`indent`,actionArgs:{indentRight:!1},context:`insert`},{keys:`a<register>`,type:`motion`,motion:`textObjectManipulation`},{keys:`i<register>`,type:`motion`,motion:`textObjectManipulation`,motionArgs:{textObjectInner:!0}},{keys:`/`,type:`search`,searchArgs:{forward:!0,querySrc:`prompt`,toJumplist:!0}},{keys:`?`,type:`search`,searchArgs:{forward:!1,querySrc:`prompt`,toJumplist:!0}},{keys:`*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`g*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`g#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`:`,type:`ex`}],i=Object.create(null),a=r.length,o=[{name:`colorscheme`,shortName:`colo`},{name:`map`},{name:`imap`,shortName:`im`},{name:`nmap`,shortName:`nm`},{name:`vmap`,shortName:`vm`},{name:`omap`,shortName:`om`},{name:`noremap`,shortName:`no`},{name:`nnoremap`,shortName:`nn`},{name:`vnoremap`,shortName:`vn`},{name:`inoremap`,shortName:`ino`},{name:`onoremap`,shortName:`ono`},{name:`unmap`},{name:`mapclear`,shortName:`mapc`},{name:`nmapclear`,shortName:`nmapc`},{name:`vmapclear`,shortName:`vmapc`},{name:`imapclear`,shortName:`imapc`},{name:`omapclear`,shortName:`omapc`},{name:`write`,shortName:`w`},{name:`undo`,shortName:`u`},{name:`redo`,shortName:`red`},{name:`set`,shortName:`se`},{name:`setlocal`,shortName:`setl`},{name:`setglobal`,shortName:`setg`},{name:`sort`,shortName:`sor`},{name:`substitute`,shortName:`s`,possiblyAsync:!0},{name:`startinsert`,shortName:`start`},{name:`nohlsearch`,shortName:`noh`},{name:`yank`,shortName:`y`},{name:`put`,shortName:`pu`},{name:`delmarks`,shortName:`delm`},{name:`marks`,excludeFromCommandHistory:!0},{name:`registers`,shortName:`reg`,excludeFromCommandHistory:!0},{name:`vglobal`,shortName:`v`},{name:`delete`,shortName:`d`},{name:`join`,shortName:`j`},{name:`normal`,shortName:`norm`},{name:`global`,shortName:`g`}],s=xe(``);function c(t){t.setOption(`disableInput`,!0),t.setOption(`showCursorWhenSelecting`,!1),e.signal(t,`vim-mode-change`,{mode:`normal`}),t.on(`cursorActivity`,_n),oe(t),e.on(t.getInputField(),`paste`,u(t))}function l(t){t.setOption(`disableInput`,!1),t.off(`cursorActivity`,_n),e.off(t.getInputField(),`paste`,u(t)),t.state.vim=null,Yt&&clearTimeout(Yt)}function u(e){var t=e.state.vim;return t.onPasteFn||=function(){t.insertMode||(e.setCursor(Le(e.getCursor(),0,1)),Ne.enterInsertMode(e,{},t))},t.onPasteFn}var d=/[\d]/,f=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],p=[function(e){return/\S/.test(e)}],m=[`<`,`>`],h=[`-`,`"`,`.`,`:`,`_`,`/`,`+`],g=/^\w$/,_=/^[A-Z]$/;try{_=RegExp(`^[\\p{Lu}]$`,`u`)}catch{}function v(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function y(e){return/^[a-z]$/.test(e)}function b(e){return`()[]{}`.indexOf(e)!=-1}function x(e){return d.test(e)}function S(e){return _.test(e)}function C(e){return/^\s*$/.test(e)}function w(e){return`.?!`.indexOf(e)!=-1}function T(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}var ee={};function E(e,t,n,r,i){if(t===void 0&&!i)throw Error(`defaultValue is required unless callback is provided`);if(n||=`string`,ee[e]={type:n,defaultValue:t,callback:i},r)for(var a=0;a<r.length;a++)ee[r[a]]=ee[e];t&&te(e,t)}function te(e,t,n,r){var i=ee[e];r||={};var a=r.scope;if(!i)return Error(`Unknown option: `+e);if(i.type==`boolean`){if(t&&t!==!0)return Error(`Invalid argument: `+e+`=`+t);t!==!1&&(t=!0)}i.callback?(a!==`local`&&i.callback(t,void 0),a!==`global`&&n&&i.callback(t,n)):(a!==`local`&&(i.value=i.type==`boolean`?!!t:t),a!==`global`&&n&&(n.state.vim.options[e]={value:t}))}function ne(e,t,n){var r=ee[e];n||={};var i=n.scope;if(!r)return Error(`Unknown option: `+e);if(r.callback){let e=t&&r.callback(void 0,t);return i!==`global`&&e!==void 0?e:i===`local`?void 0:r.callback()}return(i!==`global`&&t&&t.state.vim.options[e]||i!==`local`&&r||{}).value}E(`filetype`,void 0,`string`,[`ft`],function(e,t){if(t!==void 0){if(e===void 0){let e=t.getOption(`mode`);return e==`null`?``:e}{let n=e==``?`null`:e;t.setOption(`mode`,n)}}}),E(`textwidth`,80,`number`,[`tw`],function(e,t){if(t!==void 0){if(e===void 0)return t.getOption(`textwidth`);var n=Math.round(e);n>1&&t.setOption(`textwidth`,n)}});var re=function(){var e=100,t=-1,n=0,r=0,i=Array(e);function a(a,o,s){var c=i[t%e];function l(n){var r=++t%e,o=i[r];o&&o.clear(),i[r]=a.setBookmark(n)}if(c){var u=c.find();u&&!Ue(u,o)&&l(o)}else l(o);l(s),n=t,r=t-e+1,r<0&&(r=0)}function o(a,o){t+=o,t>n?t=n:t<r&&(t=r);var s=i[(e+t)%e];if(s&&!s.find()){var c=o>0?1:-1,l,u=a.getCursor();do if(t+=c,s=i[(e+t)%e],s&&(l=s.find())&&!Ue(u,l))break;while(t<n&&t>r)}return s}function s(e,n){var r=t,i=o(e,n);return t=r,i&&i.find()}return{cachedCursor:void 0,add:a,find:s,move:o}},ie=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ae{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ie()}exitMacroRecordMode(){var e=D.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1}enterMacroRecordMode(e,t){var n=D.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var r=Ht(`span`,{class:`cm-vim-message`},`recording @`+t);this.onRecordingDone=e.openDialog(r,function(){},{bottom:!0})}this.isRecording=!0}}}function oe(e){return e.state.vim||(e.state.vim={inputState:new Se,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:``}),e.state.vim}var D;function se(){for(var e in D={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:re(),macroModeState:new ae,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:``},registerController:new Ee({}),searchHistoryController:new De,exCommandHistoryController:new De},ee){var t=ee[e];t.value=t.defaultValue}}class ce{constructor(e,t){this.keyName=e,this.key=t.key,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey}}var le,ue={enterVimMode:c,leaveVimMode:l,buildKeyMap:function(){},getRegisterController:function(){return D.registerController},resetVimGlobalState_:se,getVimGlobalState_:function(){return D},maybeInitVimState_:oe,suppressErrorLogging:!1,InsertModeKey:ce,map:function(e,t,n){sn.map(e,t,n)},unmap:function(e,t){return sn.unmap(e,t)},noremap:function(e,t,n){sn.map(e,t,n,!0)},mapclear:function(e){var t=r.length,n=a,i=r.slice(0,t-n);if(r=r.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var s=i[o];if(e!==s.context){if(s.context)this._mapCommand(s);else{var c=[`normal`,`insert`,`visual`];for(var l in c)if(c[l]!==e){var u=Object.assign({},s);u.context=c[l],this._mapCommand(u)}}}}},langmap:be,vimKeyFromEvent:ye,setOption:te,getOption:ne,defineOption:E,defineEx:function(e,t,n){if(!t)t=e;else if(e.indexOf(t)!==0)throw Error(`(Vim.defineEx) "`+t+`" is not a prefix of "`+e+`", command not registered`);on[e]=n,sn.commandMap_[t]={name:e,shortName:t,type:`api`}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if(typeof r==`function`)return r()},multiSelectHandleKey:wn,findKey:function(t,n,i){var a=oe(t),o=t;function s(){var e=D.macroModeState;if(e.isRecording){if(n==`q`)return e.exitMacroRecordMode(),Ce(o),!0;i!=`mapping`&&pn(e,n)}}function c(){if(n==`<Esc>`){if(a.visualMode)st(o);else if(a.insertMode)cn(o);else return;return Ce(o),!0}}function l(){if(c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``),t=n.length==1,i=Oe.matchCommand(e,r,a.inputState,`insert`),s=a.inputState.changeQueue;if(i.type==`none`)return Ce(o),!1;if(i.type==`partial`){if(i.expectLiteralNext&&(a.expectLiteralNext=!0),le&&window.clearTimeout(le),le=t&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&Ce(o)},ne(`insertModeEscKeysTimeout`)),t){var l=o.listSelections();(!s||s.removed.length!=l.length)&&(s=a.inputState.changeQueue=new we),s.inserted+=n;for(var u=0;u<l.length;u++){var d=Ge(l[u].anchor,l[u].head),f=Ke(l[u].anchor,l[u].head),p=o.getRange(d,o.state.overwrite?Le(f,0,1):f);s.removed[u]=(s.removed[u]||``)+p}}return!t}if(i.type==`full`&&(a.inputState.keyBuffer.length=0),a.expectLiteralNext=!1,le&&window.clearTimeout(le),i.command&&s){for(var l=o.listSelections(),u=0;u<l.length;u++){var m=l[u].head;o.replaceRange(s.removed[u]||``,Le(m,0,-s.inserted.length),m,`+input`)}D.macroModeState.lastInsertModeChanges.changes.pop()}return i.command||Ce(o),i.command}function u(){if(s()||c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``);if(/^[1-9]\d*$/.test(e))return!0;var t=/^(\d*)(.*)$/.exec(e);if(!t)return Ce(o),!1;var i=a.visualMode?`visual`:`normal`,l=t[2]||t[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==l&&(l=a.inputState.operatorShortcut);var u=Oe.matchCommand(l,r,a.inputState,i);return u.type==`none`?(Ce(o),!1):u.type==`partial`?(u.expectLiteralNext&&(a.expectLiteralNext=!0),!0):u.type==`clear`?(Ce(o),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,t=/^(\d*)(.*)$/.exec(e),t&&t[1]&&t[1]!=`0`&&a.inputState.pushRepeatDigit(t[1]),u.command)}var d=a.insertMode?l():u();if(d===!1)return!a.insertMode&&(n.length===1||e.isMac&&/<A-.>/.test(n))?function(){return!0}:void 0;if(d===!0)return function(){return!0};if(d)return function(){return o.operation(function(){o.curOp.isVimOp=!0;try{if(typeof d!=`object`)return;d.type==`keyToKey`?he(o,d.toKeys,d):Oe.processCommand(o,a,d)}catch(e){throw o.state.vim=void 0,oe(o),ue.suppressErrorLogging||console.log(e),e}return!0})}},handleEx:function(e,t){sn.processCommand(e,t)},defineMotion:Ae,defineAction:Pe,defineOperator:k,mapCommand:dn,_mapCommand:ln,defineRegister:Te,exitVisualMode:st,exitInsertMode:cn},de=[],fe=!1,pe;function me(e){if(!pe)throw Error(`No prompt to send key to`);if(e[0]==`<`){var t=e.toLowerCase().slice(1,-1);if(t=t.split(`-`).pop()||``,t==`lt`)e=`<`;else if(t==`space`)e=` `;else if(t==`cr`)e=`
|
|
39
|
+
`;else if(ve[t]){var n=pe.value||``,r={key:ve[t],target:{value:n,selectionEnd:n.length,selectionStart:n.length}};pe.onKeyDown&&pe.onKeyDown(r,pe.value,a),pe&&pe.onKeyUp&&pe.onKeyUp(r,pe.value,a);return}}if(e==`
|
|
40
|
+
`){var i=pe;pe=null,i.onClose&&i.onClose(i.value)}else pe.value=(pe.value||``)+e;function a(e){pe&&(typeof e==`string`?pe.value=e:pe=null)}}function he(e,t,n){var r=fe;if(n){if(de.indexOf(n)!=-1)return;de.push(n),fe=n.noremap!=0}try{for(var i=oe(e),a=/<(?:[CSMA]-)*\w+>|./gi,o;o=a.exec(t);){var s=o[0],c=i.insertMode;if(pe)me(s);else if(!ue.handleKey(e,s,`mapping`)&&c&&i.insertMode){if(s[0]==`<`){var l=s.toLowerCase().slice(1,-1);if(l=l.split(`-`).pop()||``,l==`lt`)s=`<`;else if(l==`space`)s=` `;else if(l==`cr`)s=`
|
|
41
|
+
`;else if(ve.hasOwnProperty(l)){s=ve[l],xn(e,s);continue}else s=s[0],a.lastIndex=o.index+1}e.replaceSelection(s)}}}finally{if(de.pop(),fe=de.length?r:!1,!de.length&&pe){var u=pe;pe=null,Gt(e,u)}}}var ge={Return:`CR`,Backspace:`BS`,Delete:`Del`,Escape:`Esc`,Insert:`Ins`,ArrowLeft:`Left`,ArrowRight:`Right`,ArrowUp:`Up`,ArrowDown:`Down`,Enter:`CR`," ":`Space`},_e={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},ve={};`Left|Right|Up|Down|End|Home`.split(`|`).concat(Object.keys(ge)).forEach(function(e){ve[(ge[e]||``).toLowerCase()]=ve[e.toLowerCase()]=e});function ye(t,n){var r=t.key;if(!_e[r]){r.length>1&&r[0]==`n`&&(r=r.replace(`Numpad`,``)),r=ge[r]||r;var a=``;if(t.ctrlKey&&(a+=`C-`),t.altKey&&(a+=`A-`),t.metaKey&&(a+=`M-`),e.isMac&&a==`A-`&&r.length==1&&(a=a.slice(2)),(a||r.length>1)&&t.shiftKey&&(a+=`S-`),n&&!n.expectLiteralNext&&r.length==1){if(s.keymap&&r in s.keymap)(s.remapCtrl!=0||!a)&&(r=s.keymap[r]);else if(r.charCodeAt(0)>128&&!i[r]){var o=t.code?.slice(-1)||``;t.shiftKey||(o=o.toLowerCase()),o&&(r=o,!a&&t.altKey&&(a=`A-`))}}return a+=r,a.length>1&&(a=`<`+a+`>`),a}}function be(e,t){s.string!==e&&(s=xe(e)),s.remapCtrl=t}function xe(e){let t={};if(!e)return{keymap:t,string:``};function n(e){return e.split(/\\?(.)/).filter(Boolean)}return e.split(/((?:[^\\,]|\\.)+),/).map(e=>{if(!e)return;let r=e.split(/((?:[^\\;]|\\.)+);/);if(r.length==3){let e=n(r[1]),i=n(r[2]);if(e.length!==i.length)return;for(let n=0;n<e.length;++n)t[e[n]]=i[n]}else if(r.length==1){let r=n(e);if(r.length%2!=0)return;for(let e=0;e<r.length;e+=2)t[r[e]]=r[e+1]}}),{keymap:t,string:e}}E(`langmap`,void 0,`string`,[`lmap`],function(e,t){if(e===void 0)return s.string;be(e)});class Se{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)}getRepeat(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(``),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(``),10))),e}}function Ce(t,n){t.state.vim.inputState=new Se,t.state.vim.expectLiteralNext=!1,e.signal(t,`vim-command-done`,n)}function we(){this.removed=[],this.inserted=``}class O{constructor(e,t,n){this.clear(),this.keyBuffer=[e||``],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}setText(e,t,n){this.keyBuffer=[e||``],this.linewise=!!t,this.blockwise=!!n}pushText(e,t){t&&(this.linewise||this.keyBuffer.push(`
|
|
42
|
+
`),this.linewise=!0),this.keyBuffer.push(e)}pushInsertModeChanges(e){this.insertModeChanges.push(ie(e))}pushSearchQuery(e){this.searchQueries.push(e)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join(``)}}function Te(e,t){var n=D.registerController.registers;if(!e||e.length!=1)throw Error(`Register name must be 1 character`);if(n[e])throw Error(`Register already defined `+e);n[e]=t,h.push(e)}class Ee{constructor(e){this.registers=e,this.unnamedRegister=e[`"`]=new O,e[`.`]=new O,e[`:`]=new O,e[`/`]=new O,e[`+`]=new O}pushText(e,t,n,r,i){if(e!==`_`){r&&n.charAt(n.length-1)!==`
|
|
43
|
+
`&&(n+=`
|
|
44
|
+
`);var a=this.isValidRegister(e)?this.getRegister(e):null;if(!a||!e){switch(t){case`yank`:this.registers[0]=new O(n,r,i);break;case`delete`:case`change`:n.indexOf(`
|
|
45
|
+
`)==-1?this.registers[`-`]=new O(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new O(n,r))}this.unnamedRegister.setText(n,r,i)}else S(e)?a.pushText(n,r):a.setText(n,r,i),e===`+`&&navigator.clipboard.writeText(n),this.unnamedRegister.setText(a.toString(),r)}}getRegister(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new O),this.registers[e]):this.unnamedRegister}isValidRegister(e){return e&&(T(e,h)||g.test(e))}shiftNumericRegisters_(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(``+(e-1))}}class De{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(e,t){var n=this.historyBuffer,r=t?-1:1;this.initialPrefix===null&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i<n.length;i+=r)for(var a=n[i],o=0;o<=a.length;o++)if(this.initialPrefix==a.substring(0,o))return this.iterator=i,a;if(i>=n.length)return this.iterator=n.length,this.initialPrefix;if(i<0)return e}pushInput(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Oe={matchCommand:function(e,t,n,r){var i=Re(e,t,r,n),a=i.full[0];if(!a)return i.partial.length?{type:`partial`,expectLiteralNext:i.partial.length==1&&i.partial[0].keys.slice(-11)==`<character>`}:{type:`none`};if(a.keys.slice(-11)==`<character>`||a.keys.slice(-10)==`<register>`){var o=Be(e);if(!o||o.length>1)return{type:`clear`};n.selectedCharacter=o}return{type:`full`,command:a}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case`motion`:this.processMotion(e,t,n);break;case`operator`:this.processOperator(e,t,n);break;case`operatorMotion`:this.processOperatorMotion(e,t,n);break;case`action`:this.processAction(e,t,n);break;case`search`:this.processSearch(e,t,n);break;case`ex`:case`keyToEx`:this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=Ie(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator){r.motion=`expandToLine`,r.motionArgs={linewise:!0,repeat:1},this.evalInput(e,t);return}Ce(e)}r.operator=n.operator,r.operatorArgs=Ie(n.operatorArgs),n.keys.length>1&&(r.operatorShortcut=n.keys),n.exitVisualBlock&&(t.visualBlock=!1,it(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=Ie(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),a=!!i,o=Ie(n.actionArgs)||{repeat:1};r.selectedCharacter&&(o.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),o.repeat=i||1,o.repeatIsExplicit=a,o.registerName=r.registerName,Ce(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),Ne[n.action](e,o,t)},processSearch:function(t,n,r){if(!t.getSearchCursor)return;var i=r.searchArgs.forward,a=r.searchArgs.wholeWordOnly;jt(t).setReversed(!i);var o=i?`/`:`?`,s=jt(t).getQuery(),c=t.getScrollInfo(),l=``;function u(e,i,a){D.searchHistoryController.pushInput(e),D.searchHistoryController.reset();try{qt(t,e,i,a)}catch{Ut(t,`Invalid regex: `+e),Ce(t);return}Oe.processMotion(t,n,{keys:``,type:`motion`,motion:`findNext`,motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function d(e){t.scrollTo(c.left,c.top),u(e,!0,!0);var n=D.macroModeState;n.isRecording&&hn(n,e)}function f(){return ne(`pcre`)?`(JavaScript regexp: set pcre)`:`(Vim regexp: set nopcre)`}function p(e,t,n){var r=ye(e),i,a;r==`<Up>`||r==`<Down>`?(i=r==`<Up>`,a=e.target?e.target.selectionEnd:0,t=D.searchHistoryController.nextMatch(t,i)||``,n(t),a&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(a,e.target.value.length))):r&&r!=`<Left>`&&r!=`<Right>`&&D.searchHistoryController.reset(),l=t,m()}function m(){var e;try{e=qt(t,l,!0,!0)}catch{}e?t.scrollIntoView(Zt(t,!i,e),30):($t(t),t.scrollTo(c.left,c.top))}function h(n,r,i){var a=ye(n);a==`<Esc>`||a==`<C-c>`||a==`<C-[>`||a==`<BS>`&&r==``?(D.searchHistoryController.pushInput(r),D.searchHistoryController.reset(),qt(t,s?.source||``),$t(t),t.scrollTo(c.left,c.top),e.e_stop(n),Ce(t),i(),t.focus()):a==`<Up>`||a==`<Down>`?e.e_stop(n):a==`<C-u>`&&(e.e_stop(n),i(``))}switch(r.searchArgs.querySrc){case`prompt`:var g=D.macroModeState;g.isPlaying?u(g.replaySearchQueries.shift()||``,!0,!1):Gt(t,{onClose:d,prefix:o,desc:Ht(`span`,{$cursor:`pointer`,onmousedown:function(e){e.preventDefault(),te(`pcre`,!ne(`pcre`)),this.textContent=f(),m()}},f()),onKeyUp:p,onKeyDown:h});break;case`wordUnderCursor`:var _=dt(t,{noSymbol:!0}),v=!0;if(_||(_=dt(t,{noSymbol:!1}),v=!1),!_){Ut(t,`No word under cursor`),Ce(t);return}let e=t.getLine(_.start.line).substring(_.start.ch,_.end.ch);e=v&&a?`\\b`+e+`\\b`:Xe(e),D.jumpList.cachedCursor=t.getCursor(),t.setCursor(_.start),u(e,!0,!1)}},processEx:function(t,n,r){function i(e){D.exCommandHistoryController.pushInput(e),D.exCommandHistoryController.reset(),sn.processCommand(t,e),t.state.vim&&Ce(t),$t(t)}function a(n,r,i){var a=ye(n),o,s;(a==`<Esc>`||a==`<C-c>`||a==`<C-[>`||a==`<BS>`&&r==``)&&(D.exCommandHistoryController.pushInput(r),D.exCommandHistoryController.reset(),e.e_stop(n),Ce(t),$t(t),i(),t.focus()),a==`<Up>`||a==`<Down>`?(e.e_stop(n),o=a==`<Up>`,s=n.target?n.target.selectionEnd:0,r=D.exCommandHistoryController.nextMatch(r,o)||``,i(r),s&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(s,n.target.value.length))):a==`<C-u>`?(e.e_stop(n),i(``)):a&&a!=`<Left>`&&a!=`<Right>`&&D.exCommandHistoryController.reset()}function o(n,r){var i=new e.StringStream(r),a={};try{if(sn.parseInput_(t,i,a),a.commandName!=`s`){$t(t);return}var o=sn.matchCommand_(a.commandName);if(!o||(sn.parseCommandArgs_(i,a,o),!a.argString))return;var s=Vt(a.argString.slice(1),!0,!0);s&&Xt(t,s)}catch{}}if(r.type==`keyToEx`)sn.processCommand(t,r.exArgs.input);else{var s={onClose:i,onKeyDown:a,onKeyUp:o,prefix:`:`};if(n.visualMode)s.value=`'<,'>`,s.selectValueOnOpen=!1;else{var c=n.inputState.getRepeat();c>1&&(s.value=`.,.+`+(c-1),s.selectValueOnOpen=!1)}Gt(t,s)}},evalInput:function(e,r){var i=r.inputState,a=i.motion,o=i.motionArgs||{repeat:1},s=i.operator,c=i.operatorArgs||{},l=i.registerName,u=r.sel,d=He(r.visualMode?Fe(e,u.head):e.getCursor(`head`)),f=He(r.visualMode?Fe(e,u.anchor):e.getCursor(`anchor`)),p=He(d),m=He(f),h,g,_;if(s&&this.recordLastEdit(r,i),_=i.repeatOverride===void 0?i.getRepeat():i.repeatOverride,_>0&&o.explicitRepeat?o.repeatIsExplicit=!0:(o.noRepeat||!o.explicitRepeat&&_===0)&&(_=1,o.repeatIsExplicit=!1),i.selectedCharacter&&(o.selectedCharacter=c.selectedCharacter=i.selectedCharacter),o.repeat=_,Ce(e),a){var v=ke[a](e,d,o,r,i);if(r.lastMotion=ke[a],!v)return;if(o.toJumplist){var y=D.jumpList,b=y.cachedCursor;b?(pt(e,b,v),delete y.cachedCursor):pt(e,d,v)}v instanceof Array?(g=v[0],h=v[1]):h=v,h||=He(d),r.visualMode?(r.visualBlock&&h.ch===1/0||(h=Fe(e,h,p)),g&&=Fe(e,g),g||=m,u.anchor=g,u.head=h,it(e),Ct(e,r,`<`,We(g,h)?g:h),Ct(e,r,`>`,We(g,h)?h:g)):s||(h=Fe(e,h,p),e.setCursor(h.line,h.ch))}if(s){if(c.lastSel){g=m;var x=c.lastSel,S=Math.abs(x.head.line-x.anchor.line),C=Math.abs(x.head.ch-x.anchor.ch);h=x.visualLine?new t(m.line+S,m.ch):x.visualBlock?new t(m.line+S,m.ch+C):x.head.line==x.anchor.line?new t(m.line,m.ch+C):new t(m.line+S,m.ch),r.visualMode=!0,r.visualLine=x.visualLine,r.visualBlock=x.visualBlock,u=r.sel={anchor:g,head:h},it(e)}else r.visualMode&&(c.lastSel={anchor:He(u.anchor),head:He(u.head),visualBlock:r.visualBlock,visualLine:r.visualLine});var w,T,ee,E,te;if(r.visualMode){w=Ge(u.head,u.anchor),T=Ke(u.head,u.anchor),ee=r.visualLine||c.linewise,E=r.visualBlock?`block`:ee?`line`:`char`;var ne=n(e,w,T);if(te=at(e,{anchor:ne.start,head:ne.end},E),ee){var re=te.ranges;if(E==`block`)for(var ie=0;ie<re.length;ie++)re[ie].head.ch=Je(e,re[ie].head.line);else E==`line`&&(re[0].head=new t(re[0].head.line+1,0))}}else{if(w=He(g||m),T=He(h||p),We(T,w)){var ae=w;w=T,T=ae}ee=o.linewise||c.linewise,ee?lt(e,w,T):o.forward&&ct(e,w,T),E=`char`;var oe=!o.inclusive||ee,ne=n(e,w,T);te=at(e,{anchor:ne.start,head:ne.end},E,oe)}e.setSelections(te.ranges,te.primary),r.lastMotion=null,c.repeat=_,c.registerName=l,c.linewise=ee;var se=Me[s](e,c,te.ranges,m,h);r.visualMode&&st(e,se!=null),se&&e.setCursor(se)}},recordLastEdit:function(e,t,n){var r=D.macroModeState;r.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,r.lastInsertModeChanges.changes=[],r.lastInsertModeChanges.expectCursorActivityForChange=!1,r.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},ke={moveToTopLine:function(e,n,r){var i=tn(e).top+r.repeat-1;return new t(i,ut(e.getLine(i)))},moveToMiddleLine:function(e){var n=tn(e),r=Math.floor((n.top+n.bottom)*.5);return new t(r,ut(e.getLine(r)))},moveToBottomLine:function(e,n,r){var i=tn(e).bottom-r.repeat+1;return new t(i,ut(e.getLine(i)))},expandToLine:function(e,n,r){return new t(n.line+r.repeat-1,1/0)},findNext:function(e,t,n){var r=jt(e),i=r.getQuery();if(i){var a=!n.forward;a=r.isReversed()?!a:a,Xt(e,i);var o=Zt(e,a,i,n.repeat);return o||Ut(e,`No match found `+i+(ne(`pcre`)?` (set nopcre to use Vim regexps)`:``)),o}},findAndSelectNextInclusive:function(n,r,i,a,o){var s=jt(n),c=s.getQuery();if(c){var l=!i.forward;l=s.isReversed()?!l:l;var u=Qt(n,l,c,i.repeat,a);if(u){if(o.operator)return u;var d=u[0],f=new t(u[1].line,u[1].ch-1);if(a.visualMode){(a.visualLine||a.visualBlock)&&(a.visualLine=!1,a.visualBlock=!1,e.signal(n,`vim-mode-change`,{mode:`visual`,subMode:``}));var p=a.sel.anchor;if(p)return s.isReversed()?i.forward?[p,d]:[p,f]:i.forward?[p,f]:[p,d]}else a.visualMode=!0,a.visualLine=!1,a.visualBlock=!1,e.signal(n,`vim-mode-change`,{mode:`visual`,subMode:``});return l?[f,d]:[d,f]}}},goToMark:function(e,t,n,r){var i=nn(e,r,n.selectedCharacter||``);return i?n.linewise?{line:i.line,ch:ut(e.getLine(i.line))}:i:null},moveToOtherHighlightedEnd:function(e,n,r,i){var a=i.sel;return i.visualBlock&&r.sameLine?[Fe(e,new t(a.anchor.line,a.head.ch)),Fe(e,new t(a.head.line,a.anchor.ch))]:[a.head,a.anchor]},jumpToMark:function(e,n,r,i){for(var a=n,o=0;o<r.repeat;o++){var s=a;for(var c in i.marks)if(y(c)){var l=i.marks[c].find();if(!(r.forward?We(l,s):We(s,l))&&!(r.linewise&&l.line==s.line)){var u=Ue(s,a),d=r.forward?qe(s,l,a):qe(a,l,s);(u||d)&&(a=l)}}}return r.linewise&&(a=new t(a.line,ut(e.getLine(a.line)))),a},moveByCharacters:function(e,n,r){var i=n,a=r.repeat,o=r.forward?i.ch+a:i.ch-a;return new t(i.line,o)},moveByLines:function(e,n,r,i){var a=n,o=a.ch;switch(i.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:o=i.lastHPos;break;default:i.lastHPos=o}var s=r.repeat+(r.repeatOffset||0),c=r.forward?a.line+s:a.line-s,l=e.firstLine(),u=e.lastLine(),d=e.findPosV(a,r.forward?s:-s,`line`,i.lastHSPos);return(r.forward?d.line>c:d.line<c)&&(c=d.line,o=d.ch),c<l&&a.line==l?this.moveToStartOfLine(e,n,r,i):c>u&&a.line==u?bt(e,n,r,i,!0):(r.toFirstChar&&(o=ut(e.getLine(c)),i.lastHPos=o),i.lastHSPos=e.charCoords(new t(c,o),`div`).left,new t(c,o))},moveByDisplayLines:function(e,t,n,r){var i=t;switch(r.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:r.lastHSPos=e.charCoords(i,`div`).left}for(var a=Math.round(n.repeat),o=0;o<a;o++){var s=e.findPosV(i,n.forward?1:-1,`line`,r.lastHSPos);if(s.hitSide)break;i=s}return i!=t&&(r.lastHPos=i.ch),i},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,`page`)},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return Tt(e,t,n.repeat,r).start},moveBySentence:function(e,t,n){var r=n.forward?1:-1;return Dt(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),a=null,o=n.repeat;o||=i.clientHeight/(2*e.defaultTextHeight());var s=e.charCoords(t,`local`);if(n.repeat=o,a=ke.moveByDisplayLines(e,t,n,r),!a)return null;var c=e.charCoords(a,`local`);return e.scrollTo(null,i.top+c.top-s.top),a},moveByWords:function(e,t,n){return yt(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=n.repeat,i=xt(e,r,n.forward,n.selectedCharacter,t),a=n.forward?-1:1;return mt(a,n),i?(i.ch+=a,i):null},moveToCharacter:function(e,t,n){var r=n.repeat;return mt(0,n),xt(e,r,n.forward,n.selectedCharacter,t)||t},moveToSymbol:function(e,t,n){var r=n.repeat;return n.selectedCharacter&&_t(e,r,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,`div`).left,St(e,i)},moveToEol:function(e,t,n,r){return bt(e,t,n,r,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,n){var r=n;return new t(r.line,ut(e.getLine(r.line)))},moveToMatchedSymbol:function(e,n){for(var r=n,i=r.line,a=r.ch,o=e.getLine(i),s;a<o.length;a++)if(s=o.charAt(a),s&&b(s)){var c=e.getTokenTypeAt(new t(i,a+1));if(c!==`string`&&c!==`comment`)break}if(a<o.length){var l=s===`<`||s===`>`?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new t(i,a),{bracketRegex:l}).to}return r},moveToStartOfLine:function(e,n){return new t(n.line,0)},moveToLineOrEdgeOfDocument:function(e,n,r){var i=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(i=r.repeat-e.getOption(`firstLineNumber`)),new t(i,ut(e.getLine(i)))},moveToStartOfDisplayLine:function(e){return e.execCommand(`goLineLeft`),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand(`goLineRight`);var t=e.getCursor();return t.sticky==`before`&&t.ch--,t},textObjectManipulation:function(e,t,n,r){var i={"(":`)`,")":`(`,"{":`}`,"}":`{`,"[":`]`,"]":`[`,"<":`>`,">":`<`},a={"'":!0,'"':!0,"`":!0},o=n.selectedCharacter||``;o==`b`?o=`(`:o==`B`&&(o=`{`);var s=!n.textObjectInner,c,l;if(i[o]){if(l=!0,c=Ot(e,t,o,s),!c){var u=e.getSearchCursor(RegExp(`\\`+o,`g`),t);u.find()&&(c=Ot(e,u.from(),o,s))}}else if(a[o])l=!0,c=kt(e,t,o,s);else if(o===`W`||o===`w`)for(var d=n.repeat||1;d-->0;){var f=dt(e,{inclusive:s,innerWord:!s,bigWord:o===`W`,noSymbol:o===`W`,multiline:!0},c&&c.end);f&&(c||=f,c.end=f.end)}else if(o===`p`){if(c=Tt(e,t,n.repeat,0,s),n.linewise=!0,r.visualMode)r.visualLine||=!0;else{var p=r.inputState.operatorArgs;p&&(p.linewise=!0),c.end.line--}}else if(o===`t`)c=ft(e,t,s);else if(o===`s`){var m=e.getLine(t.line);t.ch>0&&w(m[t.ch])&&--t.ch;var h=Et(e,t,n.repeat,1,s),g=Et(e,t,n.repeat,-1,s);C(e.getLine(g.line)[g.ch])&&C(e.getLine(h.line)[h.ch-1])&&(g={line:g.line,ch:g.ch+1}),c={start:g,end:h}}return c?e.state.vim.visualMode?rt(e,c.start,c.end,l):[c.start,c.end]:null},repeatLastCharacterSearch:function(e,t,n){var r=D.lastCharacterSearch,i=n.repeat,a=n.forward===r.forward,o=!!r.increment*(a?-1:1);n.inclusive=!!a;var s=xt(e,i,a,r.selectedCharacter,Le(t,0,-o));return s?(s.ch+=o,s):t}};function Ae(e,t){ke[e]=t}function je(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n}var Me={change:function(e,n,r){var i,a,o=e.state.vim,s=r[0].anchor,c=r[0].head;if(!o.visualMode){a=e.getRange(s,c);var l=o.lastEditInputState;if(l?.motion==`moveByWords`&&!C(a)){var u=/\s+$/.exec(a);u&&l.motionArgs&&l.motionArgs.forward&&(c=Le(c,0,-u[0].length),a=a.slice(0,-u[0].length))}n.linewise&&(s=new t(s.line,ut(e.getLine(s.line))),c.line>s.line&&(c=new t(c.line-1,Number.MAX_VALUE))),e.replaceRange(``,s,c),i=s}else if(n.fullLine)c.ch=Number.MAX_VALUE,c.line--,e.setSelection(s,c),a=e.getSelection(),e.replaceSelection(``),i=s;else{a=e.getSelection();var d=je(``,r.length);e.replaceSelections(d),i=Ge(r[0].head,r[0].anchor)}D.registerController.pushText(n.registerName,`change`,a,n.linewise,r.length>1),Ne.enterInsertMode(e,{head:i},e.state.vim)},delete:function(e,n,r){var i,a,o=e.state.vim;if(o.visualBlock){a=e.getSelection();var s=je(``,r.length);e.replaceSelections(s),i=Ge(r[0].head,r[0].anchor)}else{var c=r[0].anchor,l=r[0].head;n.linewise&&l.line!=e.firstLine()&&c.line==e.lastLine()&&c.line==l.line-1&&(c.line==e.firstLine()?c.ch=0:c=new t(c.line-1,Je(e,c.line-1))),a=e.getRange(c,l),e.replaceRange(``,c,l),i=c,n.linewise&&(i=ke.moveToFirstNonWhiteSpaceCharacter(e,c))}return D.registerController.pushText(n.registerName,`delete`,a,n.linewise,o.visualBlock),Fe(e,i)},indent:function(e,t,n){var r=e.state.vim,i=r.visualMode&&t.repeat||1;if(r.visualBlock){for(var a=e.getOption(`tabSize`),o=e.getOption(`indentWithTabs`)?` `:` `.repeat(a),s,c=n.length-1;c>=0;c--)if(s=Ge(n[c].anchor,n[c].head),t.indentRight)e.replaceRange(o.repeat(i),s,s);else{for(var l=e.getLine(s.line),u=0,d=0;d<i;d++){var f=l[s.ch+u];if(f==` `)u++;else if(f==` `){u++;for(var p=1;p<o.length&&(f=l[s.ch+u],f===` `);p++)u++}else break}e.replaceRange(``,s,Le(s,0,u))}return s}if(e.indentMore)for(var d=0;d<i;d++)t.indentRight?e.indentMore():e.indentLess();else{var m=n[0].anchor.line,h=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line;t.linewise&&h--;for(var c=m;c<=h;c++)for(var d=0;d<i;d++)e.indentLine(c,t.indentRight)}return ke.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},indentAuto:function(e,t,n){return e.execCommand(`indentAuto`),ke.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},hardWrap:function(e,n,r,i){if(e.hardWrap){var a=r[0].anchor.line,o=r[0].head.line;n.linewise&&o--;var s=e.hardWrap({from:a,to:o});return s>a&&n.linewise&&s--,n.keepCursor?i:new t(s,0)}},toggleComment:function(e,t,n,r,i){return e.execCommand(`toggleLineComment`),i},changeCase:function(e,t,n,r,i){for(var a=e.getSelections(),o=[],s=t.toLower,c=0;c<a.length;c++){var l=a[c],u=``;if(s===!0)u=l.toLowerCase();else if(s===!1)u=l.toUpperCase();else for(var d=0;d<l.length;d++){var f=l.charAt(d);u+=S(f)?f.toLowerCase():f.toUpperCase()}o.push(u)}return e.replaceSelections(o),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?ke.moveToFirstNonWhiteSpaceCharacter(e,r):t.linewise?r:Ge(n[0].anchor,n[0].head)},yank:function(e,t,n,r){var i=e.state.vim,a=e.getSelection(),o=i.visualMode?Ge(i.sel.anchor,i.sel.head,n[0].head,n[0].anchor):r;return D.registerController.pushText(t.registerName,`yank`,a,t.linewise,i.visualBlock),Ut(e,(Math.abs(e.getCursor(`end`).line-e.getCursor(`start`).line)||1)+` lines yanked`+(t.registerName?` into "`+t.registerName:``),!1,1500),o},rot13:function(e,t,n,r,i){for(var a=e.getSelections(),o=[],s=0;s<a.length;s++){let e=a[s].split(``).map(e=>{let t=e.charCodeAt(0);return t>=65&&t<=90?String.fromCharCode(65+(t-65+13)%26):t>=97&&t<=122?String.fromCharCode(97+(t-97+13)%26):e}).join(``);o.push(e)}return e.replaceSelections(o),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?ke.moveToFirstNonWhiteSpaceCharacter(e,r):t.linewise?r:Ge(n[0].anchor,n[0].head)}};function k(e,t){Me[e]=t}var Ne={jumpListWalk:function(e,t,n){if(!n.visualMode){var r=t.repeat||1,i=t.forward,a=D.jumpList.move(e,i?r:-r),o=a?a.find():void 0;o||=e.getCursor(),e.setCursor(o)}},scroll:function(e,t,n){if(!n.visualMode){var r=t.repeat||1,i=e.defaultTextHeight(),a=e.getScrollInfo().top,o=i*r,s=t.forward?a+o:a-o,c=He(e.getCursor()),l=e.charCoords(c,`local`);if(t.forward)s>l.top?(c.line+=(s-l.top)/i,c.line=Math.ceil(c.line),e.setCursor(c),l=e.charCoords(c,`local`),e.scrollTo(null,l.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<l.bottom?(c.line-=(l.bottom-u)/i,c.line=Math.floor(c.line),e.setCursor(c),l=e.charCoords(c,`local`),e.scrollTo(null,l.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,n){var r=e.getCursor().line,i=e.charCoords(new t(r,0),`local`),a=e.getScrollInfo().clientHeight,o=i.top;switch(n.position){case`center`:o=i.bottom-a/2;break;case`bottom`:var s=new t(r,e.getLine(r).length-1),c=e.charCoords(s,`local`).bottom-o;o=o-a+c}e.scrollTo(null,o)},replayMacro:function(e,t,n){var r=t.selectedCharacter||``,i=t.repeat||1,a=D.macroModeState;for(r==`@`?r=a.latestRegister||``:a.latestRegister=r;i--;)fn(e,n,a,r)},enterMacroRecordMode:function(e,t){var n=D.macroModeState,r=t.selectedCharacter;D.registerController.isValidRegister(r)&&n.enterMacroRecordMode(e,r)},toggleOverwrite:function(t){t.state.overwrite?(t.toggleOverwrite(!1),t.setOption(`keyMap`,`vim-insert`),e.signal(t,`vim-mode-change`,{mode:`insert`})):(t.toggleOverwrite(!0),t.setOption(`keyMap`,`vim-replace`),e.signal(t,`vim-mode-change`,{mode:`replace`}))},enterInsertMode:function(r,i,a){if(!r.getOption(`readOnly`)){a.insertMode=!0,a.insertModeRepeat=i&&i.repeat||1;var o=i?i.insertAt:null,s=a.sel,c=i.head||r.getCursor(`head`),l=r.listSelections().length;if(o==`eol`)c=new t(c.line,Je(r,c.line));else if(o==`bol`)c=new t(c.line,0);else if(o==`charAfter`){var u=n(r,c,Le(c,0,1));c=u.end}else if(o==`firstNonBlank`){var u=n(r,c,ke.moveToFirstNonWhiteSpaceCharacter(r,c));c=u.end}else if(o==`startOfSelectedArea`){if(!a.visualMode)return;a.visualBlock?(c=new t(Math.min(s.head.line,s.anchor.line),Math.min(s.head.ch,s.anchor.ch)),l=Math.abs(s.head.line-s.anchor.line)+1):c=s.head.line<s.anchor.line?s.head:new t(s.anchor.line,0)}else if(o==`endOfSelectedArea`){if(!a.visualMode)return;a.visualBlock?(c=new t(Math.min(s.head.line,s.anchor.line),Math.max(s.head.ch,s.anchor.ch)+1),l=Math.abs(s.head.line-s.anchor.line)+1):c=s.head.line>=s.anchor.line?Le(s.head,0,1):new t(s.anchor.line,0)}else if(o==`inplace`){if(a.visualMode)return}else o==`lastEdit`&&(c=rn(r)||c);r.setOption(`disableInput`,!1),i&&i.replace?(r.toggleOverwrite(!0),r.setOption(`keyMap`,`vim-replace`),e.signal(r,`vim-mode-change`,{mode:`replace`})):(r.toggleOverwrite(!1),r.setOption(`keyMap`,`vim-insert`),e.signal(r,`vim-mode-change`,{mode:`insert`})),D.macroModeState.isPlaying||(r.on(`change`,gn),a.insertEnd&&a.insertEnd.clear(),a.insertEnd=r.setBookmark(c,{insertLeft:!0}),e.on(r.getInputField(),`keydown`,yn)),a.visualMode&&st(r),$e(r,c,l)}},toggleVisualMode:function(r,i,a){var o=i.repeat,s=r.getCursor(),c;if(a.visualMode)a.visualLine!=!!i.linewise||a.visualBlock!=!!i.blockwise?(a.visualLine=!!i.linewise,a.visualBlock=!!i.blockwise,e.signal(r,`vim-mode-change`,{mode:`visual`,subMode:a.visualLine?`linewise`:a.visualBlock?`blockwise`:``}),it(r)):st(r);else{a.visualMode=!0,a.visualLine=!!i.linewise,a.visualBlock=!!i.blockwise,c=Fe(r,new t(s.line,s.ch+o-1));var l=n(r,s,c);a.sel={anchor:l.start,head:l.end},e.signal(r,`vim-mode-change`,{mode:`visual`,subMode:a.visualLine?`linewise`:a.visualBlock?`blockwise`:``}),it(r),Ct(r,a,`<`,Ge(s,c)),Ct(r,a,`>`,Ke(s,c))}},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&nt(t,r),i){var a=i.anchorMark.find(),o=i.headMark.find();if(!a||!o)return;r.sel={anchor:a,head:o},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock,it(t),Ct(t,r,`<`,Ge(a,o)),Ct(t,r,`>`,Ke(a,o)),e.signal(t,`vim-mode-change`,{mode:`visual`,subMode:r.visualLine?`linewise`:r.visualBlock?`blockwise`:``})}},joinLines:function(e,n,r){var i,a;if(r.visualMode){if(i=e.getCursor(`anchor`),a=e.getCursor(`head`),We(a,i)){var o=a;a=i,i=o}a.ch=Je(e,a.line)-1}else{var s=Math.max(n.repeat,2);i=e.getCursor(),a=Fe(e,new t(i.line+s-1,1/0))}for(var c=0,l=i.line;l<a.line;l++){c=Je(e,i.line);var u=``,d=0;if(!n.keepSpaces){var f=e.getLine(i.line+1);d=f.search(/\S/),d==-1?d=f.length:u=` `}e.replaceRange(u,new t(i.line,c),new t(i.line+1,d))}var p=Fe(e,new t(i.line,c));r.visualMode&&st(e,!1),e.setCursor(p)},newLineAndEnterInsertMode:function(n,r,i){i.insertMode=!0;var a=He(n.getCursor());a.line===n.firstLine()&&!r.after?(n.replaceRange(`
|
|
46
|
+
`,new t(n.firstLine(),0)),n.setCursor(n.firstLine(),0)):(a.line=r.after?a.line:a.line-1,a.ch=Je(n,a.line),n.setCursor(a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(n)),this.enterInsertMode(n,{repeat:r.repeat},i)},paste:function(e,t,n){var r=D.registerController.getRegister(t.registerName);if(t.registerName===`+`)navigator.clipboard.readText().then(i=>{this.continuePaste(e,t,n,i,r)});else{var i=r.toString();this.continuePaste(e,t,n,i,r)}},continuePaste:function(e,n,r,i,a){var o=He(e.getCursor());if(i){if(n.matchIndent){var s=e.getOption(`tabSize`),c=function(e){var t=e.split(` `).length-1,n=e.split(` `).length-1;return t*s+n*1},l=c(e.getLine(e.getCursor().line).match(/^\s*/)[0]),u=i.replace(/\n$/,``),d=i!==u,f=c(i.match(/^\s*/)[0]),i=u.replace(/^\s*/gm,function(t){var n=l+(c(t)-f);if(n<0)return``;if(e.getOption(`indentWithTabs`)){var r=Math.floor(n/s);return Array(r+1).join(` `)}return Array(n+1).join(` `)});i+=d?`
|
|
47
|
+
`:``}n.repeat>1&&(i=Array(n.repeat+1).join(i));var p=n.linewise==null?a.linewise:n.linewise,m=a.blockwise,h=m?i.split(`
|
|
48
|
+
`):void 0;if(h){p&&h.pop();for(var g=0;g<h.length;g++)h[g]=h[g]==``?` `:h[g];o.ch+=+!!n.after,o.ch=Math.min(Je(e,o.line),o.ch)}else p?r.visualMode?i=r.visualLine?i.slice(0,-1):`
|
|
49
|
+
`+i.slice(0,i.length-1)+`
|
|
50
|
+
`:n.after?(i=`
|
|
51
|
+
`+i.slice(0,i.length-1),o.ch=Je(e,o.line)):o.ch=0:o.ch+=+!!n.after;var _;if(r.visualMode){r.lastPastedText=i;var v,y=tt(e,r),b=y[0],x=y[1],S=e.getSelection(),C=e.listSelections(),w=Array(C.length).join(`1`).split(`1`);r.lastSelection&&(v=r.lastSelection.headMark.find()),D.registerController.unnamedRegister.setText(S),m?(e.replaceSelections(w),x=new t(b.line+i.length-1,b.ch),e.setCursor(b),Qe(e,x),e.replaceSelections(i),_=b):r.visualBlock?(e.replaceSelections(w),e.setCursor(b),e.replaceRange(i,b,b),_=b):(e.replaceRange(i,b,x),_=e.posFromIndex(e.indexFromPos(b)+i.length-1)),v&&(r.lastSelection.headMark=e.setBookmark(v)),p&&(_.ch=0)}else if(m&&h){e.setCursor(o);for(var g=0;g<h.length;g++){var T=o.line+g;T>e.lastLine()&&e.replaceRange(`
|
|
52
|
+
`,new t(T,0)),Je(e,T)<o.ch&&Ze(e,T,o.ch)}e.setCursor(o),Qe(e,new t(o.line+h.length-1,o.ch)),e.replaceSelections(h),_=o}else if(e.replaceRange(i,o),p){var T=n.after?o.line+1:o.line;_=new t(T,ut(e.getLine(T)))}else _=He(o),/\n/.test(i)||(_.ch+=i.length-+!!n.after);r.visualMode&&st(e,!1),e.setCursor(_)}},undo:function(t,n){t.operation(function(){Ve(t,e.commands.undo,n.repeat)(),t.setCursor(Fe(t,t.getCursor(`start`)))})},redo:function(t,n){Ve(t,e.commands.redo,n.repeat)()},setRegister:function(e,t,n){n.inputState.registerName=t.selectedCharacter},insertRegister:function(e,t,n){var r=t.selectedCharacter,i=D.registerController.getRegister(r),a=i&&i.toString();a&&e.replaceSelection(a)},oneNormalCommand:function(t,n,r){cn(t,!0),r.insertModeReturn=!0,e.on(t,`vim-command-done`,function n(){r.visualMode||(r.insertModeReturn&&(r.insertModeReturn=!1,r.insertMode||Ne.enterInsertMode(t,{},r)),e.off(t,`vim-command-done`,n))})},setMark:function(e,t,n){var r=t.selectedCharacter;r&&Ct(e,n,r,e.getCursor())},replace:function(r,i,a){var o=i.selectedCharacter||``,s=r.getCursor(),c,l,u=r.listSelections();if(a.visualMode)s=r.getCursor(`start`),l=r.getCursor(`end`);else{var d=r.getLine(s.line);c=s.ch+i.repeat,c>d.length&&(c=d.length),l=new t(s.line,c)}var f=n(r,s,l);if(s=f.start,l=f.end,o==`
|
|
53
|
+
`)a.visualMode||r.replaceRange(``,s,l),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(r);else{var p=r.getRange(s,l);if(p=p.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o),p=p.replace(/[^\n]/g,o),a.visualBlock){var m=Array(r.getOption(`tabSize`)+1).join(` `);p=r.getSelection(),p=p.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o);var h=p.replace(/\t/g,m).replace(/[^\n]/g,o).split(`
|
|
54
|
+
`);r.replaceSelections(h)}else r.replaceRange(p,s,l);a.visualMode?(s=We(u[0].anchor,u[0].head)?u[0].anchor:u[0].head,r.setCursor(s),st(r,!1)):r.setCursor(Le(l,0,-1))}},incrementNumberToken:function(e,n){for(var r=e.getCursor(),i=e.getLine(r.line),a=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,o,s,c,l;(o=a.exec(i))!==null&&(s=o.index,c=s+o[0].length,!(r.ch<c)););if(!(!n.backtrack&&c<=r.ch)){if(o){var u=o[2]||o[4],d=o[3]||o[5],f=n.increase?1:-1,p={"0b":2,0:8,"":10,"0x":16}[u.toLowerCase()];l=(parseInt(o[1]+d,p)+f*n.repeat).toString(p);var m=u?Array(d.length-l.length+1+o[1].length).join(`0`):``;l=l.charAt(0)===`-`?`-`+u+m+l.substr(1):u+m+l;var h=new t(r.line,s),g=new t(r.line,c);e.replaceRange(l,h,g)}else return;e.setCursor(new t(r.line,s+l.length-1))}},repeatLastEdit:function(e,t,n){var r=n.lastEditInputState;if(r){var i=t.repeat;i&&t.repeatIsExplicit?r.repeatOverride=i:i=r.repeatOverride||i,bn(e,n,i,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:function(e,t){cn(e)}};function Pe(e,t){Ne[e]=t}function Fe(e,n,r){var i=e.state.vim,a=i.insertMode||i.visualMode,o=Math.min(Math.max(e.firstLine(),n.line),e.lastLine()),s=e.getLine(o),c=s.length-1+Number(!!a),l=Math.min(Math.max(0,n.ch),c),u=s.charCodeAt(l);if(56320<=u&&u<=57343){var d=1;r&&r.line==o&&r.ch>l&&(d=-1),l+=d,l>c&&(l-=2)}return new t(o,l)}function Ie(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Le(e,n,r){return typeof n==`object`&&(r=n.ch,n=n.line),new t(e.line+n,e.ch+r)}function Re(e,t,n,r){r.operator&&(n=`operatorPending`);for(var i,o=[],s=[],c=fe?t.length-a:0;c<t.length;c++){var l=t[c];n==`insert`&&l.context!=`insert`||l.context&&l.context!=n||r.operator&&l.type==`action`||!(i=ze(e,l.keys))||(i==`partial`&&o.push(l),i==`full`&&s.push(l))}return{partial:o,full:s}}function ze(e,t){let n=t.slice(-11)==`<character>`,r=t.slice(-10)==`<register>`;if(n||r){var i=t.length-(n?11:10),a=e.slice(0,i),o=t.slice(0,i);return a==o&&e.length>i?`full`:o.indexOf(a)==0&&`partial`}return e==t?`full`:t.indexOf(e)==0&&`partial`}function Be(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case`<CR>`:case`<S-CR>`:n=`
|
|
55
|
+
`;break;case`<Space>`:case`<S-Space>`:n=` `;break;default:n=``}return n}function Ve(e,t,n){return function(){for(var r=0;r<n;r++)t(e)}}function He(e){return new t(e.line,e.ch)}function Ue(e,t){return e.ch==t.ch&&e.line==t.line}function We(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function Ge(e,t){return arguments.length>2&&(t=Ge.apply(void 0,Array.prototype.slice.call(arguments,1))),We(e,t)?e:t}function Ke(e,t){return arguments.length>2&&(t=Ke.apply(void 0,Array.prototype.slice.call(arguments,1))),We(e,t)?t:e}function qe(e,t,n){var r=We(e,t),i=We(t,n);return r&&i}function Je(e,t){return e.getLine(t).length}function Ye(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function Xe(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,`\\$1`)}function Ze(e,n,r){var i=Je(e,n),a=Array(r-i+1).join(` `);e.setCursor(new t(n,i)),e.replaceRange(a,e.getCursor())}function Qe(e,n){var r=[],i=e.listSelections(),a=He(e.clipPos(n)),o=!Ue(n,a),s=et(i,e.getCursor(`head`)),c=Ue(i[s].head,i[s].anchor),l=i.length-1,u=l-s>s?l:0,d=i[u].anchor,f=Math.min(d.line,a.line),p=Math.max(d.line,a.line),m=d.ch,h=a.ch,g=i[u].head.ch-m,_=h-m;g>0&&_<=0?(m++,o||h--):g<0&&_>=0?(m--,c||h++):g<0&&_==-1&&(m--,h++);for(var v=f;v<=p;v++){var y={anchor:new t(v,m),head:new t(v,h)};r.push(y)}return e.setSelections(r),n.ch=h,d.ch=m,d}function $e(e,t,n){for(var r=[],i=0;i<n;i++){var a=Le(t,i,0);r.push({anchor:a,head:a})}e.setSelections(r,0)}function et(e,t,n){for(var r=0;r<e.length;r++){var i=n!=`head`&&Ue(e[r].anchor,t),a=n!=`anchor`&&Ue(e[r].head,t);if(i||a)return r}return-1}function tt(e,t){var n=e.listSelections(),r=n[0],i=n[n.length-1];return[We(r.anchor,r.head)?r.anchor:r.head,We(i.anchor,i.head)?i.head:i.anchor]}function nt(e,t){var n=t.sel.anchor,r=t.sel.head;t.lastPastedText&&=(r=e.posFromIndex(e.indexFromPos(n)+t.lastPastedText.length),void 0),t.lastSelection={anchorMark:e.setBookmark(n),headMark:e.setBookmark(r),anchor:He(n),head:He(r),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function rt(e,n,r,i){var a=e.state.vim.sel,o=i?n:a.head,s=i?n:a.anchor,c;return We(r,n)&&(c=r,r=n,n=c),We(o,s)?(o=Ge(n,o),s=Ke(s,r)):(s=Ge(n,s),o=Ke(o,r),o=Le(o,0,-1),o.ch==-1&&o.line!=e.firstLine()&&(o=new t(o.line-1,Je(e,o.line-1)))),[s,o]}function it(e,t,n){var r=e.state.vim;t||=r.sel,n||=r.visualLine?`line`:r.visualBlock?`block`:`char`;var i=at(e,t,n);e.setSelections(i.ranges,i.primary)}function at(e,n,r,i){var a=He(n.head),o=He(n.anchor);if(r==`char`){var s=+(!i&&!We(n.head,n.anchor)),c=+!!We(n.head,n.anchor);return a=Le(n.head,0,s),o=Le(n.anchor,0,c),{ranges:[{anchor:o,head:a}],primary:0}}if(r==`line`){if(We(n.head,n.anchor))a.ch=0,o.ch=Je(e,o.line);else{o.ch=0;var l=e.lastLine();a.line>l&&(a.line=l),a.ch=Je(e,a.line)}return{ranges:[{anchor:o,head:a}],primary:0}}if(r==`block`){var u=Math.min(o.line,a.line),d=o.ch,f=Math.max(o.line,a.line),p=a.ch;d<p?p+=1:d+=1;for(var m=f-u+1,h=a.line==u?0:m-1,g=[],_=0;_<m;_++)g.push({anchor:new t(u+_,d),head:new t(u+_,p)});return{ranges:g,primary:h}}throw`never happens`}function ot(e){var t=e.getCursor(`head`);return e.getSelection().length==1&&(t=Ge(t,e.getCursor(`anchor`))),t}function st(t,n){var r=t.state.vim;n!==!1&&t.setCursor(Fe(t,r.sel.head)),nt(t,r),r.visualMode=!1,r.visualLine=!1,r.visualBlock=!1,r.insertMode||e.signal(t,`vim-mode-change`,{mode:`normal`})}function ct(e,t,n){var r=e.getRange(t,n);if(/\n\s*$/.test(r)){var i=r.split(`
|
|
56
|
+
`);i.pop();for(var a=i.pop();i.length>0&&a&&C(a);a=i.pop())n.line--,n.ch=0;a?(n.line--,n.ch=Je(e,n.line)):n.ch=0}}function lt(e,t,n){t.ch=0,n.ch=0,n.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return t==-1?e.length:t}function dt(e,{inclusive:n,innerWord:r,bigWord:i,noSymbol:a,multiline:o},s){var c=s||ot(e),l=e.getLine(c.line),u=l,d=c.line,m=d,h=c.ch,g,_=a?f[0]:p[0];if(r&&/\s/.test(l.charAt(h)))_=function(e){return/\s/.test(e)};else{for(;!_(l.charAt(h));)if(h++,h>=l.length){if(!o)return null;h--,g=vt(e,c,!0,i,!0);break}i?_=p[0]:(_=f[0],_(l.charAt(h))||(_=f[1]))}for(var v=h,y=h;_(l.charAt(y))&&y>=0;)y--;if(y++,g)v=g.to,m=g.line,u=e.getLine(m),!u&&v==0&&v++;else for(;_(l.charAt(v))&&v<l.length;)v++;if(n){var b=v,x=c.ch<=y&&/\s/.test(l.charAt(c.ch));if(!x)for(;/\s/.test(u.charAt(v))&&v<u.length;)v++;if(b==v||x){for(var S=y;/\s/.test(l.charAt(y-1))&&y>0;)y--;!y&&!x&&(y=S)}}return{start:new t(d,y),end:new t(m,v)}}function ft(t,n,r){var i=n;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:i,end:i};var a=e.findMatchingTag(t,n)||e.findEnclosingTag(t,n);return!a||!a.open||!a.close?{start:i,end:i}:r?{start:a.open.from,end:a.close.to}:{start:a.open.to,end:a.close.from}}function pt(e,t,n){Ue(t,n)||D.jumpList.add(e,t,n)}function mt(e,t){D.lastCharacterSearch.increment=e,D.lastCharacterSearch.forward=t.forward,D.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var ht={"(":`bracket`,")":`bracket`,"{":`bracket`,"}":`bracket`,"[":`section`,"]":`section`,"*":`comment`,"/":`comment`,m:`method`,M:`method`,"#":`preprocess`},gt={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?`]`:`[`)===e.symb?`{`:`}`},isComplete:function(e){return e.index===0&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t=e.lastCh===`*`&&e.nextCh===`/`;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb=e.symb===`m`?`{`:`}`,e.reverseSymb=e.symb===`{`?`}`:`{`},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if(e.nextCh===`#`){var t=e.lineText.match(/^#(\w+)/)?.[1];if(t===`endif`){if(e.forward&&e.depth===0)return!0;e.depth++}else if(t===`if`){if(!e.forward&&e.depth===0)return!0;e.depth--}if(t===`else`&&e.depth===0)return!0}return!1}}};function _t(e,n,r,i){var a=He(e.getCursor()),o=r?1:-1,s=r?e.lineCount():-1,c=a.ch,l=a.line,u=e.getLine(l),d={lineText:u,nextCh:u.charAt(c),lastCh:null,index:c,symb:i,reverseSymb:(r?{")":`(`,"}":`{`}:{"(":`)`,"{":`}`})[i],forward:r,depth:0,curMoveThrough:!1},f=ht[i];if(!f)return a;var p=gt[f].init,m=gt[f].isComplete;for(p&&p(d);l!==s&&n;){if(d.index+=o,d.nextCh=d.lineText.charAt(d.index),!d.nextCh){if(l+=o,d.lineText=e.getLine(l)||``,o>0)d.index=0;else{var h=d.lineText.length;d.index=h>0?h-1:0}d.nextCh=d.lineText.charAt(d.index)}m(d)&&(a.line=l,a.ch=d.index,n--)}return d.nextCh||d.curMoveThrough?new t(l,d.index):a}function vt(e,t,n,r,i){var a=t.line,o=t.ch,s=e.getLine(a),c=n?1:-1,l=r?p:f;if(i&&s==``){if(a+=c,s=e.getLine(a),!v(e,a))return null;o=n?0:s.length}for(;;){if(i&&s==``)return{from:0,to:0,line:a};for(var u=c>0?s.length:-1,d=u,m=u;o!=u;){for(var h=!1,g=0;g<l.length&&!h;++g)if(l[g](s.charAt(o))){for(d=o;o!=u&&l[g](s.charAt(o));)o+=c;if(m=o,h=d!=m,d==t.ch&&a==t.line&&m==d+c)continue;return{from:Math.min(d,m+1),to:Math.max(d,m),line:a}}h||(o+=c)}if(a+=c,!v(e,a))return null;s=e.getLine(a),o=c>0?0:s.length}}function yt(e,n,r,i,a,o){var s=He(n),c=[];(i&&!a||!i&&a)&&r++;for(var l=!(i&&a),u=0;u<r;u++){var d=vt(e,n,i,o,l);if(!d){var f=Je(e,e.lastLine());c.push(i?{line:e.lastLine(),from:f,to:f}:{line:0,from:0,to:0});break}c.push(d),n=new t(d.line,i?d.to-1:d.from)}var p=c.length!=r,m=c[0],h=c.pop();return i&&!a?(!p&&(m.from!=s.ch||m.line!=s.line)&&(h=c.pop()),h&&new t(h.line,h.from)):i&&a?h&&new t(h.line,h.to-1):!i&&a?(!p&&(m.to!=s.ch||m.line!=s.line)&&(h=c.pop()),h&&new t(h.line,h.to)):h&&new t(h.line,h.from)}function bt(e,n,r,i,a){var o=new t(n.line+r.repeat-1,1/0),s=e.clipPos(o);return s.ch--,a||(i.lastHPos=1/0,i.lastHSPos=e.charCoords(s,`div`).left),o}function xt(e,n,r,i,a){if(i){for(var o=a||e.getCursor(),s=o.ch,c,l=0;l<n;l++){var u=e.getLine(o.line);if(c=wt(s,u,i,r,!0),c==-1)return;s=c}if(c!=null)return new t(e.getCursor().line,c)}}function St(e,n){var r=e.getCursor().line;return Fe(e,new t(r,n-1))}function Ct(e,t,n,r){(T(n,m)||g.test(n))&&(t.marks[n]&&t.marks[n].clear(),t.marks[n]=e.setBookmark(r))}function wt(e,t,n,r,i){var a;return r?(a=t.indexOf(n,e+1),a!=-1&&!i&&--a):(a=t.lastIndexOf(n,e-1),a!=-1&&!i&&(a+=1)),a}function Tt(e,n,r,i,a){var o=n.line,s=e.firstLine(),c=e.lastLine(),l,u,d=o;function f(t){return!e.getLine(t)}function p(e,t,n){return n?f(e)!=f(e+t):!f(e)&&f(e+t)}if(i){for(;s<=d&&d<=c&&r>0;)p(d,i)&&r--,d+=i;return{start:new t(d,0),end:n}}var m=e.state.vim;if(m.visualLine&&p(o,1,!0)){var h=m.sel.anchor;p(h.line,-1,!0)&&(!a||h.line!=o)&&(o+=1)}var g=f(o);for(d=o;d<=c&&r;d++)p(d,1,!0)&&(!a||f(d)!=g)&&r--;for(u=new t(d,0),d>c&&!g?g=!0:a=!1,d=o;d>s&&(a&&f(d)!=g&&d!=o||!p(d,-1,!0));d--);return l=new t(d,0),{start:l,end:u}}function Et(e,n,r,i,a){function o(e){e.line!==null&&(e.pos+e.dir<0||e.pos+e.dir>=e.line.length?e.line=null:e.pos+=e.dir)}function s(e,t,n,r){var i={line:e.getLine(t),ln:t,pos:n,dir:r};if(i.line===``)return{ln:i.ln,pos:i.pos};var s=i.pos;for(o(i);i.line!==null;){if(s=i.pos,w(i.line[i.pos])){if(a){for(o(i);i.line!==null&&C(i.line[i.pos]);)s=i.pos,o(i);return{ln:i.ln,pos:s+1}}return{ln:i.ln,pos:i.pos+1}}o(i)}return{ln:i.ln,pos:s+1}}function c(e,t,n,r){var i=e.getLine(t),s={line:i,ln:t,pos:n,dir:r};if(s.line===``)return{ln:s.ln,pos:s.pos};var c=s.pos;for(o(s);s.line!==null;){if(!C(s.line[s.pos])&&!w(s.line[s.pos]))c=s.pos;else if(w(s.line[s.pos]))return a&&C(s.line[s.pos+1])?{ln:s.ln,pos:s.pos+1}:{ln:s.ln,pos:c};o(s)}return s.line=i,a&&C(s.line[s.pos])?{ln:s.ln,pos:s.pos}:{ln:s.ln,pos:c}}for(var l={ln:n.line,pos:n.ch};r>0;)l=i<0?c(e,l.ln,l.pos,i):s(e,l.ln,l.pos,i),r--;return new t(l.ln,l.pos)}function Dt(e,n,r,i){function a(e,t){if(t.line!==null){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!v(e,t.ln)){t.line=null;return}t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}}function o(e,t,n,r){var i=e.getLine(t),o=i===``,s={line:i,ln:t,pos:n,dir:r},c={ln:s.ln,pos:s.pos},l=s.line===``;for(a(e,s);s.line!==null;){if(c.ln=s.ln,c.pos=s.pos,s.line===``&&!l||o&&s.line!==``&&!C(s.line[s.pos]))return{ln:s.ln,pos:s.pos};w(s.line[s.pos])&&!o&&(s.pos===s.line.length-1||C(s.line[s.pos+1]))&&(o=!0),a(e,s)}var i=e.getLine(c.ln);c.pos=0;for(var u=i.length-1;u>=0;--u)if(!C(i[u])){c.pos=u;break}return c}function s(e,t,n,r){var i=e.getLine(t),o={line:i,ln:t,pos:n,dir:r},s=o.ln,c=null,l=o.line===``;for(a(e,o);o.line!==null;){if(o.line===``&&!l)return c===null?{ln:o.ln,pos:o.pos}:{ln:s,pos:c};if(w(o.line[o.pos])&&c!==null&&(o.ln!==s||o.pos+1!==c))return{ln:s,pos:c};o.line!==``&&!C(o.line[o.pos])&&(l=!1,s=o.ln,c=o.pos),a(e,o)}var i=e.getLine(s);c=0;for(var u=0;u<i.length;++u)if(!C(i[u])){c=u;break}return{ln:s,pos:c}}for(var c={ln:n.line,pos:n.ch};r>0;)c=i<0?s(e,c.ln,c.pos,i):o(e,c.ln,c.pos,i),r--;return new t(c.ln,c.pos)}function Ot(e,n,r,i){var a=n,o={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],s={"(":`(`,")":`(`,"[":`[`,"]":`[`,"{":`{`,"}":`{`,"<":`<`,">":`<`}[r],c=+(e.getLine(a.line).charAt(a.ch)===s),l=e.scanForBracket(new t(a.line,a.ch+c),-1,void 0,{bracketRegex:o}),u=e.scanForBracket(new t(a.line,a.ch+c),1,void 0,{bracketRegex:o});if(!l||!u)return null;var d=l.pos,f=u.pos;if(d.line==f.line&&d.ch>f.ch||d.line>f.line){var p=d;d=f,f=p}return i?f.ch+=1:d.ch+=1,{start:d,end:f}}function kt(e,n,r,i){var a=He(n),o=e.getLine(a.line).split(``),s,c,l,u,d=o.indexOf(r);if(a.ch<d)a.ch=d;else if(d<a.ch&&o[a.ch]==r){var f=/string/.test(e.getTokenTypeAt(Le(n,0,1))),p=/string/.test(e.getTokenTypeAt(n));(!f||p)&&(c=a.ch,--a.ch)}if(o[a.ch]==r&&!c)s=a.ch+1;else for(l=a.ch;l>-1&&!s;l--)o[l]==r&&(s=l+1);if(s&&!c)for(l=s,u=o.length;l<u&&!c;l++)o[l]==r&&(c=l);return!s||!c?{start:a,end:a}:(i&&(--s,++c),{start:new t(a.line,s),end:new t(a.line,c)})}E(`pcre`,!0,`boolean`);class At{constructor(){this.highlightTimeout}getQuery(){return D.query}setQuery(e){D.query=e}getOverlay(){return this.searchOverlay}setOverlay(e){this.searchOverlay=e}isReversed(){return D.isReversed}setReversed(e){D.isReversed=e}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(e){this.annotate=e}}function jt(e){var t=e.state.vim;return t.searchState_||=new At}function Mt(e){return Pt(e,`/`)}function Nt(e){return Ft(e,`/`)}function Pt(e,t){var n=Ft(e,t)||[];if(!n.length)return[];var r=[];if(n[0]===0){for(var i=0;i<n.length;i++)typeof n[i]==`number`&&r.push(e.substring(n[i]+1,n[i+1]));return r}}function Ft(e,t){t||=`/`;for(var n=!1,r=[],i=0;i<e.length;i++){var a=e.charAt(i);!n&&a==t&&r.push(i),n=!n&&a==`\\`}return r}function It(e){var t={V:`|(){+?*.[$^`,M:`|(){+?*.[`,m:`|(){+?`,v:`<>`},n={">":`(?<=[\\w])(?=[^\\w]|$)`,"<":`(?<=[^\\w]|^)(?=[\\w])`},r=t.m,i=e.replace(/\\.|[\[|(){+*?.$^<>]/g,function(e){if(e[0]===`\\`){var i=e[1];return i===`}`||r.indexOf(i)!=-1?i:i in t?(r=t[i],``):i in n?n[i]:e}return r.indexOf(e)==-1?e:n[e]||`\\`+e}),a=i.indexOf(`\\zs`);return a!=-1&&(i=`(?<=`+i.slice(0,a)+`)`+i.slice(a+3)),a=i.indexOf(`\\ze`),a!=-1&&(i=i.slice(0,a)+`(?=`+i.slice(a+3)+`)`),i}var Lt={"\\n":`
|
|
57
|
+
`,"\\r":`\r`,"\\t":` `};function Rt(e){for(var t=!1,n=[],r=-1;r<e.length;r++){var i=e.charAt(r)||``,a=e.charAt(r+1)||``;Lt[i+a]?(n.push(Lt[i+a]),r++):t?(n.push(i),t=!1):i===`\\`?(t=!0,x(a)||a===`$`?n.push(`$`):a!==`/`&&a!==`\\`&&n.push(`\\`)):(i===`$`&&n.push(`$`),n.push(i),a===`/`&&n.push(`\\`))}return n.join(``)}var zt={"\\/":`/`,"\\\\":`\\`,"\\n":`
|
|
58
|
+
`,"\\r":`\r`,"\\t":` `,"\\&":`&`};function Bt(t){for(var n=new e.StringStream(t),r=[];!n.eol();){for(;n.peek()&&n.peek()!=`\\`;)r.push(n.next());var i=!1;for(var a in zt)if(n.match(a,!0)){i=!0,r.push(zt[a]);break}i||r.push(n.next())}return r.join(``)}function Vt(e,t,n){D.registerController.getRegister(`/`).setText(e);var r=Nt(e),i,a;return r.length?(i=e.substring(0,r[0]),a=e.substring(r[0]).indexOf(`i`)!=-1):i=e,i?(ne(`pcre`)||(i=It(i)),n&&(t=/^[^A-Z]*$/.test(i)),new RegExp(i,t||a?`im`:`m`)):null}function Ht(e){typeof e==`string`&&(e=document.createElement(e));for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n){if(typeof n!=`object`&&(n=document.createTextNode(n)),n.nodeType)e.appendChild(n);else for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(r[0]===`$`?e.style[r.slice(1)]=n[r]:typeof n[r]==`function`?e[r]=n[r]:e.setAttribute(r,n[r]))}}return e}function Ut(e,t,n,r){var i=Ht(`div`,{$color:`red`,$whiteSpace:`pre`,class:`cm-vim-message`},t);e.openNotification?n?(i=Ht(`div`,{},i,Ht(`div`,{},`Press ENTER or type command to continue`)),e.state.closeVimNotification&&e.state.closeVimNotification(),e.state.closeVimNotification=e.openNotification(i,{bottom:!0,duration:0})):e.openNotification(i,{bottom:!0,duration:r||15e3}):r||alert(i.innerText)}function Wt(e,t){return Ht(`div`,{$display:`flex`,$flex:1},Ht(`span`,{$fontFamily:`monospace`,$whiteSpace:`pre`,$flex:1,$display:`flex`},e,Ht(`input`,{type:`text`,autocorrect:`off`,autocapitalize:`off`,spellcheck:`false`,$flex:1})),t&&Ht(`span`,{$color:`#888`},t))}function Gt(e,t){if(de.length)t.value||=``,pe=t;else{var n=Wt(t.prefix,t.desc);if(e.openDialog)e.openDialog(n,t.onClose,{onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:t.value});else{var r=``;typeof t.prefix!=`string`&&t.prefix&&(r+=t.prefix.textContent),t.desc&&(r+=` `+t.desc),t.onClose?.(prompt(r,``))}}}function Kt(e,t){return e instanceof RegExp&&t instanceof RegExp&&e.flags==t.flags&&e.source==t.source}function qt(e,t,n,r){if(t){var i=jt(e),a=Vt(t,!!n,!!r);if(a)return Xt(e,a),Kt(a,i.getQuery())||i.setQuery(a),a}}function Jt(e){if(e.source.charAt(0)==`^`)var t=!0;return{token:function(n){if(t&&!n.sol())n.skipToEnd();else{var r=n.match(e,!1);if(r)return r[0].length==0?(n.next(),`searching`):!n.sol()&&(n.backUp(1),!e.exec(n.next()+r[0]))?(n.next(),null):(n.match(e),`searching`);for(;!n.eol()&&(n.next(),!n.match(e,!1)););}},query:e}}var Yt=0;function Xt(e,t){clearTimeout(Yt);var n=jt(e);n.highlightTimeout=Yt,Yt=setTimeout(function(){if(e.state.vim){var n=jt(e);n.highlightTimeout=void 0;var r=n.getOverlay();(!r||t!=r.query)&&(r&&e.removeOverlay(r),r=Jt(t),e.addOverlay(r),e.showMatchesOnScrollbar&&(n.getScrollbarAnnotate()&&n.getScrollbarAnnotate().clear(),n.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),n.setOverlay(r))}},50)}function Zt(e,n,r,i){return e.operation(function(){i===void 0&&(i=1);for(var a=e.getCursor(),o=e.getSearchCursor(r,a),s=0;s<i;s++){var c=o.find(n);if(s==0&&c&&Ue(o.from(),a)){var l=n?o.from():o.to();c=o.find(n),c&&!c[0]&&Ue(o.from(),l)&&e.getLine(l.line).length==l.ch&&(c=o.find(n))}if(!c&&(o=e.getSearchCursor(r,n?new t(e.lastLine()):new t(e.firstLine(),0)),!o.find(n)))return}return o.from()})}function Qt(e,n,r,i,a){return e.operation(function(){i===void 0&&(i=1);var o=e.getCursor(),s=e.getSearchCursor(r,o),c=s.find(!n);!a.visualMode&&c&&Ue(s.from(),o)&&s.find(!n);for(var l=0;l<i;l++)if(c=s.find(n),!c&&(s=e.getSearchCursor(r,n?new t(e.lastLine()):new t(e.firstLine(),0)),!s.find(n)))return;var u=s.from(),d=s.to();return u&&d&&[u,d]})}function $t(e){var t=jt(e);t.highlightTimeout&&=(clearTimeout(t.highlightTimeout),void 0),e.removeOverlay(jt(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function en(e,t,n){return typeof e!=`number`&&(e=e.line),t instanceof Array?T(e,t):typeof n==`number`?e>=t&&e<=n:e==t}function tn(e){var t=e.getScrollInfo(),n=6,r=10,i=e.coordsChar({left:0,top:n+t.top},`local`),a=t.clientHeight-r+t.top,o=e.coordsChar({left:0,top:a},`local`);return{top:i.line,bottom:o.line}}function nn(e,n,r){if(r==`'`||r=="`")return D.jumpList.find(e,-1)||new t(0,0);if(r==`.`)return rn(e);var i=n.marks[r];return i&&i.find()}function rn(e){if(e.getLastEditEnd)return e.getLastEditEnd();for(var t=e.doc.history.done,n=t.length;n--;)if(t[n].changes)return He(t[n].changes[0].to)}class an{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(e,t,n){var r=this;e.operation(function(){e.curOp&&(e.curOp.isVimOp=!0),r._processCommand(e,t,n)})}_processCommand(t,n,r){var i=t.state.vim,a=D.registerController.getRegister(`:`),o=a.toString(),s=new e.StringStream(n);a.setText(n);var c=r||{};c.input=n;try{this.parseInput_(t,s,c)}catch(e){Ut(t,e+``);return}i.visualMode&&st(t);var l,u;if(!c.commandName)c.line!==void 0&&(u=`move`);else if(l=this.matchCommand_(c.commandName),l){if(u=l.name,l.excludeFromCommandHistory&&a.setText(o),this.parseCommandArgs_(s,c,l),l.type==`exToKey`){he(t,l.toKeys||``,l);return}if(l.type==`exToEx`){this.processCommand(t,l.toInput||``);return}}if(!u)Ut(t,`Not an editor command ":`+n+`"`);else try{on[u](t,c),(!l||!l.possiblyAsync)&&c.callback&&c.callback()}catch(e){throw Ut(t,e+``),e}}parseInput_(e,t,n){if(t.eatWhile(`:`),t.eat(`%`))n.line=e.firstLine(),n.lineEnd=e.lastLine();else if(t.eat(`*`)){var r=e.state.vim.lastSelection,i=r?.anchorMark.find()?.line||0,a=r?.headMark.find()?.line||0;n.line=Math.max(i,a),n.lineEnd=Math.min(i,a)}else n.line=this.parseLineSpec_(e,t),n.line!==void 0&&t.eat(`,`)&&(n.lineEnd=this.parseLineSpec_(e,t));n.line==null?e.state.vim.visualMode?(n.selectionLine=nn(e,e.state.vim,`<`)?.line,n.selectionLineEnd=nn(e,e.state.vim,`>`)?.line):n.selectionLine=e.getCursor().line:(n.selectionLine=n.line,n.selectionLineEnd=n.lineEnd),t.eatSpace();var o=t.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return n.commandName=o?o[1]:(t.match(/.*/)||[``])[0],n}parseLineSpec_(e,t){var n=t.match(/^([\d]+)/);if(n)return this.parseLineSpecOffset_(e,t,parseInt(n[1],10)-1);switch(t.next()){case`.`:return this.parseLineSpecOffset_(e,t,e.getCursor().line);case`$`:return this.parseLineSpecOffset_(e,t,e.lastLine());case`'`:var r=t.next()||``,i=nn(e,e.state.vim,r);if(!i)throw Error(`Mark not set`);return this.parseLineSpecOffset_(e,t,i.line);case`-`:case`+`:case`/`:case`?`:return t.backUp(1),this.parseLineSpecOffset_(e,t,e.getCursor().line);default:t.backUp(1);return}}parseLineSpecOffset_(e,n,r){for(;;){var i=n.match(/^([\/\?]|\\[\?\/])|([+-]?)(\d*)/);if(!i||!i[0])break;if(i[1]){var a=``,o=!i[1].endsWith(`?`);if(i[1].length==1){var s=n.match(o?/^([^\/\\]|\\\/)*/:/^([^\/\?]|\\\?)*/);n.match(o?/^\/?/:/^\??/),a=s&&s[0]}a||=D.registerController.getRegister(`/`)?.toString()||``;var c=new RegExp(a),l=e.getSearchCursor(c,new t(r+ +!!o,0));o?l.findNext():l.findPrevious();var u=l.from();if(!u)throw Error(`Pattern not found`+c);r=u.line}else{var d=parseInt(i[2]+(i[3]||`1`),10);r+=d}}return r}parseCommandArgs_(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)?.[0];var r=n.argDelimiter||/\s+/,i=Ye(t.argString||``).split(r);i.length&&i[0]&&(t.args=i)}}matchCommand_(e){for(var t=e.length;t>0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(r.name.indexOf(e)===0)return r}}}buildCommandMap_(){this.commandMap_={};for(var e=0;e<o.length;e++){var t=o[e],n=t.shortName||t.name;this.commandMap_[n]=t}}map(e,t,n,r){if(e!=`:`&&e.charAt(0)==`:`){if(n)throw Error(`Mode not supported for ex mappings`);var i=e.substring(1);t!=`:`&&t.charAt(0)==`:`?this.commandMap_[i]={name:i,type:`exToEx`,toInput:t.substring(1),user:!0}:this.commandMap_[i]={name:i,type:`exToKey`,toKeys:t,user:!0}}else{var a={keys:e,type:`keyToKey`,toKeys:t,noremap:!!r};n&&(a.context=n),ln(a)}}unmap(e,t){if(e!=`:`&&e.charAt(0)==`:`){if(t)throw Error(`Mode not supported for ex mappings`);var n=e.substring(1);if(this.commandMap_[n]&&this.commandMap_[n].user)return delete this.commandMap_[n],!0}else for(var i=e,a=0;a<r.length;a++)if(i==r[a].keys&&r[a].context===t)return r.splice(a,1),j(i),!0}}var on={colorscheme:function(e,t){!t.args||t.args.length<1?Ut(e,e.getOption(`theme`)):e.setOption(`theme`,t.args[0])},map:function(e,t,n,r){var i=t.args;!i||i.length<2?e&&Ut(e,`Invalid mapping: `+t.input):sn.map(i[0],i[1],n,r)},imap:function(e,t){this.map(e,t,`insert`)},nmap:function(e,t){this.map(e,t,`normal`)},vmap:function(e,t){this.map(e,t,`visual`)},omap:function(e,t){this.map(e,t,`operatorPending`)},noremap:function(e,t){this.map(e,t,void 0,!0)},inoremap:function(e,t){this.map(e,t,`insert`,!0)},nnoremap:function(e,t){this.map(e,t,`normal`,!0)},vnoremap:function(e,t){this.map(e,t,`visual`,!0)},onoremap:function(e,t){this.map(e,t,`operatorPending`,!0)},unmap:function(e,t,n){var r=t.args;(!r||r.length<1||!sn.unmap(r[0],n))&&e&&Ut(e,`No such mapping: `+t.input)},mapclear:function(e,t){ue.mapclear()},imapclear:function(e,t){ue.mapclear(`insert`)},nmapclear:function(e,t){ue.mapclear(`normal`)},vmapclear:function(e,t){ue.mapclear(`visual`)},omapclear:function(e,t){ue.mapclear(`operatorPending`)},move:function(e,t){Oe.processCommand(e,e.state.vim,{keys:``,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,r=t.setCfg||{};if(!n||n.length<1)e&&Ut(e,`Invalid mapping: `+t.input);else{var i=n[0].split(`=`),a=i.shift()||``,o=i.length>0?i.join(`=`):void 0,s=!1,c=!1;if(a.charAt(a.length-1)==`?`){if(o)throw Error(`Trailing characters: `+t.argString);a=a.substring(0,a.length-1),s=!0}else a.charAt(a.length-1)==`!`&&(a=a.substring(0,a.length-1),c=!0);o===void 0&&a.substring(0,2)==`no`&&(a=a.substring(2),o=!1);var l=ee[a]&&ee[a].type==`boolean`;if(l&&(c?o=!ne(a,e,r):o??=!0),!l&&o===void 0||s){var u=ne(a,e,r);u instanceof Error?Ut(e,u.message):u===!0||u===!1?Ut(e,` `+(u?``:`no`)+a):Ut(e,` `+a+`=`+u)}else{var d=te(a,o,e,r);d instanceof Error&&Ut(e,d.message)}}},setlocal:function(e,t){t.setCfg={scope:`local`},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:`global`},this.set(e,t)},registers:function(e,t){var n=t.args,r=D.registerController.registers,i=`----------Registers----------
|
|
59
|
+
|
|
60
|
+
`;if(n)for(var a=n.join(``),o=0;o<a.length;o++){var s=a.charAt(o);if(D.registerController.isValidRegister(s)){var c=r[s]||new O;i+=`"`+s+` `+c.toString()+`
|
|
61
|
+
`}}else for(var s in r){var l=r[s].toString();l.length&&(i+=`"`+s+` `+l+`
|
|
62
|
+
`)}Ut(e,i,!0)},marks:function(e,t){var n=t.args,r=e.state.vim.marks,i=`-----------Marks-----------
|
|
63
|
+
mark line col
|
|
64
|
+
|
|
65
|
+
`;if(n)for(var a=n.join(``),o=0;o<a.length;o++){var s=a.charAt(o),c=r[s]&&r[s].find();c&&(i+=s+` `+c.line+` `+c.ch+`
|
|
66
|
+
`)}else for(var s in r){var c=r[s]&&r[s].find();c&&(i+=s+` `+c.line+` `+c.ch+`
|
|
67
|
+
`)}Ut(e,i,!0)},sort:function(n,r){var i,a,o,s,c,l;function u(){if(r.argString){var t=new e.StringStream(r.argString);if(t.eat(`!`)&&(i=!0),t.eol())return;if(!t.eatSpace())return`Invalid arguments`;var n=t.match(/([dinuoxr]+)?\s*(\/.+\/)?\s*/);if(!n||!t.eol())return`Invalid arguments`;if(n[1]){l=n[1].indexOf(`r`)!=-1,a=n[1].indexOf(`i`)!=-1,o=n[1].indexOf(`u`)!=-1;var u=n[1].indexOf(`d`)!=-1||n[1].indexOf(`n`)!=-1,d=n[1].indexOf(`x`)!=-1,f=n[1].indexOf(`o`)!=-1;if(Number(u)+Number(d)+Number(f)>1)return`Invalid arguments`;s=u&&`decimal`||d&&`hex`||f&&`octal`}n[2]&&(c=new RegExp(n[2].substr(1,n[2].length-2),a?`i`:``))}}var d=u();if(d){Ut(n,d+`: `+r.argString);return}var f=r.line||n.firstLine(),p=r.lineEnd||r.line||n.lastLine();if(f==p)return;var m=new t(f,0),h=new t(p,Je(n,p)),g=n.getRange(m,h).split(`
|
|
68
|
+
`),_=s==`decimal`?/(-?)([\d]+)/:s==`hex`?/(-?)(?:0x)?([0-9a-f]+)/i:s==`octal`?/([0-7]+)/:null,v=s==`decimal`?10:s==`hex`?16:s==`octal`?8:void 0,y=[],b=[];if(s||c)for(var x=0;x<g.length;x++){var S=c?g[x].match(c):null;S&&S.index!=null&&!l&&(S[0]=g[x].slice(S.index+S[0].length)),S&&S[0]!=``?y.push(S):_&&_.exec(g[x])?y.push(g[x]):b.push(g[x])}else b=g;function C(e,t){if(i){var n=e;e=t,t=n}a&&(e=e.toLowerCase(),t=t.toLowerCase());var r=_&&_.exec(e),o=_&&_.exec(t);return!r||!o?e<t?-1:1:parseInt((r[1]+r[2]).toLowerCase(),v)-parseInt((o[1]+o[2]).toLowerCase(),v)}function w(e,t){if(i){var n=e;e=t,t=n}return a&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}if(y.sort(c?w:C),c)for(var x=0;x<y.length;x++)y[x]=y[x].input;else s||b.sort(C);if(g=i?y.concat(b):b.concat(y),o){var T=g,ee;g=[];for(var x=0;x<T.length;x++)T[x]!=ee&&g.push(T[x]),ee=T[x]}n.replaceRange(g.join(`
|
|
69
|
+
`),m,h)},vglobal:function(e,t){this.global(e,t)},normal:function(e,t){var n=!1,r=t.argString;if(r&&r[0]==`!`&&(r=r.slice(1),n=!0),r=r.trimStart(),!r)Ut(e,`Argument is required.`);else{var i=t.line;if(typeof i==`number`)for(var a=isNaN(t.lineEnd)?i:t.lineEnd,o=i;o<=a;o++)e.setCursor(o,0),he(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&cn(e,!0);else he(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&cn(e,!0)}},global:function(e,t){var n=t.argString;if(!n)Ut(e,`Regular Expression missing from global`);else{var r=t.commandName[0]===`v`;n[0]===`!`&&t.commandName[0]===`g`&&(r=!0,n=n.slice(1));var i=t.line===void 0?e.firstLine():t.line,a=t.lineEnd||t.line||e.lastLine(),o=Mt(n),s=n,c=``;if(o&&o.length&&(s=o[0],c=o.slice(1,o.length).join(`/`)),s)try{qt(e,s,!0,!0)}catch{Ut(e,`Invalid regex: `+s);return}for(var l=jt(e).getQuery(),u=[],d=i;d<=a;d++){var f=e.getLine(d);l.test(f)!==r&&u.push(c?e.getLineHandle(d):f)}if(!c)Ut(e,u.join(`
|
|
70
|
+
`));else{var p=0,m=function(){if(p<u.length){var t=u[p++],n=e.getLineNumber(t);if(n==null){m();return}var r=n+1+c;sn.processCommand(e,r,{callback:m})}else e.releaseLineHandles&&e.releaseLineHandles()};m()}}},substitute:function(e,n){if(!e.getSearchCursor)throw Error(`Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.`);var r=n.argString,i=r?Pt(r,r[0]):[],a=``,o=``,s,c,l,u=!1,d=!1;if(i&&i.length)a=i[0],ne(`pcre`)&&a!==``&&(a=new RegExp(a).source),o=i[1],o!==void 0&&(o=ne(`pcre`)?Bt(o.replace(/([^\\])&/g,`$1$$&`)):Rt(o),D.lastSubstituteReplacePart=o),s=i[2]?i[2].split(` `):[];else if(r&&r.length){Ut(e,`Substitutions should be of the form :s/pattern/replace/`);return}if(s&&(c=s[0],l=parseInt(s[1]),c&&(c.indexOf(`c`)!=-1&&(u=!0),c.indexOf(`g`)!=-1&&(d=!0),a=ne(`pcre`)?a+`/`+c:a.replace(/\//g,`\\/`)+`/`+c)),a)try{qt(e,a,!0,!0)}catch{Ut(e,`Invalid regex: `+a);return}if(o||=D.lastSubstituteReplacePart,o===void 0)Ut(e,`No previous substitute regular expression`);else{var f=jt(e).getQuery(),p=n.line===void 0?e.getCursor().line:n.line,m=n.lineEnd||p;p==e.firstLine()&&m==e.lastLine()&&(m=1/0),l&&(p=m,m=p+l-1);var h=Fe(e,new t(p,0)),g=e.getSearchCursor(f,h);A(e,u,d,p,m,g,f,o,n.callback)}},startinsert:function(e,t){he(e,t.argString==`!`?`A`:`i`,{})},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){$t(e)},yank:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;if(i<r){var a=i;i=r,r=a}var o=e.getRange(new t(r,0),new t(i+1,0)),s=n.args&&n.args[0]?n.args[0]:`0`;D.registerController.pushText(s,`yank`,o,!0,!1),Ut(e,i+1-r+` lines yanked`+(s?` into "`+s:``),!1,1500)},put:function(e,n,r){var i={after:!0,isEdit:!0,matchIndent:!!r,repeat:1,lineWise:!0,registerName:``},a=n.args||[];a[0]==`!`&&(i.after=!1,a.shift()),a[0]&&(i.registerName=a[0]);var o=n.selectionLine;o!=null&&e.setCursor(new t(o,0)),Ne.paste(e,i,e.state.vim)},iput:function(e,t){this.put(e,t,!0)},delete:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;Me.delete(e,{linewise:!0},[{anchor:new t(r,0),head:new t(i+1,0)}])},join:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;e.setCursor(new t(r,0)),Ne.joinLines(e,{repeat:i-r},e.state.vim)},delmarks:function(t,n){if(!n.argString||!Ye(n.argString))Ut(t,`Argument required`);else for(var r=t.state.vim,i=new e.StringStream(Ye(n.argString));!i.eol();){i.eatSpace();var a=i.pos;if(!i.match(/[a-zA-Z]/,!1)){Ut(t,`Invalid argument: `+n.argString.substring(a));return}var o=i.next();if(i.match(`-`,!0)){if(!i.match(/[a-zA-Z]/,!1)){Ut(t,`Invalid argument: `+n.argString.substring(a));return}var s=o,c=i.next();if(s&&c&&y(s)==y(c)){var l=s.charCodeAt(0),u=c.charCodeAt(0);if(l>=u){Ut(t,`Invalid argument: `+n.argString.substring(a));return}for(var d=0;d<=u-l;d++){var f=String.fromCharCode(l+d);delete r.marks[f]}}else{Ut(t,`Invalid argument: `+s+`-`);return}}else o&&delete r.marks[o]}}},sn=new an;ue.defineEx(`version`,`ve`,e=>{Ut(e,`Codemirror-vim version: <DEV>`)});function A(t,n,r,i,a,o,s,c,l){t.state.vim.exMode=!0;var u=!1,d=0,f,p,m;function h(){t.operation(function(){for(;!u;)g(),v();y()})}function g(){var e=``,n=o.match||o.pos&&o.pos.match;e=n?c.replace(/\$(\d{1,3}|[$&])/g,function(e,t){if(t==`$`)return`$`;if(t==`&`)return n[0];for(var r=t;parseInt(r)>=n.length&&r.length>0;)r=r.slice(0,r.length-1);return r?n[r]+t.slice(r.length,t.length):e}):t.getRange(o.from(),o.to()).replace(s,c);var r=o.to().line;o.replace(e),p=o.to().line,a+=p-r,m=p<r}function _(){var e=f&&He(o.to()),t=o.findNext();return t&&!t[0]&&e&&Ue(o.from(),e)&&(t=o.findNext()),t&&d++,t}function v(){for(;_()&&en(o.from(),i,a);)if(r||o.from().line!=p||m){t.scrollIntoView(o.from(),30),t.setSelection(o.from(),o.to()),f=o.from(),u=!1;return}u=!0}function y(e){if(e&&e(),t.focus(),f){t.setCursor(f);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}l?l():u&&Ut(t,(d?`Found `+d+` matches`:`No matches found`)+` for pattern: `+s+(ne(`pcre`)?` (set nopcre to use Vim regexps)`:``))}function b(n,r,i){switch(e.e_stop(n),ye(n)){case`y`:g(),v();break;case`n`:v();break;case`a`:var a=l;l=void 0,t.operation(h),l=a;break;case`l`:g();case`q`:case`<Esc>`:case`<C-c>`:case`<C-[>`:y(i)}return u&&y(i),!0}v(),u?Ut(t,`No matches for `+s+(ne(`pcre`)?` (set nopcre to use vim regexps)`:``)):n?Gt(t,{prefix:Ht(`span`,`replace with `,Ht(`strong`,c),` (y/n/a/q/l)`),onKeyDown:b}):(h(),l&&l())}function cn(t,n){var r=t.state.vim,i=D.macroModeState,a=D.registerController.getRegister(`.`),o=i.isPlaying,s=i.lastInsertModeChanges;o||(t.off(`change`,gn),r.insertEnd&&r.insertEnd.clear(),r.insertEnd=void 0,e.off(t.getInputField(),`keydown`,yn)),!o&&r.insertModeRepeat&&r.insertModeRepeat>1&&(bn(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,n||t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption(`keyMap`,`vim`),t.setOption(`disableInput`,!0),t.toggleOverwrite(!1),a.setText(s.changes.join(``)),e.signal(t,`vim-mode-change`,{mode:`normal`}),i.isRecording&&mn(i)}function ln(e){r.unshift(e),e.keys&&un(e.keys)}function un(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){e&&(i[e]||(i[e]=0),i[e]++)})}function j(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){i[e]&&i[e]--})}function dn(e,t,n,r,i){var a={keys:e,type:t};for(var o in a[t]=n,a[t+`Args`]=r,i)a[o]=i[o];ln(a)}E(`insertModeEscKeysTimeout`,200,`number`);function fn(e,t,n,r){var i=D.registerController.getRegister(r);if(r==`:`)i.keyBuffer[0]&&sn.processCommand(e,i.keyBuffer[0]),n.isPlaying=!1;else{var a=i.keyBuffer,o=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s<a.length;s++)for(var c=a[s],l,u,d=/<(?:[CSMA]-)*\w+>|./gi;l=d.exec(c);)if(u=l[0],ue.handleKey(e,u,`macro`),t.insertMode){var f=i.insertModeChanges[o++].changes;D.macroModeState.lastInsertModeChanges.changes=f,Sn(e,f,1),cn(e)}n.isPlaying=!1}}function pn(e,t){if(!e.isPlaying){var n=e.latestRegister,r=D.registerController.getRegister(n);r&&r.pushText(t)}}function mn(e){if(!e.isPlaying){var t=e.latestRegister,n=D.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function hn(e,t){if(!e.isPlaying){var n=e.latestRegister,r=D.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}function gn(e,t){var n=D.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(var i=e.state.vim;t;){if(r.expectCursorActivityForChange=!0,r.ignoreCount>1)r.ignoreCount--;else if(t.origin==`+input`||t.origin==`paste`||t.origin===void 0){var a=e.listSelections().length;a>1&&(r.ignoreCount=a);var o=t.text.join(`
|
|
71
|
+
`);if(r.maybeReset&&=(r.changes=[],!1),o){if(e.state.overwrite&&!/\n/.test(o))r.changes.push([o]);else{if(o.length>1){var s=i&&i.insertEnd&&i.insertEnd.find(),c=e.getCursor();if(s&&s.line==c.line){var l=s.ch-c.ch;l>0&&l<o.length&&(r.changes.push([o,l]),o=``)}}o&&r.changes.push(o)}}}t=t.next}}function _n(e){var t=e.state.vim;if(t.insertMode){var n=D.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:(r.maybeReset=!0,t.insertEnd&&t.insertEnd.clear(),t.insertEnd=e.setBookmark(e.getCursor(),{insertLeft:!0}))}else e.curOp?.isVimOp||vn(e,t)}function vn(t,n){var r=t.getCursor(`anchor`),i=t.getCursor(`head`);if(n.visualMode&&!t.somethingSelected()?st(t,!1):!n.visualMode&&!n.insertMode&&t.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,e.signal(t,`vim-mode-change`,{mode:`visual`})),n.visualMode){var a=We(i,r)?0:-1,o=We(i,r)?-1:0;i=Le(i,0,a),r=Le(r,0,o),n.sel={anchor:r,head:i},Ct(t,n,`<`,Ge(i,r)),Ct(t,n,`>`,Ke(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function yn(t){var n=D.macroModeState.lastInsertModeChanges,r=e.keyName?e.keyName(t):t.key;r&&(r.indexOf(`Delete`)!=-1||r.indexOf(`Backspace`)!=-1)&&(n.maybeReset&&=(n.changes=[],!1),n.changes.push(new ce(r,t)))}function bn(e,t,n,r){var i=D.macroModeState;i.isPlaying=!0;var a=t.lastEditActionCommand,o=t.inputState;function s(){a?Oe.processAction(e,t,a):Oe.evalInput(e,t)}function c(n){if(i.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=i.lastInsertModeChanges;Sn(e,r.changes,n)}}if(t.inputState=t.lastEditInputState,a&&a.interlaceInsertRepeat)for(var l=0;l<n;l++)s(),c(1);else r||s(),c(n);t.inputState=o,t.insertMode&&!r&&cn(e),i.isPlaying=!1}function xn(t,n){e.lookupKey(n,`vim-insert`,function(n){return typeof n==`string`?e.commands[n](t):n(t),!0})}function Sn(e,t,n){var r=e.getCursor(`head`),i=D.macroModeState.lastInsertModeChanges.visualBlock;i&&($e(e,r,i+1),n=e.listSelections().length,e.setCursor(r));for(var a=0;a<n;a++){i&&e.setCursor(Le(r,a,0));for(var o=0;o<t.length;o++){var s=t[o];if(s instanceof ce)xn(e,s.keyName);else if(typeof s==`string`)e.replaceSelection(s);else{var c=e.getCursor(),l=Le(c,0,s[0].length-(s[1]||0));e.replaceRange(s[0],c,s[1]?c:l),e.setCursor(l)}}}i&&e.setCursor(Le(r,0,1))}function Cn(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){if(n!=`insertEnd`){var r=e[n];Array.isArray(r)?r=r.slice():r&&typeof r==`object`&&r.constructor!=Object&&(r=Cn(r)),t[n]=r}}),e.sel&&(t.sel={head:e.sel.head&&He(e.sel.head),anchor:e.sel.anchor&&He(e.sel.anchor)}),t}function wn(e,t,n){var r=oe(e),i=e,a=!1,r=ue.maybeInitVimState_(i),o=r.visualBlock||r.wasInVisualBlock;if(i.state.closeVimNotification){var s=i.state.closeVimNotification;if(i.state.closeVimNotification=null,s(),t==`<CR>`)return Ce(i),!0}var c=i.isInMultiSelectMode();if(r.wasInVisualBlock&&!c?r.wasInVisualBlock=!1:c&&r.visualBlock&&(r.wasInVisualBlock=!0),t==`<Esc>`&&!r.insertMode&&!r.visualMode&&c&&r.status==`<Esc>`)Ce(i);else if(o||!c||i.inVirtualSelectionMode)a=ue.handleKey(i,t,n);else{var l=Cn(r),u=r.inputState.changeQueueList||[];i.operation(function(){i.curOp&&(i.curOp.isVimOp=!0);var e=0;i.forEachSelection(function(){i.state.vim.inputState.changeQueue=u[e];var r=i.getCursor(`head`),o=i.getCursor(`anchor`),s=We(r,o)?0:-1,c=We(r,o)?-1:0;r=Le(r,0,s),o=Le(o,0,c),i.state.vim.sel.head=r,i.state.vim.sel.anchor=o,a=ue.handleKey(i,t,n),i.virtualSelection&&(u[e]=i.state.vim.inputState.changeQueue,i.state.vim=Cn(l)),e++}),i.curOp?.cursorActivity&&!a&&(i.curOp.cursorActivity=!1),i.state.vim=r,r.inputState.changeQueueList=u,r.inputState.changeQueue=null},!0)}return a&&!r.visualMode&&!r.insertMode&&r.visualMode!=i.somethingSelected()&&vn(i,r),a}return se(),ue}var FA=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,IA=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(FA(e)):FA,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ml(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Nl(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Pl(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(IA.prototype[Symbol.iterator]=function(){return this});var LA={from:-1,to:-1,match:/.*/.exec(``),precise:!0},RA=`gm`+(/x/.unicode==null?``:`u`),zA=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=LA,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new HA(e,t,n,r,i);this.re=new RegExp(t,RA+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=WA(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=WA(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},BA=new WeakMap,VA=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=BA.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return BA.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),BA.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},HA=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=LA,this.matchPos=WA(e,r),this.re=new RegExp(t,RA+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=VA.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=WA(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=VA.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(zA.prototype[Symbol.iterator]=HA.prototype[Symbol.iterator]=function(){return this});function UA(e){try{return new RegExp(e,RA),!0}catch{return!1}}function WA(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var GA=K.define({combine(e){return Lu(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Cj(e),scrollToMatch:e=>J.scrollIntoView(e)})}}),KA=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||UA(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
72
|
+
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new rj(this):new ZA(this)}getCursor(e,t=0,n){let r=e.doc?e:Iu.create({doc:e});return n??=r.doc.length,this.regexp?$A(this,r,t,n):YA(this,r,t,n)}},qA=class{constructor(e){this.spec=e}};function JA(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function YA(e,t,n,r){let i;return e.wholeWord&&(i=XA(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=JA(e.test,t,i)),new IA(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function XA(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(ej(i,n-a))!=ju.Word||t(tj(i,n-a))!=ju.Word)&&(t(tj(i,r-a))!=ju.Word||t(ej(i,r-a))!=ju.Word))}var ZA=class extends qA{constructor(e){super(e)}nextMatch(e,t,n){let r=YA(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=YA(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=YA(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=YA(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=YA(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function QA(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function $A(e,t,n,r){let i;return e.wholeWord&&(i=nj(t.charCategorizer(t.selection.main.head))),e.test&&(i=QA(e.test,t,i)),new zA(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function ej(e,t){return e.slice(kl(e,t,!1),t)}function tj(e,t){return e.slice(t,kl(e,t))}function nj(e){return(t,n,r)=>!r[0].length||(e(ej(r.input,r.index))!=ju.Word||e(tj(r.input,r.index))!=ju.Word)&&(e(tj(r.input,r.index+r[0].length))!=ju.Word||e(ej(r.input,r.index+r[0].length))!=ju.Word)}var rj=class extends qA{nextMatch(e,t,n){let r=$A(this.spec,e,n,e.doc.length).next();return r.done&&(r=$A(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=$A(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=$A(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=$A(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},ij=xu.define(),aj=xu.define(),oj=eu.define({create(e){return new sj(vj(e).create(),null)},update(e,t){for(let n of t.effects)n.is(ij)?e=new sj(n.value.create(),e.panel):n.is(aj)&&(e=new sj(e.query,n.value?_j:null));return e},provide:e=>y_.from(e,e=>e.panel)}),sj=class{constructor(e,t){this.query=e,this.panel=t}},cj=Bd.mark({class:`cm-searchMatch`}),lj=Bd.mark({class:`cm-searchMatch cm-searchMatch-selected`}),uj=pp.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(oj))}update(e){let t=e.state.field(oj);(t!=e.startState.field(oj)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Bd.none;let{view:n}=this,r=new Ku;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?lj:cj)})}return r.finish()}},{decorations:e=>e.decorations});function dj(e){return t=>{let n=t.state.field(oj,!1);return n&&n.query.spec.valid?e(t,n):xj(t)}}var fj=dj((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=G.single(r.from,r.to),a=e.state.facet(GA);return e.dispatch({selection:i,effects:[Dj(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),bj(e),!0}),pj=dj((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=G.single(i.from,i.to),o=e.state.facet(GA);return e.dispatch({selection:a,effects:[Dj(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),bj(e),!0}),mj=dj((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:G.create(n.map(e=>G.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),hj=dj((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(J.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=G.single(o.from,o.to).map(d),u.push(Dj(e,o)),u.push(n.facet(GA).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),gj=dj((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:J.announce.of(r),userEvent:`input.replace.all`}),!0});function _j(e){return e.state.facet(GA).createPanel(e)}function vj(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(GA);return new KA({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function yj(e){let t=h_(e,_j);return t&&t.dom.querySelector(`[main-field]`)}function bj(e){let t=yj(e);t&&t==e.root.activeElement&&t.select()}var xj=e=>{let t=e.state.field(oj,!1);if(t&&t.panel){let n=yj(e);if(n&&n!=e.root.activeElement){let r=vj(e.state,t.query.spec);r.valid&&e.dispatch({effects:ij.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[aj.of(!0),t?ij.of(vj(e.state,t.query.spec)):xu.appendConfig.of(kj)]});return!0},Sj=e=>{let t=e.state.field(oj,!1);if(!t||!t.panel)return!1;let n=h_(e,_j);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:aj.of(!1)}),!0},Cj=class{constructor(e){this.view=e;let t=this.query=e.state.field(oj).query.spec;this.commit=this.commit.bind(this),this.searchField=yd(`input`,{value:t.search,placeholder:wj(e,`Find`),"aria-label":wj(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=yd(`input`,{value:t.replace,placeholder:wj(e,`Replace`),"aria-label":wj(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=yd(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=yd(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=yd(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return yd(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=yd(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>fj(e),[wj(e,`next`)]),n(`prev`,()=>pj(e),[wj(e,`previous`)]),n(`select`,()=>mj(e),[wj(e,`all`)]),yd(`label`,null,[this.caseField,wj(e,`match case`)]),yd(`label`,null,[this.reField,wj(e,`regexp`)]),yd(`label`,null,[this.wordField,wj(e,`by word`)]),...e.state.readOnly?[]:[yd(`br`),this.replaceField,n(`replace`,()=>hj(e),[wj(e,`replace`)]),n(`replaceAll`,()=>gj(e),[wj(e,`replace all`)])],yd(`button`,{name:`close`,onclick:()=>Sj(e),"aria-label":wj(e,`close`),type:`button`},[`×`])])}commit(){let e=new KA({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ij.of(e)}))}keydown(e){Ng(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?pj:fj)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),hj(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ij)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(GA).top}};function wj(e,t){return e.state.phrase(t)}var Tj=30,Ej=/[\s\.,:;?!]/;function Dj(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-Tj),o=Math.min(i,n+Tj),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<Tj;e++)if(!Ej.test(s[e+1])&&Ej.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-Tj;e--)if(!Ej.test(s[e-1])&&Ej.test(s[e])){s=s.slice(0,e);break}}return J.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var Oj=J.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),kj=[oj,ru.low(uj),Oj];function Aj(e,t){var n=t.ch,r=t.line+1;r<1&&(r=1,n=0),r>e.lines&&(r=e.lines,n=Number.MAX_VALUE);var i=e.line(r);return Math.min(i.from+Math.max(0,n),i.to)}function jj(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}var Mj=class{constructor(e,t){this.line=e,this.ch=t}};function Nj(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var r=e._handlers||={};r[t]=(r[t]||[]).concat(n)}}function Pj(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=e._handlers,i=r&&r[t];if(i){var a=i.indexOf(n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Fj(e,t,...n){var r=e._handlers?.[t];if(r)for(var i=0;i<r.length;++i)r[i](...n)}function Ij(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}var Lj;try{Lj=RegExp(`[\\w\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{Lj=/[\w]/}function Rj(e,t){var n=e.cm6;if(!n.state.readOnly){var r=`input.type.compose`;if(e.curOp&&(e.curOp.lastChange||(r=`input.type.compose.start`)),t.annotations)try{t.annotations.some(function(e){e.value==`input`&&(e.value=r)})}catch(e){console.error(e)}else t.userEvent=r;return n.dispatch(t)}}function zj(e,t){e.curOp&&(e.curOp.$changeStart=void 0),(t?zb:Bb)(e.cm6);let n=e.curOp?.$changeStart;n!=null&&e.cm6.dispatch({selection:{anchor:n}})}var Bj={Left:e=>Ng(e.cm6,{key:`Left`},`editor`),Right:e=>Ng(e.cm6,{key:`Right`},`editor`),Up:e=>Ng(e.cm6,{key:`Up`},`editor`),Down:e=>Ng(e.cm6,{key:`Down`},`editor`),Backspace:e=>Ng(e.cm6,{key:`Backspace`},`editor`),Delete:e=>Ng(e.cm6,{key:`Delete`},`editor`)},Vj=class e{openDialog(e,t,n){return qj(this,e,t,n)}openNotification(e,t){return Wj(this,e,t)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,t){Nj(this,e,t)}off(e,t){Pj(this,e,t)}signal(e,t,n){Fj(this,e,t,n)}indexFromPos(e){return Aj(this.cm6.state.doc,e)}posFromIndex(e){return jj(this.cm6.state.doc,e)}foldCode(e){let t=this.cm6,n=t.state.selection.ranges,r=this.cm6.state.doc,i=Aj(r,e),a=G.create([G.range(i,i)],0).ranges;t.state.selection.ranges=a,Wy(t),t.state.selection.ranges=n}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,t){typeof e==`object`&&(t=e.ch,e=e.line);var n=Aj(this.cm6.state.doc,{line:e,ch:t||0});this.cm6.dispatch({selection:{anchor:n}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var t=this.cm6.state.selection.main,n=e==`head`||!e?t.head:e==`anchor`?t.anchor:e==`start`?t.from:e==`end`?t.to:null;if(n==null)throw Error(`Invalid cursor type`);return this.posFromIndex(n)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(t=>({anchor:jj(e,t.anchor),head:jj(e,t.head)}))}setSelections(e,t){var n=this.cm6.state.doc,r=e.map(e=>{var t=Aj(n,e.head),r=Aj(n,e.anchor);return t==r?G.cursor(t,1):G.range(r,t)});this.cm6.dispatch({selection:G.create(r,t)})}setSelection(e,t,n){this.setSelections([{anchor:e,head:t}],0),n&&n.origin==`*mouse`&&this.onBeforeEndOperation()}getLine(e){var t=this.cm6.state.doc;return e<0||e>=t.lines?``:this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||=[],{row:e,index:this.indexFromPos(new Mj(e,0))}}getLineNumber(e){var t=this.$lineHandleChanges;if(!t)return null;for(var n=e.index,r=0;r<t.length;r++)if(n=t[r].changes.mapPos(n,1,Il.TrackAfter),n==null)return null;var i=this.posFromIndex(n);return i.ch==0?i.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,t){var n=this.cm6.state.doc;return this.cm6.state.sliceDoc(Aj(n,e),Aj(n,t))}replaceRange(e,t,n,r){n||=t;var i=this.cm6.state.doc,a=Aj(i,t),o=Aj(i,n);Rj(this,{changes:{from:a,to:o,insert:e}})}replaceSelection(e){Rj(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var t=this.cm6.state.selection.ranges.map((t,n)=>({from:t.from,to:t.to,insert:e[n]||``}));Rj(this,{changes:t})}getSelection(){return this.getSelections().join(`
|
|
73
|
+
`)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var t=this.cm6.state.doc,n=e.ch,r=e.line+1;r<1&&(r=1,n=0),r>t.lines&&(r=t.lines,n=Number.MAX_VALUE);var i=t.line(r);return n=Math.min(Math.max(0,n),i.to-i.from),new Mj(r-1,n)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var t=this.cm6;return t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:G.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,t){var n=this.cm6.state,r=Aj(n.doc,e),i=db(n,r+1,-1);return i&&i.end||(i=db(n,r,1),i&&i.end)?{to:jj(n.doc,i.end.from)}:{to:void 0}}scanForBracket(e,t,n,r){return Xj(this,e,t,n,r)}indentLine(e,t){t?this.indentMore():this.indentLess()}indentMore(){GS(this.cm6)}indentLess(){KS(this.cm6)}execCommand(t){if(e.commands.hasOwnProperty(t))e.commands[t](this);else if(t==`goLineLeft`)kx(this.cm6);else if(t==`goLineRight`){Ox(this.cm6);let e=this.cm6.state,t=e.selection.main.head;t<e.doc.length&&e.sliceDoc(t,t+1)!==`
|
|
74
|
+
`&&fx(this.cm6)}else console.log(t+` is not implemented`)}setBookmark(e,t){var n=t?.insertLeft?1:-1,r=this.indexFromPos(e);return new eM(this,r,n)}addOverlay({query:e}){let t=new KA({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(t.valid){t.forVim=!0,this.cm6Query=t;let e=ij.of(t);return this.cm6.dispatch({effects:e}),t}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let t=ij.of(this.cm6Query);this.cm6.dispatch({effects:t})}getSearchCursor(e,t){var n=this,r=null,i=null,a=!1;t.ch??=Number.MAX_VALUE;var o=Aj(n.cm6.state.doc,t),s=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(e,t){return t||`\\`+e});function c(t,n=0,r=t.length){return new zA(t,s,{ignoreCase:e.ignoreCase},n,r)}function l(e){var t=n.cm6.state.doc;if(e>t.length)return null;let r=c(t,e).next();return r.done?null:r.value}var u=1e4;function d(e,t){var r=n.cm6.state.doc;for(let n=1;;n++){let i=Math.max(e,t-n*u),a=c(r,i,t),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==e||o.from>i+10))return o;if(i==e)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var t=n.cm6.state.doc;return r=e?d(0,r?a?r.to-1:r.from:o):l(r?a?r.to+1:r.to:o),i=r&&{from:jj(t,r.from),to:jj(t,r.to),match:r.match},a=r?r.from==r.to:!1,r&&r.match},from:function(){return i?.from},to:function(){return i?.to},replace:function(e){r&&(Rj(n,{changes:{from:r.from,to:r.to,insert:e}}),r.to=r.from+e.length,i&&(i.to=jj(n.cm6.state.doc,r.to)))},get match(){return i&&i.match}}}findPosV(e,t,n,r){let{cm6:i}=this,a=i.state.doc,o=n==`page`?i.dom.clientHeight:0,s=Aj(a,e),c=G.cursor(s,1,void 0,r),l=Math.round(Math.abs(t));for(let e=0;e<l;e++)n==`page`?c=i.moveVertically(c,t>0,o):n==`line`&&(c=i.moveVertically(c,t>0));let u=jj(a,c.head);return(t<0&&c.head==0&&r!=0&&e.line==0&&e.ch!=0||t>0&&c.head==a.length&&u.ch!=r&&e.line==u.line)&&(u.hitSide=!0),u}charCoords(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=Aj(this.cm6.state.doc,e),i=this.cm6.coordsAtPos(r),a=-n.top;return{left:(i?.left||0)-n.left,top:(i?.top||0)+a,bottom:(i?.bottom||0)+a}}coordsChar(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=this.cm6.posAtCoords({x:e.left+n.left,y:e.top+n.top})||0;return jj(this.cm6.state.doc,r)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,t){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),t!=null&&(this.cm6.scrollDOM.scrollTop=t)}scrollIntoView(e,t){if(e){var n=this.indexFromPos(e);this.cm6.dispatch({effects:J.scrollIntoView(n)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:`scroll`})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption(`mode`)}}setSize(e,t){this.cm6.dom.style.width=e+4+`px`,this.cm6.dom.style.height=t+`px`,this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let t in this.marks)this.marks[t].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(t=>t.map(e.changes)));var t=this.curOp=this.curOp||{};e.changes.iterChanges((e,n,r,i,a)=>{(t.$changeStart==null||t.$changeStart>r)&&(t.$changeStart=r),this.$lastChangeEndOffset=i;var o={text:a.toJSON()};t.lastChange?t.lastChange.next=t.lastChange=o:t.lastChange=t.change=o},!0),t.changeHandlers||=this._handlers.change&&this._handlers.change.slice()}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice(),this.curOp.cursorActivity=!0}operation(e,t){this.curOp||={$d:0},this.curOp.$d++;try{var n=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return n}onBeforeEndOperation(){var e=this.curOp,t=!1;e&&(e.change&&Ij(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(Ij(e.cursorActivityHandlers,this,null),e.isVimOp&&(t=!0)),this.curOp=null),t&&this.scrollIntoView()}moveH(e,t){if(t==`char`){var n=this.getCursor();this.setCursor(n.line,n.ch+e)}}setOption(e,t){switch(e){case`keyMap`:this.state.keyMap=t;break;case`textwidth`:this.state.textwidth=t}}getOption(e){switch(e){case`firstLineNumber`:return 1;case`tabSize`:return this.cm6.state.tabSize||4;case`readOnly`:return this.cm6.state.readOnly;case`indentWithTabs`:return this.cm6.state.facet(dy)==` `;case`indentUnit`:return this.cm6.state.facet(dy).length||2;case`textwidth`:return this.state.textwidth;case`keyMap`:return this.state.keyMap||`vim`}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var t=this.indexFromPos(e),n=(Qv(this.cm6.state,t)?.resolve(t))?.type?.name||``;return/comment/i.test(n)?`comment`:/string/i.test(n)?`string`:``}overWriteSelection(e){var t=this.cm6.state.doc,n=this.cm6.state.selection,r=n.ranges.map(e=>{if(e.empty){var n=e.to<t.length?t.sliceString(e.from,e.to+1):``;if(n&&!/\n/.test(n))return G.range(e.from,e.to+1)}return e});this.cm6.dispatch({selection:G.create(r,n.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var t=this.cm6.state.selection;this.virtualSelection=G.create(t.ranges,t.mainIndex);for(var n=0;n<this.virtualSelection.ranges.length;n++){var r=this.virtualSelection.ranges[n];r&&(this.cm6.dispatch({selection:G.create([r])}),e(),this.virtualSelection.ranges[n]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return tM(this,e)}};Vj.isMac=typeof navigator<`u`&&/Mac/.test(navigator.platform),Vj.Pos=Mj,Vj.StringStream=Wv,Vj.commands={toggleLineComment:function(e){Cb(e.cm6)},cursorCharLeft:function(e){lx(e.cm6)},redo:function(e){zj(e,!1)},undo:function(e){zj(e,!0)},newlineAndIndent:function(e){BS({state:e.cm6.state,dispatch:t=>Rj(e,t)})},indentAuto:function(e){WS(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Vj.isWordChar=function(e){return Lj.test(e)},Vj.keys=Bj,Vj.addClass=function(e,t){},Vj.rmClass=function(e,t){},Vj.e_preventDefault=function(e){e.preventDefault()},Vj.e_stop=function(e){var t,n;(t=e?.stopPropagation)==null||t.call(e),(n=e?.preventDefault)==null||n.call(e)},Vj.lookupKey=function(e,t,n){var r=Vj.keys[e];!r&&/^Arrow/.test(e)&&(r=Vj.keys[e.slice(5)]),r&&n(r)},Vj.on=Nj,Vj.off=Pj,Vj.signal=Fj,Vj.findMatchingTag=Zj,Vj.findEnclosingTag=Qj,Vj.keyName=void 0;function Hj(e,t,n){var r=document.createElement(`div`);return r.appendChild(t),r}function Uj(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function Wj(e,t,n){Uj(e,s);var r=Hj(e,t,n&&n.bottom),i=!1,a,o=n&&n.duration!==void 0?n.duration:5e3;function s(){i||(i=!0,clearTimeout(a),r.remove(),Kj(e,r))}return r.onclick=function(e){e.preventDefault(),s()},Gj(e,r),o&&(a=setTimeout(s,o)),s}function Gj(e,t){var n=e.state.dialog;e.state.dialog=t,t.style.flex=`1`,t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),Vj.signal(e,`dialog`))}function Kj(e,t){e.state.dialog==t&&(e.state.dialog=null,Vj.signal(e,`dialog`))}function qj(e,t,n,r){r||={},Uj(e,void 0);var i=Hj(e,t,r.bottom),a=!1;Gj(e,i);function o(t){if(typeof t==`string`)s.value=t;else{if(a)return;a=!0,Kj(e,i),e.state.dialog||e.focus(),r.onClose&&r.onClose(i)}}var s=i.getElementsByTagName(`input`)[0];return s&&(r.value&&(s.value=r.value,r.selectValueOnOpen!==!1&&s.select()),r.onInput&&Vj.on(s,`input`,function(e){r.onInput(e,s.value,o)}),r.onKeyUp&&Vj.on(s,`keyup`,function(e){r.onKeyUp(e,s.value,o)}),Vj.on(s,`keydown`,function(e){r&&r.onKeyDown&&r.onKeyDown(e,s.value,o)||(e.keyCode==13&&n&&n(s.value),(e.keyCode==27||r.closeOnEnter!==!1&&e.keyCode==13)&&(s.blur(),Vj.e_stop(e),o()))}),r.closeOnBlur!==!1&&Vj.on(s,`blur`,function(){setTimeout(function(){document.activeElement!==s&&o()})}),s.focus()),o}var Jj={"(":`)>`,")":`(<`,"[":`]>`,"]":`[<`,"{":`}>`,"}":`{<`,"<":`>>`,">":`<<`};function Yj(e){return e&&e.bracketRegex||/[(){}[\]]/}function Xj(e,t,n,r,i){for(var a=i&&i.maxScanLineLength||1e4,o=i&&i.maxScanLines||1e3,s=[],c=Yj(i),l=n>0?Math.min(t.line+o,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-o),u=t.line;u!=l;u+=n){var d=e.getLine(u);if(d){var f=n>0?0:d.length-1,p=n>0?d.length:-1;if(!(d.length>a))for(u==t.line&&(f=t.ch-+(n<0));f!=p;f+=n){var m=d.charAt(f);if(c.test(m)){var h=Jj[m];if(h&&h.charAt(1)==`>`==n>0)s.push(m);else if(s.length)s.pop();else return{pos:new Mj(u,f),ch:m}}}}}return u-n!=(n>0?e.lastLine():e.firstLine())&&null}function Zj(e,t){return null}function Qj(e,t){var n=e.cm6.state,r=e.indexFromPos(t);r<n.doc.length&&n.sliceDoc(r,r+1)==`<`&&r++;for(var i=Qv(n,r)?.resolve(r)||null;i;){if(i.firstChild?.type.name==`OpenTag`&&i.lastChild?.type.name==`CloseTag`)return{open:$j(n.doc,i.firstChild),close:$j(n.doc,i.lastChild)};i=i.parent}}function $j(e,t){return{from:jj(e,t.from),to:jj(e,t.to)}}var eM=class{constructor(e,t,n){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=n,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,Il.TrackDel))}};function tM(e,t){for(var n=t.column||e.getOption(`textwidth`)||80,r=t.allowMerge!=0,i=Math.min(t.from,t.to),a=Math.max(t.from,t.to);i<=a;){var o=e.getLine(i);if(o.length>n){var s=p(o,n,5);if(s){var c=/^\s*/.exec(o)?.[0];e.replaceRange(`
|
|
75
|
+
`+c,new Mj(i,s.start),new Mj(i,s.end))}a++}else if(r&&/\S/.test(o)&&i!=a){var l=e.getLine(i+1);if(l&&/\S/.test(l)){var u=o.replace(/\s+$/,``),d=l.replace(/^\s+/,``),f=u+` `+d,s=p(f,n,5);s&&s.start>u.length||f.length<n?(e.replaceRange(` `,new Mj(i,u.length),new Mj(i+1,l.length-d.length)),i--,a--):u.length<o.length&&e.replaceRange(``,new Mj(i,u.length),new Mj(i,o.length))}}i++}return i;function p(e,t,n){if(!(e.length<t)){var r=e.slice(0,t),i=e.slice(t),a=/^(?:(\s+)|(\S+)(\s+))/.exec(i),o=/(?:(\s+)|(\s+)(\S+))$/.exec(r),s=0,c=0;if(o&&!o[2]&&(s=t-o[1].length,c=t),a&&!a[2]&&(s||=t,c=t+a[1].length),s)return{start:s,end:c};if(o&&o[2]&&o.index>n)return{start:o.index,end:o.index+o[2].length};if(a&&a[2])return s=t+a[2].length,{start:s,end:s+a[3].length}}}}var nM=Xg||function(){let e={cursorBlinkRate:1200};return function(){return e}}(),rM=class{constructor(e,t,n,r,i,a,o,s,c,l){this.left=e,this.top=t,this.height=n,this.fontFamily=r,this.fontSize=i,this.fontWeight=a,this.color=o,this.className=s,this.letter=c,this.partial=l}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,e.style.height=this.height+`px`,e.style.lineHeight=this.height+`px`,e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?`transparent`:this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},iM=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement(`div`)),this.cursorLayer.className=`cm-cursorLayer cm-vimCursorLayer`,this.cursorLayer.setAttribute(`aria-hidden`,`true`),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=nM(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+`ms`}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`),aM(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let r=n==e.selection.main,i=cM(this.cm,this.view,n,r);i&&t.push(i)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((e,t)=>!e.eq(this.cursors[t]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent=``;for(let t of e)this.cursorLayer.appendChild(t.draw())}else e.forEach((e,n)=>e.adjust(t[n]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function aM(e){return nM(e.startState)!=nM(e.state)}var oM=ru.highest(J.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:`transparent !important`},"&::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-fat-cursor":{position:`absolute`,background:`#ff9696`,border:`none`,whiteSpace:`pre`},"&:not(.cm-focused) .cm-fat-cursor":{background:`none`,outline:`solid 1px #ff9696`,color:`transparent !important`}}));function sM(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Tf.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function cM(e,t,n,r){var i;let a=n.head,o=!1,s=1,c=e.state.vim;if(c&&(!c.insertMode||e.state.overwrite)){if(o=!0,c.visualBlock&&!r)return null;n.anchor<n.head&&(a<t.state.doc.length&&t.state.sliceDoc(a,a+1))!=`
|
|
76
|
+
`&&a--,e.state.overwrite?s=.2:c.status&&(s=.5)}if(o){let e=a<t.state.doc.length&&t.state.sliceDoc(a,a+1);e&&/[\uDC00-\uDFFF]/.test(e)&&a>1&&(a--,e=t.state.sliceDoc(a,a+1));let n=t.coordsAtPos(a,1);if(!n)return null;let o=sM(t),c=t.domAtPos(a),u=c?c.node:t.contentDOM;for(u instanceof Text&&c.offset>=u.data.length&&u.parentElement?.nextSibling&&(u=u.parentElement?.nextSibling,c={node:u,offset:0});c&&c.node instanceof HTMLElement;)u=c.node,c={node:c.node.childNodes[c.offset],offset:0};if(!(u instanceof HTMLElement)){if(!u.parentNode)return null;u=u.parentNode}let d=getComputedStyle(u),f=n.left,p=(i=t).coordsForChar?.call(i,a);if(p&&(f=p.left),!e||e==`
|
|
77
|
+
`||e==`\r`)e=`\xA0`;else if(e==` `){e=`\xA0`;var l=t.coordsAtPos(a+1,-1);l&&(f=l.left-(l.left-n.left)/parseInt(d.tabSize))}else/[\uD800-\uDBFF]/.test(e)&&a<t.state.doc.length-1&&(e+=t.state.sliceDoc(a+1,a+2));let m=n.bottom-n.top;return new rM((f-o.left)/t.scaleX,(n.top-o.top+m*(1-s))/t.scaleY,m*s/t.scaleY,d.fontFamily,d.fontSize,d.fontWeight,d.color,r?`cm-fat-cursor cm-cursor-primary`:`cm-fat-cursor cm-cursor-secondary`,e,s!=1)}return null}var lM=typeof navigator<`u`&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),uM=PA(Vj),dM=J.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:`none`},".cm-vim-panel":{padding:`0px 10px`,fontFamily:`monospace`,minHeight:`1.3em`,display:`flex`},".cm-vim-panel input":{border:`none`,outline:`none`,backgroundColor:`inherit`},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`}}),fM=pp.fromClass(class{constructor(e){this.status=``,this.query=null,this.decorations=Bd.none,this.waitForCopy=!1,this.lastKeydown=``,this.useNextTextInput=!1,this.compositionText=``,this.view=e;let t=this.cm=new Vj(e);uM.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new iM(e,t),this.updateClass(),this.cm.on(`vim-command-done`,()=>{t.state.vim&&(t.state.vim.status=``),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on(`vim-mode-change`,e=>{t.state.vim&&(t.state.vim.mode=e.mode,e.subMode&&(t.state.vim.mode+=e.subMode===`linewise`?` line`:` block`),t.state.vim.status=``,this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on(`dialog`,()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:hM.of(!!this.cm.state.dialog)})}),this.dom=document.createElement(`span`),this.spacer=document.createElement(`span`),this.spacer.style.flex=`1`,this.statusButton=document.createElement(`span`),this.statusButton.onclick=e=>{uM.handleKey(this.cm,`<Esc>`,`user`),this.cm.focus()},this.statusButton.style.cssText=`cursor: pointer`}update(e){if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let t of e.transactions)for(let e of t.effects)if(e.is(ij)){if(!e.value?.forVim)this.highlight(null);else{let t=e.value.create();this.highlight(t)}}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove(`cm-vimMode`):this.view.scrollDOM.classList.add(`cm-vimMode`)}updateStatus(){let e=this.cm.state.statusbar,t=this.cm.state.vim;if(!e||!t)return;let n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent=``,e.appendChild(n));else{e.textContent=``;var r=(t.mode||`normal`).toUpperCase();t.insertModeReturn&&(r+=`(C-O)`),this.statusButton.textContent=`--${r}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){uM.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Bd.none;let{view:t}=this,n=new Ku;for(let r=0,i=t.visibleRanges,a=i.length;r<a;r++){let{from:o,to:s}=i[r];for(;r<a-1&&s>i[r+1].from-500;)s=i[++r].to;e.highlight(t.state,o,s,(e,t)=>{n.add(e,t,mM)})}return this.decorations=n.finish()}handleKey(e,t){let n=this.cm,r=n.state.vim;if(!r)return;let i=uM.vimKeyFromEvent(e,r);if(Vj.signal(this.cm,`inputEvent`,{type:`handleKey`,key:i}),!i)return;if(i==`<Esc>`&&!r.insertMode&&!r.visualMode&&this.query){let e=r.searchState_;e&&(n.removeOverlay(e.getOverlay()),e.setOverlay(null))}if(i===`<C-c>`&&!Vj.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;r.status=(r.status||``)+i;let a=uM.multiSelectHandleKey(n,i,`user`);return r=uM.maybeInitVimState_(n),!a&&r.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(a=!0,n.overWriteSelection(e.key)):e.key==`Backspace`&&(a=!0,Vj.commands.cursorCharLeft(n))),a&&(Vj.signal(this.cm,`vim-keypress`,i),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!a}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var e=this.cm,t=e.state.vim;t&&(t.insertMode?e.setSelection(e.getCursor(),e.getCursor()):e.operation(()=>{e.curOp&&(e.curOp.isVimOp=!0),uM.handleKey(e,`<Esc>`,`user`)}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,Vj.signal(this.cm,`inputEvent`,e)},compositionupdate:function(e,t){Vj.signal(this.cm,`inputEvent`,e)},compositionend:function(e,t){Vj.signal(this.cm,`inputEvent`,e)},keypress:function(e,t){Vj.signal(this.cm,`inputEvent`,e),this.lastKeydown==`Dead`&&this.handleKey(e,t)},keydown:function(e,t){Vj.signal(this.cm,`inputEvent`,e),this.lastKeydown=e.key,this.lastKeydown==`Unidentified`||this.lastKeydown==`Process`||this.lastKeydown==`Dead`?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,t))}},provide:()=>[J.inputHandler.of((e,t,n,r)=>{var i=bM(e);if(!i)return!1;var a=i.state?.vim,o=i.state.vimPlugin;if(a&&!a.insertMode&&!i.curOp?.isVimOp){if(r===`\0\0`)return!0;if(Vj.signal(i,`inputEvent`,{type:`text`,text:r,from:t,to:n}),r.length==1&&o.useNextTextInput){if(a.expectLiteralNext&&e.composing)return o.compositionText=r,!1;if(o.compositionText){var s=o.compositionText;o.compositionText=``;var c=e.state.selection.main.head;if(s===e.state.sliceDoc(c-s.length,c)){var l=i.getCursor();i.replaceRange(``,i.posFromIndex(c-s.length),l)}}return o.handleKey({key:r,preventDefault:()=>{},stopPropagation:()=>{}}),pM(e),!0}}return!1})],decorations:e=>e.decorations});function pM(e){var t=e.scrollDOM.parentElement;if(t){if(lM)e.contentDOM.textContent=`\0\0`,e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`));else{var n=e.scrollDOM.nextSibling,r=window.getSelection(),i=r&&{anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{i&&r&&(r.setPosition(i.anchorNode,i.anchorOffset),i.focusNode&&r.extend(i.focusNode,i.focusOffset))}catch(e){console.error(e)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`))}}}var mM=Bd.mark({class:`cm-searchMatch`}),hM=xu.define(),gM=eu.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(hM)&&(e=n.value);return e},provide:e=>y_.from(e,e=>e?_M:null)});function _M(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function vM(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}function yM(e={}){return[dM,fM,oM,e.status?y_.of(vM):gM]}function bM(e){return e.cm||null}var xM=Xg||function(){let e={cursorBlinkRate:1200};return function(){return e}}(),SM=class{constructor(e,t,n,r,i,a,o,s,c,l){this.left=e,this.top=t,this.height=n,this.fontFamily=r,this.fontSize=i,this.fontWeight=a,this.color=o,this.className=s,this.letter=c,this.partial=l}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,e.style.height=this.height+`px`,e.style.lineHeight=this.height+`px`,e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?`transparent`:this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},CM=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.em=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement(`div`)),this.cursorLayer.className=`cm-cursorLayer cm-vimCursorLayer`,this.cursorLayer.setAttribute(`aria-hidden`,`true`),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=xM(this.view.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+`ms`}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`),wM(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let r=n==e.selection.main,i=DM(this.em,this.view,n,r);i&&t.push(i)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((e,t)=>!e.eq(this.cursors[t]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent=``;for(let t of e)this.cursorLayer.appendChild(t.draw())}else e.forEach((e,n)=>e.adjust(t[n]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function wM(e){return xM(e.startState)!=xM(e.state)}var TM=ru.highest(J.theme({".cm-line":{"& ::selection":{backgroundColor:`transparent !important`},"&::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-fat-cursor":{position:`absolute`,background:`#ff9696`,border:`none`,whiteSpace:`pre`},"&:not(.cm-focused) .cm-fat-cursor":{background:`none`,outline:`solid 1px #ff9696`,color:`transparent !important`}}));function EM(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Tf.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function DM(e,t,n,r){var i;let a=n.head,o=1;(e.$data.count||e.$data.keyChain)&&(o=.5);{let e=a<t.state.doc.length&&t.state.sliceDoc(a,a+1);e&&/[\uDC00-\uDFFF]/.test(e)&&a>1&&(a--,e=t.state.sliceDoc(a,a+1));let n=t.coordsAtPos(a,1);if(!n)return null;let c=EM(t),l=t.domAtPos(a),u=l?l.node:t.contentDOM;for(;l&&l.node instanceof HTMLElement;)u=l.node,l={node:l.node.childNodes[l.offset],offset:0};if(!(u instanceof HTMLElement)){if(!u.parentNode)return null;u=u.parentNode}let d=getComputedStyle(u),f=n.left,p=(i=t).coordsForChar?.call(i,a);if(p&&(f=p.left),!e||e==`
|
|
78
|
+
`||e==`\r`)e=`\xA0`;else if(e==` `){e=`\xA0`;var s=t.coordsAtPos(a+1,-1);s&&(f=s.left-(s.left-n.left)/parseInt(d.tabSize))}else/[\uD800-\uDBFF]/.test(e)&&a<t.state.doc.length-1&&(e+=t.state.sliceDoc(a+1,a+2));let m=n.bottom-n.top;return new SM(f-c.left,n.top-c.top+m*(1-o),m*o,d.fontFamily,d.fontSize,d.fontWeight,d.color,r?`cm-fat-cursor cm-cursor-primary`:`cm-fat-cursor cm-cursor-secondary`,e,o!=1)}}var OM=J.theme({".cm-emacsMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:`none`},".cm-vim-panel":{padding:`5px 10px`,backgroundColor:`#fffa8f`,fontFamily:`monospace`},".cm-vim-panel input":{border:`none`,outline:`none`,backgroundColor:`#fffa8f`}}),kM=pp.fromClass(class{constructor(e){this.status=``,this.view=e,this.em=new LM(e),this.blockCursor=new CM(e,this.em),this.view.scrollDOM.classList.add(`cm-emacsMode`)}update(e){e.docChanged&&(this.em.$emacsMark=null,this.em.updateMarksOnChange(e.changes)),this.blockCursor.update(e)}destroy(){this.view.scrollDOM.classList.remove(`cm-emacsMode`),this.blockCursor.destroy()}},{eventHandlers:{keydown:function(e,t){var n=this.em.handleKeyboard(e);return n&&this.blockCursor.scheduleRedraw(),!!n},mousedown:function(){this.em.$emacsMark=null}}}),AM=xu.define(),jM=eu.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(AM)&&(e=n.value);return e},provide:e=>y_.from(e,e=>e?MM:null)});function MM(e){let t=document.createElement(`div`);return t.className=`cm-vim-panel`,{top:!1,dom:t}}function NM(e={}){return[OM,kM,TM,jM]}var PM={Return:`Return`,Escape:`Esc`,Insert:`Ins`,ArrowLeft:`Left`,ArrowRight:`Right`,ArrowUp:`Up`,ArrowDown:`Down`,Enter:`Return`,Divide:`/`,Slash:`/`,Multiply:`*`,Subtract:`-`,Minus:`-`,Equal:`=`},FM={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1},IM={},LM=class e{constructor(e){this.view=e,this.$data={count:0,keyChain:``,lastCommand:``},this.$emacsMarkRing=[],this.$emacsMark=null}static bindKey(e,t){e.split(`|`).forEach(function(e){let n=``,r=e.split(/\s+/);r.forEach(function(e,i){let a=e.split(/-(?=.)/),o=a.pop();a.length&&(n+=a.sort().join(`-`)+`-`),n+=o,i===r.length-1?IM[n]=t:(IM[n]=`null`,n+=` `)})})}static getKey(e){var t=e.code,n=e.key;if(FM[n])return[``,``,``];t.length>1&&(t[0]==`N`&&(t=t.replace(/^Numpad/,``)),t[0]==`K`&&(t=t.replace(/^Key/,``))),t=PM[t]||t,t.length==1&&(t=t.toLowerCase());var r=``;return e.ctrlKey&&(r+=`C-`),e.metaKey&&(r+=`CMD-`),e.altKey&&(r+=`M-`),e.shiftKey&&(r+=`S-`),[t,r,n]}static addCommands(t){Object.keys(t).forEach(function(n){var r=t[n];typeof r==`function`&&(r={exec:r}),e.commands[n]=r})}static execCommand(e,t,n,r=1){var i=void 0;if(r<0&&(r=-r),typeof e==`function`)for(var a=0;a<r;a++)e(t.view);else if(e!==`null`){if(e.exec){r>1&&e.handlesCount&&(n||={},typeof n==`object`&&(n.count=r),r=1);for(var a=0;a<r;a++)i=e.exec(t,n||{})}else throw Error(`missformed command`)}return i}handleKeyboard(t){var n=e.getKey(t),r=this.findCommand(n);if(!(/Up|Down/.test(n?.[0])&&ow(this.view.state))&&!(r&&r.command&&e.execCommand(r.command,this,r.args,r.count)===!1))return r}findCommand([t,n,r]){if(t){var i=this,a=this.$data;if(!n&&t.length==1&&(i.pushEmacsMark(),a.count)){var o=Array(a.count+1).join(r);return a.count=null,{command:`insertstring`,args:o}}if(n==`C-`||a.count){var s=parseInt(t[t.length-1]);if(typeof s==`number`&&!isNaN(s))return a.count=Math.max(a.count||0,0),a.count=10*a.count+s,{command:`null`}}n&&(t=n+t),a.keyChain&&(t=a.keyChain+=` `+t);var c=IM[t];if(a.keyChain=c==`null`?t:``,c){if(c===`null`)return{command:`null`};if(c===`universalArgument`)return a.count=-4,{command:`null`};var l;if(typeof c!=`string`&&(l=c.args,c.command&&(c=c.command)),(c===`insertstring`||c===kS||c===xb)&&i.pushEmacsMark(),!(typeof c==`string`&&(c=e.commands[c],!c))){!c.readOnly&&!c.keepLastCommand&&(a.lastCommand=null);var s=a.count||1;return a.count&&=0,{command:c,args:l,count:s}}}}}showCommandLine(e){console.error(`TODO`)}updateMarksOnChange(e){this.$emacsMark&&=this.updateMark(this.$emacsMark,e),this.$emacsMarkRing=this.$emacsMarkRing.map(t=>this.updateMark(t,e)).filter(Boolean)}updateMark(e,t){if(e){var n=e.map(function(e){return t.mapPos(e,1,Il.TrackDel)}).filter(e=>e!=null);return n.length==0?null:n}}emacsMark(){return this.$emacsMark}setEmacsMark(e){this.$emacsMark=e}pushEmacsMark(e,t){var n=this.$emacsMark;n&&RM(this.$emacsMarkRing,n),!e||t?this.setEmacsMark(e):RM(this.$emacsMarkRing,e)}popEmacsMark(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.$emacsMarkRing.pop()}getLastEmacsMark(){return this.$emacsMark||this.$emacsMarkRing.slice(-1)[0]}getCopyText(){var e=this.view.state;return e.selection.ranges.map(t=>e.sliceDoc(t.from,t.to)).join(`
|
|
79
|
+
`)}clearSelection(){var e=this.view,t=e.state.selection;if(!t.ranges.some(e=>e.from!=e.to))return!1;var n=t.ranges.map(e=>G.range(e.head,e.head));return e.dispatch({selection:G.create(n,t.mainIndex)}),!0}onPaste(e){var t=this.view,n=t.state.selection,r;if(n.ranges.length>1){var i=e.split(`
|
|
80
|
+
`);i.length==n.ranges.length&&(r=i)}var a=0,o=t.state.changeByRange(t=>{var n=r?r[a]:e;return a++,{changes:{from:t.from,to:t.to,insert:n},range:G.cursor(t.from+n.length)}});t.dispatch(o)}selectionToEmacsMark(){return this.view.state.selection.ranges.map(e=>e.head)}};LM.commands={};function RM(e,t){e.length&&e[e.length-1]+``==t+``||e.push(t)}var zM={"Up|C-p":{command:`goOrSelect`,args:[xx,Xx]},"Down|C-n":{command:`goOrSelect`,args:[Sx,Zx]},"Left|C-b":{command:`goOrSelect`,args:[fx,Vx]},"Right|C-f":{command:`goOrSelect`,args:[dx,Bx]},"C-Left|M-b":{command:`goOrSelect`,args:[mx,Ux]},"C-Right|M-f":{command:`goOrSelect`,args:[hx,Wx]},"Home|C-a":{command:`goOrSelect`,args:[Mx,aS]},"End|C-e":{command:`goOrSelect`,args:[Nx,oS]},"C-Home|S-M-,":{command:`goOrSelect`,args:[sS,lS]},"C-End|S-M-.":{command:`goOrSelect`,args:[cS,uS]},"S-Up|S-C-p":Xx,"S-Down|S-C-n":Zx,"S-Left|S-C-b":Vx,"S-Right|S-C-f":Bx,"S-C-Left|S-M-b":Kx,"S-C-Right|S-M-f":Gx,"S-Home|S-C-a":aS,"S-End|S-C-e":oS,"S-C-Home":lS,"S-C-End":uS,"C-l":`recenterTopBottom`,"M-s":`centerSelection`,"M-g":`gotoline`,"C-x C-p|C-x h":dS,"PageDown|C-v|C-Down":{command:`goOrSelect`,args:[Ex,eS]},"PageUp|M-v|C-Up":{command:`goOrSelect`,args:[Tx,eS]},"S-C-Down":eS,"S-C-Up":$x,"C-s":xj,"C-r":xj,"M-C-s":`findnext`,"M-C-r":`findprevious`,"S-M-5":`replace`,Backspace:xS,"Delete|C-d":SS,"Return|C-m":{command:`insertstring`,args:`
|
|
81
|
+
`},"C-o":kS,"M-d|C-Delete":{command:`killWord`,args:`right`},"C-Backspace|M-Backspace|M-Delete":{command:`killWord`,args:`left`},"C-k":`killLine`,"M-h":`selectParagraph`,"M-@|M-S-2":`markWord`,"C-y|S-Delete":`yank`,"M-y":`yankRotate`,"C-g":`keyboardQuit`,"C-w|C-S-w":`killRegion`,"M-w":`killRingSave`,"C-Space":`setMark`,"C-x C-x":`exchangePointAndMark`,"C-t":AS,"M-u":{command:`changeCase`,args:{dir:1}},"M-l":{command:`changeCase`,args:{dir:-1}},"C-x C-u":{command:`changeCase`,args:{dir:1,region:!0}},"C-x C-l":{command:`changeCase`,args:{dir:1,region:!0}},"M-/":BC,"C-u":`universalArgument`,"M-;":xb,"C-/|C-x u|S-C--|C-z":zb,"S-C-/|S-C-x u|C--|S-C-z":Bb,"C-x r":`selectRectangularRegion`,"M-x":{command:`focusCommandLine`,args:`M-x `},Esc:`unsetTransientMark`};for(let e in zM)zM[e];var BM=A(null),VM=null,HM=class extends Rd{toDOM(){let e=document.createElement(`span`);return e.className=`cm-block-cursor`,e.textContent=` `,e}},UM=pp.fromClass(class{decorations=Bd.none;constructor(e){this.decorations=this.build(e)}update(e){this.decorations=this.build(e.view)}build(e){let t=bM(e)?.state.vim;if(t!==void 0&&t.insertMode!==!0)return Bd.none;let n=e.state.selection.main.head,r=e.state.doc.lineAt(n);if(n>=r.to)return Bd.set([Bd.widget({widget:new HM,side:1}).range(n)]);let i=String.fromCodePoint(r.text.codePointAt(n-r.from));return Bd.set([Bd.mark({class:`cm-block-cursor`}).range(n,n+i.length)])}},{decorations:e=>e.decorations}),WM=$y.define([{tag:Z.heading,color:`var(--c-accent)`,fontWeight:`bold`},{tag:[Z.monospace,Z.link,Z.url],color:`var(--c-accent)`},{tag:[Z.processingInstruction,Z.contentSeparator,Z.labelName,Z.comment],color:`var(--c-mute)`},{tag:Z.quote,color:`var(--c-text-soft)`},{tag:Z.emphasis,fontStyle:`italic`},{tag:Z.strong,fontWeight:`bold`}]),GM=e=>`ase-task-board:draft:${z.value?.project??``}:${e}`,KM=e=>{try{return localStorage.getItem(GM(e))}catch{return null}},qM=(e,t)=>{try{t===null?localStorage.removeItem(GM(e)):localStorage.setItem(GM(e),t)}catch{}},JM=async(e=!1)=>{if(H.value===null||Ts.value!==null)return;let t=H.value.id,n=await ps(`/task-board/api/task/${encodeURIComponent(t)}/source`);H.value?.id===t&&Ts.value===null&&(n.error===void 0?(await Hc(0),await XM(t,n.text,n.base,n.keymap,e)):Es.value={kind:`error`,message:n.error})},YM=async()=>{if(H.value!==null||Ts.value!==null)return;let e=await ps(`/task-board/api/new`);H.value===null&&Ts.value===null&&(e.error===void 0?(hs.value=null,js.value=0,Ms.value={},H.value={id:`new`,title:`New Task`,tone:`idle`,status:``,group:``,epic:``,doc:``,tabs:[`0 ▶ plan`],pred:[],succ:[]},await XM(``,e.text,``,e.keymap,!0)):hs.value=e.error)},XM=async(e,t,n,r,i)=>{let a=KM(e);Ts.value={id:e,orig:t,base:n,keymap:r,dirty:!1,direct:i},Es.value=a!==null&&a!==t?{kind:`draft`,draft:a}:null,await Mn(),VM=new J({parent:BM.value,state:Iu.create({doc:t,extensions:[...r===`vim`?[yM({status:!0})]:r===`emacs`?[NM()]:[],Lb(),Yg(),J.lineWrapping,Ag.of([...XS,...nx,ZS]),OA(),rb(WM),UM,J.updateListener.of(e=>{e.docChanged&&Ts.value!==null&&(Ts.value.dirty=e.state.doc.toString()!==Ts.value.orig)})]})}),VM.focus()},ZM=async e=>{let t=Ts.value;if(t===null||VM===null)return;let n=VM.state.doc.toString();if(t.id===``){await QM(t,n);return}let r=await ps(`/task-board/api/task/${encodeURIComponent(t.id)}/source`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:n,base:e??t.base})});if(Ts.value!==t)return;if(r.error===void 0){qM(t.id,null),nN(),r.id===t.id?t.direct||Fc(t.id):(zc(),Ic(t.direct?null:r.id),U.value={...U.value,id:r.id});return}qM(t.id,n);let i=r;Es.value=i.base===void 0?{kind:`error`,message:`${i.error} (draft kept)`}:{kind:`conflict`,message:i.error,base:i.base}},QM=async(e,t)=>{if(!e.dirty){nN();return}let n=/^---\r?\n([\s\S]*?\r?\n)---\r?\n/.exec(t),r=/^Id:[ \t]*(.*)$/m.exec(n?.[1]??``)?.[1].trim()??``,i=r===``?{error:`no task id in the "Id:" line`}:await ps(`/task-board/api/task/${encodeURIComponent(r)}/source`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:t})});Ts.value===e&&(i.error===void 0?(qM(``,null),nN(),U.value={...U.value,id:r}):(qM(``,t),Es.value={kind:`error`,message:`${i.error} (draft kept)`}))},$M=()=>{Es.value?.kind===`draft`&&VM!==null&&VM.dispatch({changes:{from:0,to:VM.state.doc.length,insert:Es.value.draft}}),Es.value=null,VM?.focus()},eN=()=>{Ts.value!==null&&qM(Ts.value.id,null),Es.value=null,VM?.focus()},tN=e=>{Ts.value?.dirty===!0?Es.value={kind:`discard`,close:e}:e?zc():nN()};uM.defineEx(`write`,`w`,()=>{ZM()}),uM.defineEx(`wq`,`wq`,()=>{ZM()}),uM.defineEx(`xit`,`x`,()=>{ZM()}),uM.defineEx(`quit`,`q`,(e,t)=>{t.argString?.trimStart().startsWith(`!`)?nN():tN(!1)}),LM.bindKey(`C-x C-s`,()=>(ZM(),!0)),LM.bindKey(`C-x C-c`,()=>(tN(!1),!0));var nN=()=>{let e=Ts.value?.direct===!0;VM?.destroy(),VM=null,Ts.value=null,Es.value=null,e&&zc()};Rc(nN);var rN=(e,t)=>{(t===`emacs`?e.metaKey:e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`s`?(e.preventDefault(),ZM()):e.key===`Escape`&&t==="default"&&(Es.value?.kind===`discard`?(Es.value=null,VM?.focus()):tN(!1))},iN=async e=>{Ds.value=null;let t=await ps(`/task-board/api/task/${encodeURIComponent(e)}`,{method:`DELETE`});hs.value=t.error??null,t.error===void 0&&H.value?.id===e&&zc()},aN=R(()=>{let e=Os.value,t=z.value,n=t?.groups.flatMap(e=>e.lanes).find(t=>t.cards.some(t=>t.id===e?.id));if(e===null||t===null||n===void 0)return[];let r=n.cards.find(t=>t.id===e.id)?.moves??t.moves[n.status]??[];return t.groups.flatMap(e=>e.lanes.map(t=>({group:e.title,status:t.status,current:t.status===n.status,ok:t.status===n.status||r.includes(t.status)})))}),oN=e=>{let t=z.value?.groups.flatMap(e=>e.lanes).find(t=>t.cards.some(t=>t.id===e));t!==void 0&&(Os.value={id:e,at:t.status})},sN=()=>{Os.value=null},cN=(e,t)=>{let n=aN.value.find(e=>e.status===t);Os.value=null,n!==void 0&&n.ok&&!n.current&&HN(e,t)},lN=A(null),uN=R(()=>{let e=z.value?.users.length?z.value.users:[z.value?.self??``].filter(e=>e!==``),t=new Set(tc.value.filter(e=>e.kind!==`editor`&&e.request===void 0&&(e.states===void 0||e.states.activity!==void 0)).map(e=>e.name));return[{name:`none`,kind:`none`},...[...new Set(e)].sort().map(e=>({name:e,kind:`user`})),...[...t].filter(t=>!e.includes(t)).sort().map(e=>({name:e,kind:`agent`}))]}),dN=R(()=>{let e=ks.value?.typed.toLowerCase()??``;return e===``||uN.value.some(e=>e.name===ks.value?.typed)?uN.value:uN.value.filter(t=>t.name.toLowerCase().includes(e))}),fN=R(()=>{let e=ks.value?.name.trim()??``;return(z.value?.users.length??0)>0&&e!==``&&e!==`me`&&e!==z.value?.self&&!uN.value.some(t=>t.name===e)}),pN=e=>{ks.value={id:e,name:z.value?.groups.flatMap(e=>e.lanes).flatMap(e=>e.cards).find(t=>t.id===e)?.assignee??``,typed:``},Mn(()=>lN.value?.select())},mN=()=>{ks.value!==null&&(ks.value.typed=ks.value.name)},hN=()=>{ks.value=null},gN=async(e,t)=>{ks.value=null;let n=await ps(`/task-board/api/assign`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,assignee:t})});n.error===void 0?n.warning===``?(hs.value=null,zN(`task "${e}" assigned from "${n.from||`(nobody)`}" to "${n.to||`(nobody)`}"`)):hs.value=`task "${e}" assigned to "${n.to||`(nobody)`}" -- warning: ${n.warning}`:hs.value=`assigning task "${e}" failed: ${n.error}`},_N=()=>{ks.value!==null&&gN(ks.value.id,ks.value.name)},vN=new Map,yN=new Map,bN=A(null),xN=A(null),SN=A(null),CN=A(null),wN=A(``),TN=A(!1),EN=async e=>{let t=z.value?.groups.flatMap(e=>e.lanes).flatMap(e=>e.cards).find(t=>t.id===e);if(t?.finished===!0){hs.value=`editing task "${e}" by prompt refused: task is finished`;return}if(t?.edit===`active`){hs.value=`editing task "${e}" by prompt refused: edit in progress`;return}let n=vN.get(e);if(n===void 0||t===void 0){let t=await ps(`/task-board/api/task/${encodeURIComponent(e)}/edit`);if(t.error!==void 0){hs.value=t.error;return}if(n??=t.prompt,Ds.value!==null||Os.value!==null||ks.value!==null||W.value!==null)return}W.value={id:e,text:n,name:null},Mn(()=>bN.value?.focus())},DN=R(()=>[...new Set(tc.value.map(e=>e.kind===`editor`?`edit`:e.request??``).filter(e=>e!==``))].sort()),ON=R(()=>{let e=wN.value.trim().toLowerCase();return e===``||DN.value.includes(e)?DN.value:DN.value.filter(t=>t.toLowerCase().includes(e))}),kN=()=>{wN.value=W.value?.name??``},AN=e=>{TN.value=e},jN=e=>{let t=tc.value.filter(t=>(t.kind===`editor`?`edit`:t.request??``)===e);return t.length===0||t.some(e=>e.prompt===void 0)?`required`:t.every(e=>e.prompt===`ignored`)?`ignored`:`optional`},MN=R(()=>W.value!==null&&W.value.name!==null&&jN(W.value.name.trim())===`ignored`),NN=()=>{Mn(()=>(MN.value?SN.value:bN.value)?.focus())},PN=e=>{W.value!==null&&(W.value.name=e,NN())},FN=e=>{if(z.value?.groups.flatMap(e=>e.lanes).flatMap(e=>e.cards).find(t=>t.id===e)?.finished===!0){hs.value=`requesting task "${e}" by prompt refused: task is finished`;return}let t=yN.get(e),n=t?.name??DN.value[0]??``;W.value={id:e,text:t?.text??``,name:n},wN.value=``,TN.value=!1,n===``?Mn(()=>xN.value?.focus()):NN()},IN=()=>{W.value!==null&&W.value.name!==null?yN.set(W.value.id,{name:W.value.name,text:W.value.text}):W.value!==null&&vN.set(W.value.id,W.value.text),W.value=null},LN=async e=>{let t=jN(e.name.trim());if(e.name.trim()===``||e.text.trim()===``&&t===`required`){hs.value=`requesting task "${e.id}" by prompt failed: empty ${e.name.trim()===``?`request name`:`prompt`}`;return}W.value=null;let n=await ps(`/task-board/api/task/${encodeURIComponent(e.id)}/request`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e.name.trim(),prompt:t===`ignored`?``:e.text})});n.error===void 0?(yN.delete(e.id),hs.value=null,zN(`"${e.name.trim()}" of task "${e.id}" requested`)):(yN.set(e.id,{name:e.name,text:e.text}),hs.value=`requesting "${e.name}" of task "${e.id}" failed: ${n.error}`)},RN=null,zN=e=>{gs.value=e,RN!==null&&clearTimeout(RN),RN=setTimeout(()=>{gs.value=null,RN=null},5e3)},BN=async()=>{let e=W.value;if(e===null)return;if(e.name!==null){await LN({...e,name:e.name});return}if(e.text.trim()===``){hs.value=`requesting edit of task "${e.id}" failed: empty edit prompt`;return}W.value=null;let t=await ps(`/task-board/api/task/${encodeURIComponent(e.id)}/edit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e.text})});t.error===void 0?(vN.delete(e.id),hs.value=null,zN(`edit of task "${e.id}" requested`)):(vN.set(e.id,e.text),hs.value=`requesting edit of task "${e.id}" failed: ${t.error}`)},VN=e=>Ys.value!==null&&(Ys.value.moves??z.value?.moves[Ys.value.from]??[]).includes(e),HN=async(e,t)=>{hs.value=(await ps(`/task-board/api/move`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,status:t})})).error??null};$n([z,sc,B],()=>{let e=z.value;if(e===null||e.groups.length===0)return;let t=Ys.value;t?.key===!0&&e.groups.flatMap(e=>e.lanes).find(e=>e.cards.some(e=>e.id===t.id))?.status!==t.from&&(Ys.value=null,hs.value=`moving task "${t.id}" cancelled: task changed in the meantime`),Os.value!==null&&aN.value.length===0&&(hs.value=`transferring task "${Os.value.id}" cancelled: task vanished in the meantime`,Os.value=null),B.value===`lanes`&&(U.value=as(e,U.value,sc.value))}),$n([U,_s,B,H,wc],()=>{let e=Ys.value,t=z.value?.groups[U.value.g];e?.key===!0&&(e.over=t===void 0||sc.value.collapsed.includes(t.title)?null:t.lanes[U.value.l]?.status??null)});var UN=e=>{let t=Ks.value?.contentWindow??null;if(e.key===`Escape`||e.key===`Enter`)zc();else if(e.key===`e`&&!e.ctrlKey&&!e.metaKey&&!e.altKey)e.preventDefault(),JM();else if(e.key===`E`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&H.value!==null)e.preventDefault(),EN(H.value.id);else if(e.key===`R`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&H.value!==null)e.preventDefault(),FN(H.value.id);else if(e.key===`D`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&H.value!==null)e.preventDefault(),Ds.value=H.value.id;else if(e.key===`T`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&H.value!==null)e.preventDefault(),oN(H.value.id);else if(e.key===`A`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&H.value!==null)e.preventDefault(),pN(H.value.id);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`Tab`)e.preventDefault(),Hc(js.value+(e.key===`ArrowLeft`||e.key===`Tab`&&e.shiftKey?-1:1));else if(t!==null&&(e.key===`ArrowUp`||e.key===`ArrowDown`))e.preventDefault(),t.scrollBy({top:e.key===`ArrowUp`?-40:40});else if(t!==null&&(e.key===`PageUp`||e.key===`PageDown`)){e.preventDefault();let n=Math.max(40,t.innerHeight-40);t.scrollBy({top:e.key===`PageUp`?-n:n})}},WN=e=>new Map([...e?.querySelectorAll(`g.node[data-id]`)??[]].map(e=>{let t=e.querySelector(`foreignObject, rect`),n=e=>Number(t?.getAttribute(e)??0);return[e.dataset.id,{r:n(`y`)+n(`height`)/2,c:n(`x`)+n(`width`)/2}]})),GN=(e,t,n=Ws.value)=>{let r=WN(n),i=r.get(t);if(i===void 0)return[...r].sort(([,e],[,t])=>e.c-t.c||e.r-t.r)[0]?.[0];let a=1/0,o;for(let[n,s]of r){let r=s.r-i.r,c=s.c-i.c;if(n===t||!(e===`ArrowRight`?c>0:e===`ArrowLeft`?c<0:e===`ArrowDown`?r>0:r<0))continue;let l=e===`ArrowLeft`||e===`ArrowRight`?Math.abs(c)+Math.abs(r)*4:Math.abs(r)+Math.abs(c)/4;l<a&&(a=l,o=n)}return o},KN=(e,t,n,r)=>{let i=Math.max(...e.groups.map(e=>e.lanes.length)),a=[];for(let t=0;t<i;t++)e.groups.forEach((e,r)=>{t<e.lanes.length&&!n.collapsed.includes(e.title)&&a.push({g:r,l:t})});if(a.length===0)return;let o=a.findIndex(e=>e.g===t.g&&e.l===t.l),s=o<0?a[r?a.length-1:0]:a[(o+(r?a.length-1:1))%a.length];return rs(e,s.g,n).find(e=>e.l===s.l)},qN=e=>{if(e.target instanceof HTMLInputElement||e.ctrlKey||e.metaKey||e.altKey)return;let t=tc.value,n=t.findIndex(e=>e.id===rc.value?.id),r=ic.value;if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&t.length>0)oc(t[Math.max(0,Math.min(t.length-1,n+(e.key===`ArrowUp`?-1:1)))].id);else if(r!==null&&(e.key===`PageUp`||e.key===`PageDown`))r.scrollBy({top:(e.key===`PageUp`?-1:1)*Math.round(r.clientHeight*.9)});else if(r!==null&&(e.key===`Home`||e.key===`End`))r.scrollTop=e.key===`Home`?0:r.scrollHeight;else return;e.preventDefault()},JN=(e,t,n)=>{if(e.key===`Enter`)t!==``&&Fc(t);else if(e.key===`e`)t!==``&&Fc(t).then(()=>{H.value?.id===t&&JM(!0)});else if(e.key===`N`)YM();else if(e.key===`E`)t!==``&&!n&&EN(t);else if(e.key===`R`)t!==``&&!n&&FN(t);else if(e.key===`D`)t!==``&&(Ds.value=t);else if(e.key===`T`)t!==``&&!n&&oN(t);else if(e.key===`A`)t!==``&&!n&&pN(t);else return!1;return!0},YN=(e,t,n)=>{if(e.key===`Escape`)return ws.value=!1,!0;let r=Us.value?.querySelector(`.lane.grown .cards`)??null,i=r===null?4:Math.max(1,getComputedStyle(r).gridTemplateColumns.split(` `).length),a=r?.querySelector(`.card`)??null,o=i*(r===null||a===null?1:Math.max(1,Math.floor(r.clientHeight/(a.offsetHeight+8)))),s=n.findIndex(e=>e.id===t.id),c=e.key===`ArrowLeft`?-1:e.key===`ArrowRight`?1:e.key===`ArrowUp`?-i:e.key===`ArrowDown`?i:e.key===`PageUp`?-o:e.key===`PageDown`?o:e.key===`Home`?-n.length:e.key===`End`?n.length:0;if(c===0)return!1;if(n.length>0&&!(e.key===`ArrowUp`&&s>=0&&s<i)){let e=s<0?0:Math.max(0,Math.min(n.length-1,s+c));U.value={...t,id:n[e].id}}return!0},XN=(e,t,n)=>{let r=t.lanes[e.l].cards.find(t=>t.id===e.id),i=t.lanes[e.l].status;n===null?r!==void 0&&(hs.value=null,Ys.value={id:r.id,from:i,moves:r.moves,over:null,key:!0},ws.value=!1):sc.value.collapsed.includes(t.title)||(i===n.from?Ys.value=null:VN(i)?(Ys.value=null,U.value={...e,id:n.id},HN(n.id,i)):hs.value=`task "${n.id}" cannot move from ${n.from} to ${i}: not reachable in the lifecycle model`)},ZN=e=>{if(B.value===`agents`){qN(e);return}if(B.value===`flow`){if(e.target instanceof HTMLInputElement||e.ctrlKey||e.metaKey||e.altKey)return;if(e.key===`Enter`)Sc(xs.value);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`){let t=GN(e.key,xs.value,Gs.value);t!==void 0&&(xs.value=t)}else return;e.preventDefault();return}if(B.value===`stats`){if(e.target instanceof HTMLInputElement||e.ctrlKey||e.metaKey||e.altKey)return;(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(Nc(e.key===`ArrowLeft`?-1:1),e.preventDefault());return}let t=z.value;if(t===null||t.groups.length===0||e.target instanceof HTMLInputElement||e.ctrlKey||e.metaKey||e.altKey)return;let n=U.value,r=sc.value,i=t.groups[n.g],a=Ys.value?.key===!0?Ys.value:null,o=e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`;if(JN(e,n.id,a!==null))e.preventDefault();else{if(B.value===`graph`){if(!o)return;let t=GN(e.key,n.id);t!==void 0&&(U.value={...n,id:t})}else if(e.key===`g`){if(a!==null)return;!wc.value&&!Cc.value?hs.value=`only a maximized lane of an expanded phase can grow`:(hs.value=null,ws.value=!wc.value)}else if(wc.value&&e.key!==` `){if(!YN(e,n,i.lanes[n.l].cards))return}else if(e.key===`Escape`){if(a===null)return;Ys.value=null,U.value=as(t,{...n,id:a.id},r)}else if(e.key===` `)XN(n,i,a);else if(e.key===`m`)r.collapsed.includes(i.title)||Jc(`minimized`,i.lanes[n.l].status);else if(e.key===`c`)Jc(`collapsed`,i.title);else if(e.key===`C`){let e=is(t,r,n.l);e.length>0&&Jc(`minimized`,e)}else if(e.key===`ArrowLeft`||e.key===`ArrowRight`){let i=Math.max(0,Math.min(t.groups.length-1,n.g+(e.key===`ArrowLeft`?-1:1)));if(i!==n.g){let e=rs(t,i,r);U.value=e.find(e=>e.l===n.l)??e[0]}}else if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&a===null){let i=rs(t,n.g,r),a=i.findIndex(e=>e.l===n.l&&e.id===n.id),o=i[Math.max(0,Math.min(i.length-1,a+(e.key===`ArrowUp`?-1:1)))];o!==void 0&&(U.value=o)}else if(e.key===`PageUp`||e.key===`PageDown`||o){let a=e.key===`PageUp`||e.key===`ArrowUp`,o=Math.max(0,Math.min(i.lanes.length-1,n.l+(a?-1:1))),s=rs(t,n.g,r).find(e=>e.l===o);s!==void 0&&o!==n.l&&(U.value=s)}else if(e.key===`Tab`){let i=KN(t,n,r,e.shiftKey);i!==void 0&&(U.value=i)}else return;e.preventDefault()}},QN=(e,t)=>{e.key===`y`?iN(t):(e.key===`Escape`||e.key===`n`)&&(Ds.value=null),e.preventDefault()},$N=(e,t)=>{let n=aN.value;if(e.key===`ArrowUp`||e.key===`ArrowDown`){let r=e.key===`ArrowUp`?-1:1;for(let e=n.findIndex(e=>e.status===t.at)+r;e>=0&&e<n.length;e+=r)if(n[e].ok){Os.value={...t,at:n[e].status},Mn(()=>document.querySelector(`#transfer .sel`)?.scrollIntoView({block:`nearest`}));break}}else e.key===`Enter`?cN(t.id,t.at):e.key===`Escape`&&sN();e.preventDefault()},eP=(e,t)=>{if(e.isComposing||e.keyCode===229)return;let n=dN.value.map(e=>e.name);if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&n.length>0){e.preventDefault();let r=n.indexOf(t.name),i=n.length,a=e.key===`ArrowUp`;t.name=n[r<0?a?i-1:0:(r+(a?i-1:1))%i],Mn(()=>document.querySelector(`#assign .sel`)?.scrollIntoView({block:`nearest`}))}else e.key===`Enter`&&!(e.target instanceof HTMLButtonElement)?(e.preventDefault(),_N()):e.key===`Escape`?(e.preventDefault(),hN()):e.key===`Tab`&&e.preventDefault()},tP=e=>{if(e.isComposing||e.keyCode===229)return;let t=ON.value;if(e.key===`Tab`&&!e.ctrlKey&&!e.altKey&&!e.metaKey){e.preventDefault();let t=[xN.value,bN.value,SN.value,CN.value].filter(e=>e!==null&&e.isConnected),n=t.findIndex(e=>e===document.activeElement),r=t.length;r>0&&t[n<0?0:(n+(e.shiftKey?r-1:1))%r].focus()}else if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&e.target===xN.value&&W.value!==null&&W.value.name!==null&&t.length>0){e.preventDefault();let n=t.indexOf(W.value.name),r=t.length,i=e.key===`ArrowUp`;W.value.name=t[n<0?i?r-1:0:(n+(i?r-1:1))%r]}else e.key===`Enter`&&!e.shiftKey&&e.target===xN.value&&xN.value!==null?(e.preventDefault(),NN()):e.key===`Enter`&&!e.shiftKey&&!(e.target instanceof HTMLButtonElement)?(e.preventDefault(),BN()):e.key===`Escape`&&(e.preventDefault(),IN())},nP=e=>{Ds.value===null?Os.value===null?ks.value===null?W.value===null?Ts.value===null?H.value===null?ZN(e):UN(e):rN(e,Ts.value.keymap):tP(e):eP(e,ks.value):$N(e,Os.value):QN(e,Ds.value)},rP=e=>{cs.value!==null&&(e.preventDefault(),e.stopImmediatePropagation())},iP=()=>{al.default.bind(`t`,()=>{z.value!==null&&(B.value===`lanes`||B.value===`graph`)&&Jc(`titles`,``)}),al.default.bind(`s`,()=>{z.value!==null&&B.value===`graph`&&H.value===null&&Jc(`standalone`,``)}),al.default.bind(`v`,()=>{H.value===null&&Yc()}),al.default.bind(`V`,()=>{H.value===null&&Yc(!0)}),al.default.bind(`?`,()=>{z.value!==null&&Jc(`keys`,``)}),al.default.bind(`/`,e=>{H.value===null&&B.value!==`agents`&&B.value!==`flow`&&(e.preventDefault(),Js.value?.focus())}),window.addEventListener(`keydown`,rP,!0),document.addEventListener(`keydown`,nP)},aP=()=>{al.default.reset(),window.removeEventListener(`keydown`,rP,!0),document.removeEventListener(`keydown`,nP),RN!==null&&clearTimeout(RN)},oP={key:0,class:`group coll`},sP=[`onClick`,`onDblclick`],cP=[`onClick`,`onDblclick`,`onDragover`,`onDragleave`,`onDrop`],lP={class:`vt`},uP={class:`cnt`},dP=[`onClick`,`onDblclick`],fP={class:`ttl`},pP=[`onClick`,`onDblclick`,`onDragover`,`onDragleave`,`onDrop`],mP=[`title`],hP={class:`ttl`},gP={key:0,class:`cards`,tabindex:`-1`},_P={class:`cbody`},vP=[`onClick`,`onDblclick`,`onDragstart`],yP={key:0,class:`cagents`},bP={class:`aicon`},xP={class:`cbody`},SP=ur({__name:`ase-task-board-web-client-lanes`,setup(e){let t=(e,t)=>{if(z.value===null||U.value.g===e&&U.value.l===t)return;let n=rs(z.value,e,sc.value).find(e=>e.l===t);n!==void 0&&(U.value=n)},n=e=>{if(z.value===null||U.value.g===e)return;let t=rs(z.value,e,sc.value);U.value=t.find(e=>e.l===U.value.l)??t[0]},r=R(()=>{let e=Ys.value;return e?.key!==!0||e.over===null||!VN(e.over)?null:z.value?.groups.flatMap(e=>e.lanes).flatMap(e=>e.cards).find(t=>t.id===e.id)??null}),i=e=>Ys.value?.id===e?{dragging:Ys.value.key!==!0,held:Ys.value.key===!0&&r.value===null,ghost:Ys.value.key===!0&&r.value!==null}:{},a=e=>Ys.value===null?{}:{target:VN(e),over:VN(e)&&Ys.value.over===e,blocked:!VN(e)&&e!==Ys.value.from},o=(e,t,n,r)=>{Ys.value={id:t,from:n,moves:r,over:null},e.dataTransfer!==null&&(e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`)},s=(e,t)=>{VN(t)&&(e.preventDefault(),e.dataTransfer!==null&&(e.dataTransfer.dropEffect=`move`),Ys.value.over=t)},c=(e,t)=>{Ys.value?.over===t&&!e.currentTarget.contains(e.relatedTarget)&&(Ys.value.over=null)},l=()=>{Ys.value=null},u=async(e,t)=>{e.preventDefault();let n=Ys.value;n!==null&&VN(t)&&(Ys.value=null,await HN(n.id,t))},d=()=>{if(B.value!==`lanes`)return;(Us.value?.querySelector(`.card.sel`)??Us.value?.querySelector(`.lane.sel`))?.scrollIntoView({block:`nearest`,inline:`nearest`});let e=Us.value?.querySelector(`.lane.sel .cards`)??Us.value?.querySelector(`.lane.sel`);H.value===null&&!(document.activeElement instanceof HTMLInputElement)&&e?.focus({preventScroll:!0})};return $n([U,_s,B,H,wc],()=>Mn(d)),(e,d)=>qn((N(),P(`div`,{id:`board`,ref_key:`boardEl`,ref:Us,class:O({titles:j(cc),grown:j(wc)}),onScroll:d[0]||=(...e)=>j(Tc)&&j(Tc)(...e)},[j(ms)===null?L(``,!0):(N(),P(M,{key:0},[I(k(j(ms)),1)],64)),(N(!0),P(M,null,Fr(j(z)?.groups??[],(e,f)=>(N(),P(M,{key:e.title},[j(sc).collapsed.includes(e.title)?(N(),P(`div`,oP,[F(`div`,{class:O([`ghd`,{sel:j(U).g===f}]),onClick:e=>n(f),onDblclick:t=>j(Jc)(`collapsed`,e.title)},[...d[1]||=[F(`span`,{class:`arr right`},`▼`,-1)]],42,sP),(N(!0),P(M,null,Fr(e.lanes,(n,r)=>(N(),P(`div`,{key:n.status,class:O([`lane`,[{active:n.active,dashed:n.dashed,done:n.kind===`terminal`,sel:j(U).g===f&&j(U).l===r},a(n.status)]]),tabindex:`-1`,style:be({flex:`${n.weight} 1 0`}),onClick:e=>t(f,r),onDblclick:t=>j(Jc)(`collapsed`,e.title),onDragover:e=>s(e,n.status),onDragleave:e=>c(e,n.status),onDrop:e=>u(e,n.status)},[d[2]||=F(`span`,{class:`arr right`},`▼`,-1),F(`span`,lP,k(n.status.toUpperCase()),1),F(`span`,uP,k(n.cards.length),1)],46,cP))),128))])):(N(),P(`div`,{key:1,class:O([`group`,{grown:j(wc)&&j(U).g===f}])},[F(`div`,{class:O([`ghd`,{sel:j(U).g===f}]),onClick:e=>n(f),onDblclick:t=>j(Jc)(`collapsed`,e.title)},[d[3]||=F(`span`,{class:`arr`},`▼`,-1),F(`span`,fP,k(e.title),1)],42,dP),(N(!0),P(M,null,Fr(e.lanes,(e,n)=>(N(),P(`div`,{key:e.status,class:O([`lane`,[{active:e.active,dashed:e.dashed,done:e.kind===`terminal`,min:j(sc).minimized.includes(e.status),sel:j(U).g===f&&j(U).l===n,grown:j(wc)&&j(U).g===f&&j(U).l===n},a(e.status)]]),tabindex:`-1`,style:be({flex:`${e.weight} 1 0`}),onClick:e=>t(f,n),onDblclick:t=>j(wc)?ws.value=!1:j(Jc)(`minimized`,e.status),onDragover:t=>s(t,e.status),onDragleave:t=>c(t,e.status),onDrop:t=>u(t,e.status)},[F(`div`,{class:`lhd`,title:j(wc)?`shrink lane (g)`:``},[F(`span`,null,[I(k(j(wc)?`◆`:j(sc).minimized.includes(e.status)?`▶`:`▼`),1),F(`span`,hP,k(e.status),1)]),F(`span`,null,k(e.cards.length),1)],8,mP),j(sc).minimized.includes(e.status)?L(``,!0):(N(),P(`div`,gP,[r.value!==null&&j(Ys)?.over===e.status?(N(),P(`div`,{key:0,class:O([`card held sel carried`,`tone-${r.value.tone}`])},[F(`div`,_P,[ua($o,{id:r.value.id,epic:r.value.group,title:r.value.title,edit:r.value.edit,effort:r.value.effort},null,8,[`id`,`epic`,`title`,`edit`,`effort`])])],2)):L(``,!0),(N(!0),P(M,null,Fr(e.cards,t=>(N(),P(`div`,{key:t.id,class:O([`card`,[`tone-${t.tone}`,{sel:j(U).id===t.id,badged:j(fc).has(t.id)},i(t.id)]]),draggable:`true`,onClick:e=>U.value={g:f,l:n,id:t.id},onDblclick:zo(e=>j(Fc)(t.id),[`stop`]),onDragstart:n=>o(n,t.id,e.status,t.moves),onDragend:l},[j(fc).has(t.id)?(N(),P(`div`,yP,[(N(!0),P(M,null,Fr(j(fc).get(t.id),(e,t)=>(N(),P(`span`,{key:t,class:`cagent`},[F(`span`,bP,k(e.icon),1),I(` `+k(e.name),1)]))),128))])):L(``,!0),F(`div`,xP,[ua($o,{id:t.id,epic:t.group,title:t.title,edit:t.edit,effort:t.effort},null,8,[`id`,`epic`,`title`,`edit`,`effort`])])],42,vP))),128))]))],46,pP))),128))],2))],64))),128))],34)),[[eo,j(B)===`lanes`]])}}),CP={id:`gframe`},wP=[`innerHTML`],TP={key:0,class:`gstats`},EP=ur({__name:`ase-task-board-web-client-graph`,setup(e){let t=A(null),n=1,r=e=>{let t=e.target.closest(`g.node[data-id]`);t!==null&&(U.value={...U.value,id:t.dataset.id},e.type===`dblclick`&&Fc(t.dataset.id))},i=()=>{let e=Ws.value?.querySelector(`svg`);if(e==null)return;let t=e.viewBox.baseVal;e.setAttribute(`width`,String(t.width*n)),e.setAttribute(`height`,String(t.height*n))},a=(e,t,r)=>{let a=Ws.value,o=a?.querySelector(`svg`);if(a==null||o==null)return;let s=a.getBoundingClientRect(),c=t??s.left+s.width/2,l=r??s.top+s.height/2,u=o.getBoundingClientRect(),d=(c-u.left)/u.width,f=(l-u.top)/u.height;n=Math.min(4,Math.max(.1,n*e)),i();let p=o.getBoundingClientRect();a.scrollLeft+=p.left+d*p.width-c,a.scrollTop+=p.top+f*p.height-l},o=e=>{e.preventDefault();let t=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?400:1);a(Math.exp(-t*.002),e.clientX,e.clientY)},s=e=>{let n=Ws.value;n!==null&&e.button===0&&e.target.closest(`g.node`)===null&&(e.preventDefault(),n.setPointerCapture(e.pointerId),t.value={x:e.clientX,y:e.clientY,left:n.scrollLeft,top:n.scrollTop})},c=e=>{let n=Ws.value;n!==null&&t.value!==null&&(n.scrollLeft=t.value.left-(e.clientX-t.value.x),n.scrollTop=t.value.top-(e.clientY-t.value.y))},l=()=>{Ws.value?.querySelectorAll(`g.node[data-id]`).forEach(e=>{let t=e.querySelector(`.card`);if(t===null)return;t.querySelector(`.cagents`)?.remove();let n=dc(e.dataset.id??``,e.dataset.assignee??``);if(t.classList.toggle(`badged`,n.length>0),n.length===0)return;let r=document.createElement(`div`);r.className=`cagents`;for(let e of n){let t=document.createElement(`span`);t.className=`aicon`,t.textContent=e.icon;let n=document.createElement(`span`);n.className=`cagent`,n.append(t,` ${e.name}`),r.append(n)}t.prepend(r)})};$n([lc,uc],()=>Mn(l));let u=()=>{let e=U.value.id;Ws.value?.querySelectorAll(`g.node[data-id]`).forEach(t=>t.classList.toggle(`sel`,t.dataset.id===e)),Oc(Ws.value,e),B.value!==`lanes`&&Ws.value?.querySelector(`.node.sel .card`)?.scrollIntoView({block:`nearest`,inline:`nearest`})};return $n([U,_s,B,H,wc],()=>{Mn(()=>{i(),u(),l()})}),Tr(()=>{al.default.bind(`0`,()=>{B.value===`graph`&&H.value===null&&(n=1,i(),u())}),al.default.bind([`+`,`=`],()=>{B.value===`graph`&&H.value===null&&a(1.25)}),al.default.bind(`-`,()=>{B.value===`graph`&&H.value===null&&a(1/1.25)})}),Or(()=>{al.default.unbind([`0`,`+`,`=`,`-`])}),(e,n)=>qn((N(),P(`div`,CP,[F(`div`,{id:`graph`,ref_key:`graphEl`,ref:Ws,class:O({titles:j(cc),panning:t.value!==null}),onClick:r,onDblclick:r,onWheel:o,onPointerdown:s,onPointermove:c,onPointerup:n[0]||=e=>t.value=null,onPointercancel:n[1]||=e=>t.value=null,innerHTML:j(_s)},null,42,wP),j(vs)===null?L(``,!0):(N(),P(`div`,TP,k(j(vs).tasks)+` tasks, `+k(j(vs).dependencies)+` dependencies`,1))],512)),[[eo,j(B)===`graph`]])}}),DP={id:`agents`},OP={class:`amaster`},kP={class:`alist`},AP=[`onClick`],jP={class:`aname`},MP={class:`abadge`},NP={class:`abeat`},PP={class:`afields`},FP={class:`aval`},IP={class:`aval`},LP={class:`aval atasks`},RP={key:0},zP={class:`aright`},BP={class:`aop`},VP={key:1,class:`aoptext`},HP={class:`aophead`},UP={class:`abadge`},WP={key:0},GP={key:1,class:`aempty`},KP={key:0,class:`aopdesc`},qP={class:`ainfos`},JP={class:`atitle`},YP={key:1,class:`afields`},XP=[`title`],ZP={dir:`ltr`},QP={class:`adetail`},$P={key:0,class:`apos`},eF=ur({__name:`ase-task-board-web-client-agents`,setup(e){let t=R(()=>Xs.value===null||!Xs.value.connected?`agent relay unreachable — reconnecting …`:`no agents running`),n=e=>pc(e.beat-(e.started??e.since)),r=e=>e.user===void 0?`n/a`:`${e.uid!==void 0&&e.uid>=0?e.uid:`n/a`} (${e.user===``?`unknown`:e.user})`,i=R(()=>{let e=rc.value,t=(t,n)=>({title:t,fields:e===null?[]:n(e)});return[t(`Process`,e=>[{name:`host:`,value:e.host},{name:`pid:`,value:String(e.pid)},{name:`uid:`,value:r(e)},{name:`cwd:`,value:e.cwd??`n/a`,start:!0}]),t(`Accounting`,e=>[{name:`uptime:`,value:n(e)},{name:`heartbeat:`,value:`${pc(hc.value-e.beat)} ago`},{name:`usage (total):`,value:a(e.usage?.total)},{name:`usage (last job):`,value:a(e.usage?.last)}])]}),a=e=>{if(e===void 0)return`none`;let t=e.costToken,n=t===null?`n/a`:t<1e3?`${t}`:t<1e6?`${(t/1e3).toFixed(1)}k`:`${(t/1e6).toFixed(1)}M`,r=e.costUSD===null?`$n/a`:`$${e.costUSD.toFixed(2)}`;return`${pc(e.walltimeSec*1e3)}, ${n} tok, ${r}`},o=(e,t=2)=>String(e).padStart(t,`0`),s=e=>{let t=new Date(e);return`${t.getFullYear()}-${o(t.getMonth()+1)}-${o(t.getDate())} ${o(t.getHours())}:${o(t.getMinutes())}:${o(t.getSeconds())}.${o(t.getMilliseconds(),3)}`},c=e=>`[${e.toUpperCase()}]: `,l=ur({name:`AgentLog`,setup(){return()=>{let e=rc.value;if(e===null)return Ba(`div`,{class:[`aempty`,{off:Xs.value!==null&&!Xs.value.connected}]},t.value);let n=Qs.value.get(e.id)??[];if(n.length===0)return Ba(`div`,{class:`aempty`},`(no processing log lines yet)`);let r=new Map;return n.map(e=>{let t=r.get(e.time)??0;return r.set(e.time,t+1),Ba(`div`,{key:`${e.time}:${t}`,class:[`aline`,e.level]},[Ba(`span`,{class:`atime`},`${s(e.time)}:`),` `,...e.task===``?[]:[Ba(`span`,{class:`atask`},`≡ ${e.task}`),` `],`${c(e.level)}${e.msg}`])})}}}),u=A(``),d=()=>{let e=ic.value,t=e===null?[]:Array.from(e.querySelectorAll(`.aline`));if(e===null||t.length===0)u.value=``;else if(e.scrollHeight<=e.clientHeight+1)u.value=`${t.length} lines`;else{let{top:n,bottom:r}=e.getBoundingClientRect(),i=-1,a=-1;t.forEach((e,t)=>{let o=e.getBoundingClientRect();o.bottom>n+1&&o.top<r-1&&(i<0&&(i=t),a=t)}),u.value=i<0?`${t.length} lines`:`lines ${i+1}–${a+1} of ${t.length} · ${ac.value?`following`:`scrolled`}`}},f=()=>{let e=ic.value;e!==null&&(ac.value=e.scrollTop+e.clientHeight>=e.scrollHeight-4),d()};return $n(()=>[rc.value?.id,Qs.value.get(rc.value?.id??``),B.value],async()=>{await Mn();let e=ic.value;e!==null&&ac.value&&(e.scrollTop=e.scrollHeight),d()}),Tr(()=>{window.addEventListener(`resize`,d)}),Or(()=>{window.removeEventListener(`resize`,d)}),(e,n)=>qn((N(),P(`div`,DP,[F(`section`,OP,[n[4]||=F(`div`,{class:`atitle`},`Agents`,-1),F(`div`,kP,[j(tc).length===0?(N(),P(`div`,{key:0,class:O([`aempty`,{off:j(Xs)!==null&&!j(Xs).connected}])},k(t.value),3)):L(``,!0),(N(!0),P(M,null,Fr(j(tc),e=>(N(),P(`div`,{key:e.id,class:O([`acard`,{sel:e.id===j(rc)?.id,busy:e.state===`busy`}]),onClick:t=>j(oc)(e.id)},[F(`div`,jP,[F(`span`,MP,[n[0]||=F(`span`,{class:`aicon`},`⚉`,-1),I(` `+k(e.name),1)])]),F(`span`,NP,k(j(bc)(e.id)?`♥`:`♡`),1),F(`div`,PP,[n[1]||=F(`span`,null,`kind:`,-1),F(`b`,FP,k(e.kind),1),n[2]||=F(`span`,null,`mode:`,-1),F(`b`,IP,k(typeof e.mode==`string`&&e.mode!==``?e.mode:`none`),1),n[3]||=F(`span`,null,`task:`,-1),F(`span`,LP,[e.tasks.length===0?(N(),P(`b`,RP,`none (waiting)`)):L(``,!0),(N(!0),P(M,null,Fr(e.tasks,e=>(N(),P(`span`,{key:e,class:`atask`},`≡ `+k(e),1))),128))])])],10,AP))),128))])]),F(`div`,zP,[F(`section`,BP,[n[6]||=F(`div`,{class:`atitle`},`Operation`,-1),j(rc)===null?(N(),P(`div`,{key:0,class:O([`aempty`,{off:j(Xs)!==null&&!j(Xs).connected}])},k(t.value),3)):(N(),P(`div`,VP,[F(`div`,HP,[F(`span`,UP,[n[5]||=F(`span`,{class:`aicon`},`⚉`,-1),I(` `+k(j(rc).name),1)]),j(rc).title?(N(),P(`b`,WP,k(j(rc).title),1)):j(rc).description?L(``,!0):(N(),P(`span`,GP,`(no operation title and description)`))]),j(rc).description?(N(),P(`div`,KP,k(j(rc).description),1)):L(``,!0)]))]),F(`div`,qP,[(N(!0),P(M,null,Fr(i.value,e=>(N(),P(`section`,{key:e.title,class:`ainfo`},[F(`div`,JP,k(e.title),1),j(rc)===null?(N(),P(`div`,{key:0,class:O([`aempty`,{off:j(Xs)!==null&&!j(Xs).connected}])},k(t.value),3)):(N(),P(`div`,YP,[(N(!0),P(M,null,Fr(e.fields,e=>(N(),P(M,{key:e.name},[F(`span`,null,k(e.name),1),F(`b`,{class:O([`aval`,{astart:e.start}]),title:e.value},[F(`span`,ZP,k(e.value),1)],10,XP)],64))),128))]))]))),128))]),F(`section`,QP,[n[7]||=F(`div`,{class:`atitle`},`Recent Log Entries`,-1),F(`div`,{ref_key:`logEl`,ref:ic,class:`alog`,onScroll:f},[ua(j(l))],544),u.value===``?L(``,!0):(N(),P(`div`,$P,k(u.value),1))])])],512)),[[eo,j(B)===`agents`]])}}),tF={id:`fframe`},nF=[`innerHTML`],rF={key:0,class:`gstats`},iF=ur({__name:`ase-task-board-web-client-flow`,setup(e){let t=A(null),n=1,r=e=>{let t=e.target.closest(`g.node[data-id]`);t!==null&&(xs.value=t.dataset.id,e.type===`dblclick`&&Sc(t.dataset.id))},i=()=>{let e=Gs.value?.querySelector(`svg`);if(e==null)return;let t=e.viewBox.baseVal;e.setAttribute(`width`,String(t.width*n)),e.setAttribute(`height`,String(t.height*n))},a=(e,t,r)=>{let a=Gs.value,o=a?.querySelector(`svg`);if(a==null||o==null)return;let s=a.getBoundingClientRect(),c=t??s.left+s.width/2,l=r??s.top+s.height/2,u=o.getBoundingClientRect(),d=(c-u.left)/u.width,f=(l-u.top)/u.height;n=Math.min(4,Math.max(.1,n*e)),i();let p=o.getBoundingClientRect();a.scrollLeft+=p.left+d*p.width-c,a.scrollTop+=p.top+f*p.height-l},o=e=>{e.preventDefault();let t=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?400:1);a(Math.exp(-t*.002),e.clientX,e.clientY)},s=e=>{let n=Gs.value;n!==null&&e.button===0&&e.target.closest(`g.node`)===null&&(e.preventDefault(),n.setPointerCapture(e.pointerId),t.value={x:e.clientX,y:e.clientY,left:n.scrollLeft,top:n.scrollTop})},c=e=>{let n=Gs.value;n!==null&&t.value!==null&&(n.scrollLeft=t.value.left-(e.clientX-t.value.x),n.scrollTop=t.value.top-(e.clientY-t.value.y))},l=()=>{let e=[...Gs.value?.querySelectorAll(`g.node[data-id]`)??[]];e.length>0&&!e.some(e=>e.dataset.id===xs.value)&&(xs.value=(e.find(e=>!e.classList.contains(`state`))??e[0]).dataset.id);let t=xs.value;for(let n of e)(n.querySelector(`.acard`)??n).classList.toggle(`sel`,n.dataset.id===t);Oc(Gs.value,t),B.value===`flow`&&Gs.value?.querySelector(`.acard.sel, g.state.sel`)?.scrollIntoView({block:`nearest`,inline:`nearest`})};$n([xs,ys,B],()=>{Mn(()=>{i(),l(),u()})});let u=()=>{Gs.value?.querySelectorAll(`.abeat[data-agents]`).forEach(e=>{e.textContent=(e.dataset.agents??``).split(` `).some(e=>e!==``&&bc(e))?`♥`:`♡`})};$n(hc,()=>{B.value===`flow`&&u()});let d=e=>{B.value!==`flow`||H.value!==null||e.target instanceof HTMLInputElement||e.ctrlKey||e.metaKey||e.altKey||(e.key===`0`?(n=1,i(),l()):e.key===`+`||e.key===`=`?a(1.25):e.key===`-`&&a(1/1.25))};return Tr(()=>{document.addEventListener(`keydown`,d)}),Or(()=>{document.removeEventListener(`keydown`,d)}),(e,n)=>qn((N(),P(`div`,tF,[F(`div`,{id:`flow`,ref_key:`flowEl`,ref:Gs,class:O({panning:t.value!==null}),onClick:r,onDblclick:r,onWheel:o,onPointerdown:s,onPointermove:c,onPointerup:n[0]||=e=>t.value=null,onPointercancel:n[1]||=e=>t.value=null,innerHTML:j(ys)},null,42,nF),j(bs)===null?L(``,!0):(N(),P(`div`,rF,k(j(bs).agents)+` agents, `+k(j(bs).states)+` states`,1))],512)),[[eo,j(B)===`flow`]])}}),aF={id:`stats`},oF={class:`sranges`},sF={key:0,class:`ssep`},cF=[`onClick`],lF={class:`spair scharts`},uF={class:`schart`},dF={class:`scount`},fF=[`title`],pF=[`title`],mF=[`title`],hF={class:`schart`},gF=[`title`],_F={class:`scount`},vF=[`title`],yF=[`title`],bF=[`title`],xF={class:`spair`},SF={class:`stitle`},CF={class:`sstack`},wF=[`title`],TF={class:`slegend`},EF={key:0,class:`ssep`},DF={class:`spair`},OF={class:`susage`},kF={class:`smatrix`},AF={class:`scell`},jF={class:`sname`},MF={class:`strack`},NF={class:`sval`},PF={class:`scell`},FF={class:`srow`},IF={class:`strack`},LF={class:`sval`},RF={class:`slegend stokens`},zF={class:`scell`},BF={class:`sname`},VF={class:`strack`},HF={class:`sval`},UF={class:`schart`},WF=[`title`],GF={class:`scount`},KF={class:`spair`},qF={class:`stop`},JF={class:`stoplist`},YF=[`title`],XF=[`title`],ZF={class:`strack`},QF={class:`snum`},$F={class:`snum`,title:`input ▷ output tokens`},eI={colspan:`5`},tI={class:`ssplit`},nI={class:`seffect`},rI={class:`sline`},iI={class:`sline`},aI={class:`sline`},oI={title:`input ▷ output tokens`},sI={class:`sline`},cI={class:`sline`},lI={class:`seffect`},uI={class:`sline`},dI={class:`sline`},fI={class:`sline`},pI=5,mI=ur({__name:`ase-task-board-web-client-stats`,setup(e){let t=[`cread`,`cwrite`,`input`,`output`],n=R(()=>V.value?.usage??{timeAI:0,timeHR:0,timeReal:0,cread:0,cwrite:0,input:0,output:0,costAI:0,costHR:0}),r=R(()=>[{name:`AI`,cls:`ai`,value:n.value.timeAI},{name:`HR`,cls:`hr`,value:n.value.timeHR},{name:`real`,cls:`real`,value:n.value.timeReal}]),i=R(()=>[{name:`AI`,cls:`ai`,value:n.value.costAI},{name:`HR`,cls:`hr`,value:n.value.costHR}]),a=R(()=>n.value.cread+n.value.cwrite+n.value.input+n.value.output),o=e=>`${a.value>0?Math.round(e/a.value*100):0}%`,s=e=>e<60?`${Math.round(e)}m`:`${(e/60).toFixed(1)}h`,c=e=>e===null?`n/a`:e<60?`${Math.round(e)}m`:e<2880?`${(e/60).toFixed(1)}h`:`${(e/1440).toFixed(1)}d`,l=e=>e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}M`:`${(e/1e9).toFixed(1)}G`,u=e=>`$${e.toFixed(2)}`,d=e=>e===null?`n/a`:`${e.toFixed(1)}×`,f=e=>e===null?`n/a`:`${Math.round(e*100)}%`,p=(e,t)=>{let n=V.value?.days;return e===`total`&&n!==void 0?`${t} (${n} day${n===1?``:`s`})`:t},m=R(()=>Math.max(0,...(V.value?.top??[]).map(e=>l(e.input).length))),h=R(()=>Math.max(0,...(V.value?.top??[]).map(e=>l(e.output).length))),g=(e,t)=>`${t>0?e/t*100:0}%`,_=(e,t)=>`${e}: ${s(t.minutes)} effort of ${t.estimated} of ${t.tasks} task${t.tasks===1?``:`s`} estimated`,v=R(()=>Math.max(1,...(V.value?.states??[]).map(e=>e.count))),y=R(()=>(V.value?.states??[]).reduce((e,t)=>e+t.count,0)),b=R(()=>(V.value?.states??[]).reduce((e,t)=>{let n=e.at(-1);return n!==void 0&&n.phase===t.phase?n.n++:e.push({phase:t.phase,n:1}),e},[])),x=R(()=>Math.max(1,...(V.value?.sizes??[]).map(e=>e.count))),S=R(()=>{let e=V.value?.states??[],t=t=>e.reduce((e,n)=>e+n.effort[t],0);return`estimated: ${t(`estimated`)} of ${t(`tasks`)} tasks`}),C=R(()=>Math.max(1,...(V.value?.throughput??[]).map(e=>e.count))),w=R(()=>{let e=V.value?.throughput??[],t=e.reduce((e,t)=>e+t.count,0);return`${t} finished · ⌀ ${(e.length>0?t/e.length:0).toFixed(1)}/week`}),T=R(()=>{let{backlog:e,weeks:t}=V.value?.forecast??{backlog:0,weeks:0};return e===0?`forecast: no unfinished tasks`:`forecast: ${e} unfinished ≈ ${t===null?`n/a`:`${t.toFixed(1)} week${t===1?``:`s`}`}`}),ee=R(()=>{let e=V.value?.progress??{finished:0,cancelled:0,wip:0,open:0},t=V.value?.readiness??{ready:0,blocked:0},n=[{key:`cancelled`,label:`cancelled`,count:e.cancelled},{key:`finished`,label:`finished`,count:e.finished},{key:`wip`,label:`wip`,count:e.wip},{key:`open`,label:`open`,count:e.open}],r=[{key:`ready`,label:`ready`,count:t.ready},{key:`blocked`,label:`blocked`,count:t.blocked}];return[{key:`progress`,title:`Task Progress`,parts:n},{key:`readiness`,title:`Open Tasks`,parts:r}]}),E=(e,t)=>{let n=t.reduce((e,t)=>e+t.count,0);return`${n>0?Math.round(e/n*100):0}%`},te=R(()=>Math.max(n.value.timeAI,n.value.timeHR,n.value.timeReal)),ne=R(()=>Math.max(n.value.costAI,n.value.costHR));return(e,n)=>qn((N(),P(`div`,aF,[F(`div`,oF,[(N(!0),P(M,null,Fr(j(jc),(e,t)=>(N(),P(M,{key:e.range},[t>0?(N(),P(`span`,sF,`·`)):L(``,!0),F(`button`,{class:O({on:e.range===j(Cs)}),onClick:t=>j(Mc)(e.range)},k(p(e.range,e.label)),11,cF)],64))),128))]),j(V)===null?(N(),P(`div`,{key:0,class:O([`sempty`,{off:j(Ss)!==null}])},k(j(Ss)??`loading …`),3)):(N(),P(M,{key:1},[F(`div`,lF,[F(`section`,uF,[n[0]||=F(`div`,{class:`stitle`},`Tasks per State`,-1),F(`div`,{class:`sgrid`,style:be({gridTemplateColumns:`repeat(${j(V).states.length}, minmax(0, 1fr))`})},[(N(!0),P(M,null,Fr(j(V).states,e=>(N(),P(`div`,{key:e.status,class:O([`scol`,e.tone])},[F(`span`,dF,k(e.count),1),F(`div`,{class:`sbar`,style:be({height:`calc((100% - 1.5em) * ${e.count/v.value})`})},null,4)],2))),128)),(N(!0),P(M,null,Fr(j(V).states,e=>(N(),P(`div`,{key:`l-${e.status}`,class:O([`sstate`,e.tone]),title:e.status},k(e.status.slice(0,7)),11,fF))),128)),(N(!0),P(M,null,Fr(j(V).states,e=>(N(),P(`div`,{key:`e-${e.status}`,class:O([`seffort`,e.tone]),title:_(e.status,e.effort)},k(e.effort.estimated>0?s(e.effort.minutes):``),11,pF))),128)),(N(!0),P(M,null,Fr(b.value,e=>(N(),P(`div`,{key:e.phase,class:`sphase`,style:be({gridColumn:`span ${e.n}`}),title:e.phase},[F(`span`,null,k(e.phase),1)],12,mF))),128)),F(`div`,{class:`sfoot`,style:be({gridColumn:`span ${j(V).states.length}`})},`total tasks: `+k(y.value),5)],4)]),F(`section`,hF,[n[1]||=F(`div`,{class:`stitle`},`Throughput`,-1),F(`div`,{class:`sgrid`,style:be({gridTemplateColumns:`repeat(${j(V).throughput.length}, minmax(0, 1fr))`})},[(N(!0),P(M,null,Fr(j(V).throughput,e=>(N(),P(`div`,{key:e.start,class:`scol`,title:`week ${e.week} (from ${e.start}): ${e.count} finished`},[F(`span`,_F,k(e.count),1),F(`div`,{class:`sbar`,style:be({height:`calc((100% - 1.5em) * ${e.count/C.value})`})},null,4)],8,gF))),128)),(N(!0),P(M,null,Fr(j(V).throughput,e=>(N(),P(`div`,{key:`l-${e.start}`,class:`sstate`,title:`week ${e.week} (from ${e.start})`},`W`+k(e.week),9,vF))),128)),F(`div`,{class:`seffort`,style:be({gridColumn:`span ${j(V).throughput.length}`})},null,4),F(`div`,{class:`sphase`,style:be({gridColumn:`span ${j(V).throughput.length}`}),title:w.value},[F(`span`,null,k(w.value),1)],12,yF),F(`div`,{class:`sfoot`,style:be({gridColumn:`span ${j(V).throughput.length}`}),title:T.value},k(T.value),13,bF)],4)])]),F(`div`,xF,[(N(!0),P(M,null,Fr(ee.value,e=>(N(),P(`section`,{key:e.key,class:`sprogress`},[F(`div`,SF,k(e.title),1),F(`div`,CF,[(N(!0),P(M,null,Fr(e.parts,t=>qn((N(),P(`div`,{key:t.key,class:O([`spart`,t.key]),style:be({flexGrow:t.count}),title:`${t.label}: ${t.count} (${E(t.count,e.parts)})`},null,14,wF)),[[eo,t.count>0]])),128))]),F(`div`,TF,[(N(!0),P(M,null,Fr(e.parts,(t,n)=>(N(),P(M,{key:t.key},[n>0?(N(),P(`span`,EF,`·`)):L(``,!0),F(`span`,null,[F(`span`,{class:O([`sswatch`,t.key])},null,2),I(k(t.label)+`: `,1),F(`b`,null,k(t.count),1),I(` (`+k(E(t.count,e.parts))+`)`,1)])],64))),128))])]))),128))]),F(`div`,DF,[F(`section`,OF,[n[6]||=F(`div`,{class:`stitle`},`Usage`,-1),F(`div`,kF,[n[3]||=F(`span`,{class:`shead`},`Time:`,-1),n[4]||=F(`span`,{class:`shead`},`Token:`,-1),n[5]||=F(`span`,{class:`shead`},`Cost:`,-1),F(`div`,AF,[(N(!0),P(M,null,Fr(r.value,e=>(N(),P(`div`,{key:e.name,class:`srow`},[F(`span`,jF,k(e.name),1),F(`div`,MF,[F(`div`,{class:O([`sfill`,e.cls]),style:be({width:g(e.value,te.value)})},null,6)]),F(`span`,NF,k(s(e.value)),1)]))),128))]),F(`div`,PF,[F(`div`,FF,[n[2]||=F(`span`,{class:`sname`},`AI`,-1),F(`div`,IF,[(N(),P(M,null,Fr(t,e=>F(`div`,{key:e,class:O([`sfill`,e]),style:be({width:g(j(V).usage[e],a.value)})},null,6)),64))]),F(`span`,LF,k(l(a.value)),1)]),F(`div`,RF,[(N(),P(M,null,Fr(t,e=>F(`span`,{key:e},[F(`span`,{class:O([`sswatch`,e])},null,2),I(k(e)+` (`+k(o(j(V).usage[e]))+`)`,1)])),64))])]),F(`div`,zF,[(N(!0),P(M,null,Fr(i.value,e=>(N(),P(`div`,{key:e.name,class:`srow`},[F(`span`,BF,k(e.name),1),F(`div`,VF,[F(`div`,{class:O([`sfill`,e.cls]),style:be({width:g(e.value,ne.value)})},null,6)]),F(`span`,HF,k(u(e.value)),1)]))),128))])])]),F(`section`,UF,[n[7]||=F(`div`,{class:`stitle`},`Effort`,-1),F(`div`,{class:`sgrid scompact`,style:be({gridTemplateColumns:`repeat(${j(V).sizes.length}, minmax(0, 1fr))`})},[(N(!0),P(M,null,Fr(j(V).sizes,e=>(N(),P(`div`,{key:e.size,class:`scol`,title:`${e.size}: ${e.count} task${e.count===1?``:`s`}`},[F(`span`,GF,k(e.count),1),F(`div`,{class:`sbar`,style:be({height:`calc((100% - 1.5em) * ${e.count/x.value})`})},null,4)],8,WF))),128)),(N(!0),P(M,null,Fr(j(V).sizes,e=>(N(),P(`div`,{key:`l-${e.size}`,class:`sstate`},k(e.size),1))),128)),F(`div`,{class:`sfoot`,style:be({gridColumn:`span ${j(V).sizes.length}`})},k(S.value),5)],4)])]),F(`div`,KF,[F(`section`,qF,[n[10]||=F(`div`,{class:`stitle`},`Top-5 Tasks`,-1),F(`table`,JF,[n[9]||=F(`thead`,null,[F(`tr`,null,[F(`th`,null,`Task Id`),F(`th`,{class:`stask`},`Task Title`),F(`th`,null,`Total Share`),F(`th`,{class:`snum`},`Cost`),F(`th`,null,`Token`)])],-1),F(`tbody`,null,[(N(!0),P(M,null,Fr(j(V).top,e=>(N(),P(`tr`,{key:e.id},[F(`td`,null,[F(`span`,{class:O([`cid`,e.tone])},`≡ `+k(e.id),3)]),F(`td`,{class:`stask`,title:e.title},[F(`span`,null,k(e.title),1)],8,YF),F(`td`,{class:`sbarcell`,title:`${Math.round(e.share*100)}%`},[F(`div`,ZF,[F(`div`,{class:`sfill ai`,style:be({width:g(e.share,1)})},null,4)])],8,XF),F(`td`,QF,k(u(e.cost)),1),F(`td`,$F,[F(`span`,{class:`stok`,style:be({minWidth:`${m.value}ch`})},k(l(e.input)),5),n[8]||=F(`span`,{class:`sflow`},`▷`,-1),F(`span`,{class:`stok`,style:be({minWidth:`${h.value}ch`})},k(l(e.output)),5)])]))),128)),(N(!0),P(M,null,Fr(pI-j(V).top.length,e=>(N(),P(`tr`,{key:`empty-${e}`,class:`sblank`},[F(`td`,eI,k(e===1&&j(V).top.length===0?`no usage`:``),1)]))),128))])])]),F(`div`,tI,[F(`section`,nI,[n[17]||=F(`div`,{class:`stitle`},`Finished Tasks`,-1),F(`div`,rI,[n[11]||=F(`span`,null,`AI cost (⌀)`,-1),F(`b`,null,k(u(j(V).efficiency.costAI)),1)]),F(`div`,iI,[n[12]||=F(`span`,null,`HR cost (⌀)`,-1),F(`b`,null,k(u(j(V).efficiency.costHR)),1)]),F(`div`,aI,[n[14]||=F(`span`,null,`AI token (⌀)`,-1),F(`b`,oI,[I(k(l(j(V).efficiency.input)),1),n[13]||=F(`span`,{class:`sflow`},`▷`,-1),I(k(l(j(V).efficiency.output)),1)])]),F(`div`,sI,[n[15]||=F(`span`,null,`lead (median)`,-1),F(`b`,null,k(c(j(V).efficiency.leadMedian)),1)]),F(`div`,cI,[n[16]||=F(`span`,null,`lead (p85)`,-1),F(`b`,null,k(c(j(V).efficiency.leadP85)),1)])]),F(`section`,lI,[n[21]||=F(`div`,{class:`stitle`},`Efficiency`,-1),F(`div`,uI,[n[18]||=F(`span`,null,`AI/HR time ratio`,-1),F(`b`,null,k(d(j(V).efficiency.timeRatio)),1)]),F(`div`,dI,[n[19]||=F(`span`,null,`AI/HR cost ratio`,-1),F(`b`,null,k(d(j(V).efficiency.costRatio)),1)]),F(`div`,fI,[n[20]||=F(`span`,null,`AI cache hit ratio`,-1),F(`b`,null,k(f(j(V).efficiency.cacheRatio)),1)])])])])],64))],512)),[[eo,j(B)===`stats`]])}}),hI={key:0,id:`dlg`},gI={class:`dhd`},_I={key:0,class:`where`},vI={class:`val`},yI={class:`val`},bI={class:`drefs`},xI={key:0,class:`mute`},SI=[`onClick`],CI={key:0,class:`mute`},wI=[`onClick`],TI={class:`dtabs`},EI=[`onClick`],DI={key:0,class:`dnote`},OI=[`srcdoc`],kI={key:1,class:`dfoot`},AI={key:2,class:`dfoot`},jI={key:3,class:`dfoot`},MI={key:4,class:`dfoot`},NI=ur({__name:`ase-task-board-web-client-dialog`,setup(e){let t=()=>{Ks.value?.contentWindow?.scrollTo(0,Ps.get(js.value)??0),n()},n=()=>{let e=Ks.value?.contentDocument,t=e?.querySelector(`.embedding img`),n=e?.scrollingElement;if(t==null||n==null)return;let r=1,i=0,a=null;t.addEventListener(`wheel`,e=>{e.preventDefault(),i===0&&(i=t.getBoundingClientRect().width);let a=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?400:1),o=t.getBoundingClientRect(),s=(e.clientX-o.left)/o.width,c=(e.clientY-o.top)/o.height;r=Math.min(16,Math.max(.1,r*Math.exp(-a*.002))),t.style.maxWidth=`none`,t.style.width=`${i*r}px`;let l=t.getBoundingClientRect();n.scrollLeft+=l.left+s*l.width-e.clientX,n.scrollTop+=l.top+c*l.height-e.clientY},{passive:!1}),t.addEventListener(`pointerdown`,e=>{e.button===0&&(e.preventDefault(),t.setPointerCapture(e.pointerId),a={x:e.clientX,y:e.clientY,left:n.scrollLeft,top:n.scrollTop})}),t.addEventListener(`pointermove`,e=>{a!==null&&(n.scrollLeft=a.left-(e.clientX-a.x),n.scrollTop=a.top-(e.clientY-a.y))}),t.addEventListener(`pointerup`,()=>{a=null}),t.addEventListener(`pointercancel`,()=>{a=null})};return(e,n)=>qn((N(),P(`div`,{id:`scrim`,onClick:n[11]||=zo(e=>j(tN)(!0),[`self`])},[j(H)===null?L(``,!0):(N(),P(`div`,hI,[F(`div`,gI,[F(`h1`,{class:O(`tone-${j(H).tone}`)},[ua($o,{id:j(H).id,epic:j(H).epic,title:j(H).title},null,8,[`id`,`epic`,`title`])],2),j(Ts)?.id===``?L(``,!0):(N(),P(`span`,_I,[F(`span`,vI,k(j(H).group),1),n[12]||=I(` ▷ `,-1),F(`span`,yI,k(j(H).status),1)])),j(Ts)===null?(N(),P(`button`,{key:1,class:`close`,title:`edit (e)`,onClick:n[0]||=e=>j(JM)(!1)},`✎`)):L(``,!0),F(`button`,{class:`close`,title:`close (ESC)`,onClick:n[1]||=e=>j(tN)(!0)},`✕`)]),F(`div`,bI,[F(`span`,null,[n[13]||=F(`span`,{class:`mute`},`predecessors:`,-1),j(H).pred.length===0?(N(),P(`span`,xI,`—`)):L(``,!0),(N(!0),P(M,null,Fr(j(H).pred,e=>(N(),P(`span`,{key:e.id,class:O([`ref`,`tone-${e.tone}`]),onClick:t=>j(Fc)(e.id)},`≡ `+k(e.id),11,SI))),128))]),F(`span`,null,[n[14]||=F(`span`,{class:`mute`},`successors:`,-1),j(H).succ.length===0?(N(),P(`span`,CI,`—`)):L(``,!0),(N(!0),P(M,null,Fr(j(H).succ,e=>(N(),P(`span`,{key:e.id,class:O([`ref`,`tone-${e.tone}`]),onClick:t=>j(Fc)(e.id)},`≡ `+k(e.id),11,wI))),128))])]),F(`div`,TI,[F(`button`,{class:`tarr`,style:be({visibility:j(Ns).less?`visible`:`hidden`}),onClick:n[2]||=e=>j(Hc)(j(js)-1)},`◁`,4),F(`div`,{ref_key:`tabsEl`,ref:qs,class:`tlist`,onScroll:n[3]||=(...e)=>j(Uc)&&j(Uc)(...e)},[(N(!0),P(M,null,Fr(j(H).tabs,(e,t)=>(N(),P(`button`,{key:t,class:O([`tab`,{sel:t===j(js)}]),onClick:e=>j(Hc)(t)},k(e),11,EI))),128))],544),F(`button`,{class:`tarr`,style:be({visibility:j(Ns).more?`visible`:`hidden`}),onClick:n[4]||=e=>j(Hc)(j(js)+1)},`▷`,4)]),j(Es)===null?L(``,!0):(N(),P(`div`,DI,[j(Es).kind===`draft`?(N(),P(M,{key:0},[n[15]||=I(` an unsaved draft of this task exists `,-1),F(`button`,{onClick:n[5]||=(...e)=>j($M)&&j($M)(...e)},`restore`),F(`button`,{onClick:n[6]||=(...e)=>j(eN)&&j(eN)(...e)},`discard`)],64)):j(Es).kind===`discard`?(N(),P(M,{key:1},[n[16]||=I(` discard the unsaved changes? `,-1),F(`button`,{onClick:n[7]||=e=>j(Es).close?j(zc)():j(nN)()},`discard`),F(`button`,{onClick:n[8]||=e=>Es.value=null},`keep editing`)],64)):j(Es).kind===`conflict`?(N(),P(M,{key:2},[I(k(j(Es).message)+` (draft kept) `,1),j(Es).base===null?L(``,!0):(N(),P(`button`,{key:0,onClick:n[9]||=e=>j(ZM)(j(Es).base)},`overwrite`)),F(`button`,{onClick:n[10]||=e=>{j(eN)(),j(nN)()}},`discard`)],64)):(N(),P(M,{key:3},[I(k(j(Es).message),1)],64))])),qn(F(`iframe`,{id:`plan`,ref_key:`planEl`,ref:Ks,title:`task plan`,sandbox:`allow-same-origin allow-popups allow-popups-to-escape-sandbox`,srcdoc:j(js)===0?j(H).doc:j(Ms)[j(js)]??``,onLoad:t},null,40,OI),[[eo,j(Ts)===null]]),qn(F(`div`,{id:`editor`,ref_key:`editorEl`,ref:BM},null,512),[[eo,j(Ts)!==null]]),j(Ts)?.keymap===`vim`?(N(),P(`div`,kI,[...n[17]||=[ma(`<kbd>:w</kbd><span class="action">saves</span><span class="sep">·</span><kbd>:q</kbd><span class="action">cancels</span><span class="sep">·</span><kbd>:q!</kbd><span class="action">discards</span>`,8)]])):j(Ts)?.keymap===`emacs`?(N(),P(`div`,AI,[...n[18]||=[F(`kbd`,null,`C-x C-s`,-1),F(`span`,{class:`action`},`saves`,-1),F(`span`,{class:`sep`},`·`,-1),F(`kbd`,null,`C-x C-c`,-1),F(`span`,{class:`action`},`cancels`,-1)]])):j(Ts)===null?(N(),P(`div`,MI,[...n[20]||=[ma(`<kbd>←</kbd>/<kbd>→</kbd>/<kbd>⇤</kbd>/<kbd>⇥</kbd><span class="action">switches tab</span><span class="sep">·</span><kbd>↑</kbd>/<kbd>↓</kbd>/<kbd>⇈</kbd>/<kbd>⇊</kbd><span class="action">scrolls</span><span class="sep">·</span><kbd>e</kbd><span class="action">edits</span><span class="sep">·</span><kbd>E</kbd><span class="action">edits by prompt</span><span class="sep">·</span><kbd>R</kbd><span class="action">requests by prompt</span><span class="sep">·</span><kbd>T</kbd><span class="action">transitions</span><span class="sep">·</span><kbd>A</kbd><span class="action">assigns</span><span class="sep">·</span><kbd>D</kbd><span class="action">deletes</span><span class="sep">·</span><kbd>⏎</kbd>/<kbd>ESC</kbd><span class="action">closes</span>`,40)]])):(N(),P(`div`,jI,[...n[19]||=[F(`kbd`,null,`Ctrl`,-1),I(`/`,-1),F(`kbd`,null,`⌘`,-1),I(`+`,-1),F(`kbd`,null,`S`,-1),F(`span`,{class:`action`},`saves`,-1),F(`span`,{class:`sep`},`·`,-1),F(`kbd`,null,`ESC`,-1),F(`span`,{class:`action`},`cancels`,-1)]]))]))],512)),[[eo,j(H)!==null]])}}),PI={class:`box`},FI={class:`ask`},II={class:`cid`},LI={class:`buttons`},RI={class:`box`},zI={class:`ask`},BI={class:`cid`},VI={class:`states`},HI=[`disabled`,`onClick`],UI={class:`state`},WI={key:0,class:`cur`},GI={class:`box`},KI={class:`ask`},qI={class:`cid`},JI={class:`combo`},YI={key:0,class:`unknown`},XI={key:1,class:`drop`},ZI=[`onMousedown`],QI={class:`icon`},$I={class:`buttons`},eL={class:`box`},tL={class:`ask`},nL={class:`cid`},rL={key:0,class:`fields`},iL={class:`combo`},aL={key:0,class:`mark`},oL={key:1,class:`drop`},sL=[`onMousedown`],cL={key:0,id:`prompt-text`,rows:`5`,disabled:``,placeholder:`(ignored by the agents of this request)`},lL={class:`buttons`},uL={class:`keys`},dL={class:`action`},fL={key:4,id:`busy`},pL={class:`box`},mL={class:`ask`},hL={key:0,class:`cid`},gL={class:`time`},_L=ur({__name:`ase-task-board-web-client-popup`,setup(e){return(e,t)=>(N(),P(M,null,[j(Ds)===null?L(``,!0):(N(),P(`div`,{key:0,id:`confirm`,onClick:t[2]||=zo(e=>Ds.value=null,[`self`])},[F(`div`,PI,[F(`div`,FI,[t[18]||=I(`Delete task `,-1),F(`span`,II,k(j(Ds)),1),t[19]||=I(`?`,-1)]),F(`div`,LI,[F(`button`,{onClick:t[0]||=e=>j(iN)(j(Ds))},`delete`),F(`button`,{onClick:t[1]||=e=>Ds.value=null},`cancel`)]),t[20]||=F(`div`,{class:`keys`},[F(`kbd`,null,`y`),F(`span`,{class:`action`},`deletes`),F(`span`,{class:`sep`},`·`),F(`kbd`,null,`ESC`),F(`span`,{class:`action`},`cancels`)],-1)])])),j(Os)===null?L(``,!0):(N(),P(`div`,{key:1,id:`transfer`,onClick:t[3]||=zo((...e)=>j(sN)&&j(sN)(...e),[`self`])},[F(`div`,RI,[F(`div`,zI,[t[21]||=I(`Transfer task `,-1),F(`span`,BI,k(j(Os).id),1),t[22]||=I(` to:`,-1)]),F(`div`,VI,[(N(!0),P(M,null,Fr(j(aN),e=>(N(),P(`button`,{key:e.status,disabled:!e.ok,class:O({sel:e.status===j(Os).at}),onClick:t=>j(cN)(j(Os).id,e.status)},[I(k(e.group)+` ▷ `,1),F(`span`,UI,k(e.status),1),e.current?(N(),P(`span`,WI,` (current)`)):L(``,!0)],10,HI))),128))]),t[23]||=ma(`<div class="keys"><kbd>↑</kbd>/<kbd>↓</kbd><span class="action">selects</span><span class="sep">·</span><kbd>⏎</kbd><span class="action">transitions</span><span class="sep">·</span><kbd>ESC</kbd><span class="action">cancels</span></div>`,1)])])),j(ks)===null?L(``,!0):(N(),P(`div`,{key:2,id:`assign`,onClick:t[8]||=zo((...e)=>j(hN)&&j(hN)(...e),[`self`])},[F(`div`,GI,[F(`div`,KI,[t[24]||=I(`Assign task `,-1),F(`span`,qI,k(j(ks).id),1),t[25]||=I(` to:`,-1)]),F(`div`,JI,[qn(F(`input`,{id:`assign-name`,ref_key:`assignEl`,ref:lN,"onUpdate:modelValue":t[4]||=e=>j(ks).name=e,spellcheck:`false`,autocomplete:`off`,placeholder:`none`,onInput:t[5]||=(...e)=>j(mN)&&j(mN)(...e)},null,544),[[Io,j(ks).name]]),j(fN)?(N(),P(`span`,YI,`unknown`)):L(``,!0),t[26]||=F(`span`,{class:`mark`},`▾`,-1),j(dN).length>0?(N(),P(`ul`,XI,[(N(!0),P(M,null,Fr(j(dN),e=>(N(),P(`li`,{key:e.name,class:O({sel:e.name===j(ks).name}),onMousedown:zo(t=>j(gN)(j(ks).id,e.name),[`prevent`])},[F(`span`,QI,k(e.kind===`user`?`☺`:e.kind===`agent`?`⚉`:``),1),I(k(e.name),1)],42,ZI))),128))])):L(``,!0)]),F(`div`,$I,[F(`button`,{onClick:t[6]||=(...e)=>j(_N)&&j(_N)(...e)},`assign`),F(`button`,{onClick:t[7]||=(...e)=>j(hN)&&j(hN)(...e)},`cancel`)]),t[27]||=ma(`<div class="keys"><kbd>↑</kbd>/<kbd>↓</kbd><span class="action">pick assignee</span><span class="sep">·</span><kbd>⏎</kbd><span class="action">assign</span><span class="sep">·</span><kbd>ESC</kbd><span class="action">cancel</span></div>`,1)])])),j(W)===null?L(``,!0):(N(),P(`div`,{key:3,id:`prompt`,onClick:t[17]||=zo((...e)=>j(IN)&&j(IN)(...e),[`self`])},[F(`div`,eL,[F(`div`,tL,[I(k(j(W).name===null?`Edit`:`Request agent for`)+` task `,1),F(`span`,nL,k(j(W).id),1),t[28]||=I(` by prompt:`,-1)]),j(W).name===null?qn((N(),P(`textarea`,{key:1,ref_key:`promptEl`,ref:bN,"onUpdate:modelValue":t[14]||=e=>j(W).text=e,rows:`5`,spellcheck:`false`},null,512)),[[Io,j(W).text]]):(N(),P(`div`,rL,[t[29]||=F(`label`,{for:`prompt-name`},`request name:`,-1),F(`div`,iL,[qn(F(`input`,{id:`prompt-name`,ref_key:`promptName`,ref:xN,"onUpdate:modelValue":t[9]||=e=>j(W).name=e,spellcheck:`false`,autocomplete:`off`,placeholder:`e.g. lint`,onInput:t[10]||=(...e)=>j(kN)&&j(kN)(...e),onFocus:t[11]||=e=>j(AN)(!0),onBlur:t[12]||=e=>j(AN)(!1)},null,544),[[Io,j(W).name]]),j(DN).length>0?(N(),P(`span`,aL,`▾`)):L(``,!0),j(TN)&&j(ON).length>0?(N(),P(`ul`,oL,[(N(!0),P(M,null,Fr(j(ON),e=>(N(),P(`li`,{key:e,class:O({sel:e===j(W).name}),onMousedown:zo(t=>j(PN)(e),[`prevent`])},k(e),43,sL))),128))])):L(``,!0)]),t[30]||=F(`label`,{for:`prompt-text`},`request prompt:`,-1),j(MN)?(N(),P(`textarea`,cL)):qn((N(),P(`textarea`,{key:1,id:`prompt-text`,ref_key:`promptEl`,ref:bN,"onUpdate:modelValue":t[13]||=e=>j(W).text=e,rows:`5`,spellcheck:`false`},null,512)),[[Io,j(W).text]])])),F(`div`,lL,[F(`button`,{ref_key:`promptOk`,ref:SN,onClick:t[15]||=(...e)=>j(BN)&&j(BN)(...e)},k(j(W).name===null?`request edit`:`request`),513),F(`button`,{ref_key:`promptNo`,ref:CN,onClick:t[16]||=(...e)=>j(IN)&&j(IN)(...e)},`cancel`,512)]),F(`div`,uL,[t[36]||=F(`kbd`,null,`⇥`,-1),t[37]||=F(`span`,{class:`action`},`switch field`,-1),t[38]||=F(`span`,{class:`sep`},`·`,-1),j(W).name===null?L(``,!0):(N(),P(M,{key:0},[t[31]||=F(`kbd`,null,`↑`,-1),t[32]||=I(`/`,-1),t[33]||=F(`kbd`,null,`↓`,-1),t[34]||=F(`span`,{class:`action`},`pick name`,-1),t[35]||=F(`span`,{class:`sep`},`·`,-1)],64)),t[39]||=F(`kbd`,null,`⇧⏎`,-1),t[40]||=F(`span`,{class:`action`},`new line`,-1),t[41]||=F(`span`,{class:`sep`},`·`,-1),t[42]||=F(`kbd`,null,`⏎`,-1),F(`span`,dL,k(j(W).name===null?`request edit`:`request`),1),t[43]||=F(`span`,{class:`sep`},`·`,-1),t[44]||=F(`kbd`,null,`ESC`,-1),t[45]||=F(`span`,{class:`action`},`cancel`,-1)])])])),j(cs)===null?L(``,!0):(N(),P(`div`,fL,[F(`div`,pL,[F(`div`,mL,[t[46]||=F(`span`,{class:`spinner`},null,-1),I(k(j(cs).label.text),1),j(cs).label.id===void 0?L(``,!0):(N(),P(`span`,hL,k(j(cs).label.id),1)),j(cs).label.suffix===void 0?L(``,!0):(N(),P(M,{key:1},[I(k(j(cs).label.suffix),1)],64)),F(`span`,gL,`(`+k(j(ds))+`)`,1)]),t[47]||=F(`div`,{class:`bar`},[F(`div`,{class:`block`})],-1)])]))],64))}}),vL={class:`emph`},yL={class:`emph`},bL={class:`emph`},xL={class:`field`},SL=[`disabled`],CL={id:`view`},wL={id:`hscroll`},TL={key:0},EL={key:1},DL={key:2},OL={key:3},kL={key:4},AL={key:5},jL={key:6},ML={key:0,class:`sep`},NL={class:`action`},PL={key:0,class:`status`},FL={key:1,class:`status idle`};Go(ur({__name:`ase-task-board-web-client`,setup(e){let t=R(()=>{let e=z.value?.groups.flatMap(e=>e.lanes).flatMap(e=>e.cards);return e===void 0?``:`${e.filter(e=>e.tone!==`done`).length}/${e.length}`}),n=R(()=>V.value?.states.reduce((e,t)=>e+t.count,0)??0),r=R(()=>B.value===`agents`||B.value===`flow`),i=R(()=>{let e=xc(xs.value);return e.length===0?null:{label:mc(e[0])+(e.length>1?` ×${e.length}`:``),states:e[0].states,request:e[0].request??`none`}}),a=R(()=>{if(!xs.value.startsWith(`state:`))return null;let e=xs.value.slice(6),t=[...new Set((Xs.value?.agents??[]).map(e=>`agent:${e.kind}:${e.mode??``}`))].map(xc),n=e=>t.filter(t=>t[0]?.states!==void 0&&e(t[0].states)).map(e=>mc(e[0])+(e.length>1?` ×${e.length}`:``)).join(`, `);return{state:e,input:n(t=>t.input.includes(e))||`none`,output:n(t=>t.output.includes(e))||`none`,gate:n(t=>t.gate===e&&!t.input.includes(e))}}),o=R(()=>z.value?.groups.flatMap(e=>e.lanes).find(e=>e.cards.some(e=>e.id===U.value.id))?.status??null),s=e=>ns(e,Xs.value!==null),c=R(()=>hs.value===null?gs.value===null?Ys.value?.key===!0?`moving task "${Ys.value.id}" from ${Ys.value.from}: select a highlighted lane, SPACE drops, ESC cancels`:(z.value?.warnings.length??0)>0?`⚠ ${z.value.warnings.join(` · `)}`:``:gs.value:`⚠ ${hs.value}`),l=R(()=>{let e=z.value?.groups[U.value.g],t=sc.value.minimized.includes(e?.lanes[U.value.l]?.status??``),n=sc.value.collapsed.includes(e?.title??``),r=z.value!==null&&is(z.value,sc.value,U.value.l).every(e=>sc.value.minimized.includes(e));return wc.value?[[{key:`↑/↓/←/→`,action:`select task`},{key:`⇈/⇊/⇤/⇥`,action:`page/first/last task`},{key:`⏎`,action:`view task`},{key:`e`,action:`edit task`},{key:`SPACE`,action:`start transition task`},{key:`T`,action:`transition task`}],[{key:`D`,action:`delete task`},{key:`A`,action:`assign task`},{key:`E`,action:`edit by prompt`},{key:`R`,action:`request by prompt`},{key:`N`,action:`new task`},{key:`g/ESC`,action:`shrink lane`}],[{key:`t`,action:`${cc.value?`collapse`:`expand`} titles`},{key:`/`,action:`filter tasks`},{key:`v/V`,action:s(`lanes`)}],[{key:`Left-Click`,action:`select task`},{key:`Double-Click`,action:`view task / shrink lane`},{key:`?`,action:`hide key hints`}]]:B.value===`lanes`?[[{key:`↑/↓/←/→`,action:`select task`},{key:`⇈/⇊/⇤/⇥`,action:`select lane`},{key:`⏎`,action:`view task`},{key:`e`,action:`edit task`},{key:`SPACE`,action:`start/stop transition task`},{key:`T`,action:`transition task`}],[{key:`D`,action:`delete task`},{key:`A`,action:`assign task`},{key:`E`,action:`edit by prompt`},{key:`R`,action:`request by prompt`},{key:`N`,action:`new task`},{key:`m`,action:`${t?`maximize/expand`:`minimize/collapse`} lane`},{key:`g`,action:`grow lane`}],[{key:`c`,action:`${n?`expand`:`collapse`} phase`},{key:`C`,action:`${r?`expand`:`collapse`} lane row`},{key:`t`,action:`${cc.value?`collapse`:`expand`} titles`},{key:`/`,action:`filter tasks`},{key:`v/V`,action:s(`lanes`)}],[{key:`Left-Click`,action:`select task/lane/phase`},{key:`Double-Click`,action:`view task, collapse/expand lane/phase`},{key:`Drag & Drop`,action:`directly transition task`},{key:`?`,action:`hide key hints`}]]:B.value===`agents`?[[{key:`↑/↓/Left-Click`,action:`select agent`},{key:`⇈/⇊/⇤/⇥`,action:`page/top/bottom agent log`},{key:`Wheel`,action:`scroll agent log`}],[{key:`v/V`,action:s(`agents`)},{key:`?`,action:`hide key hints`}]]:B.value===`flow`?[[{key:`↑/↓/←/→/Left-Click`,action:`select agent/state`},{key:`⏎/Double-Click`,action:`view agent`},{key:`+/-/0/Wheel`,action:`zoom in/out/reset`},{key:`Left-Drag`,action:`scroll canvas`}],[{key:`v/V`,action:s(`flow`)},{key:`?`,action:`hide key hints`}]]:B.value===`stats`?[[{key:`←/→`,action:`select time range`},{key:`/`,action:`filter tasks`},{key:`v/V`,action:s(`stats`)}],[{key:`?`,action:`hide key hints`}]]:[[{key:`↑/↓/←/→/Left-Click`,action:`select task`},{key:`⏎/Double-Click`,action:`view task`},{key:`e`,action:`edit task`},{key:`T`,action:`transition task`}],[{key:`D`,action:`delete task`},{key:`A`,action:`assign task`},{key:`E`,action:`edit by prompt`},{key:`R`,action:`request by prompt`},{key:`N`,action:`new task`},{key:`t`,action:`${cc.value?`collapse`:`expand`} titles`},{key:`s`,action:`${sc.value.standalone?`hide`:`show`} standalone tasks`}],[{key:`/`,action:`filter tasks`},{key:`v/V`,action:s(`graph`)},{key:`+/-/0/Wheel`,action:`zoom in/out/reset`},{key:`Left-Drag`,action:`scroll canvas`},{key:`?`,action:`hide key hints`}]]}),u=()=>{Tc(),Uc()},d=e=>{if(e.animationName===`pulse`)for(let e of document.getAnimations())e instanceof CSSAnimation&&e.animationName===`pulse`&&e.startTime!==0&&(e.startTime=0)};return Tr(()=>{rl(),iP(),window.addEventListener(`resize`,u),document.addEventListener(`animationstart`,d),Wc()}),Or(()=>{il(),aP(),nN(),window.removeEventListener(`resize`,u),document.removeEventListener(`animationstart`,d)}),(e,s)=>(N(),P(M,null,[F(`header`,null,[F(`span`,null,[s[8]||=I(` ⧉ ASE: `,-1),s[9]||=F(`span`,{class:`emph`},`Task Board`,-1),s[10]||=F(`span`,{class:`sep`},`·`,-1),s[11]||=I(`project: `,-1),F(`span`,vL,k(j(z)?.project),1),s[12]||=F(`span`,{class:`sep`},`·`,-1),s[13]||=I(`mode: `,-1),F(`span`,yL,k(j(z)?.mode),1),s[14]||=F(`span`,{class:`sep`},`·`,-1),s[15]||=I(`tasks: `,-1),F(`span`,bL,k(t.value),1),s[16]||=F(`span`,{class:`sep`},`·`,-1),s[17]||=I(`view: `,-1),F(`button`,{class:`val toggle view`,title:`switch view (v, backward: V)`,onClick:s[0]||=e=>j(Yc)()},[(N(!0),P(M,null,Fr(j(es),(e,t)=>(N(),P(`span`,{key:t,class:O({off:t!==j(B)})},k(e),3))),128))]),s[18]||=F(`span`,{class:`sep`},`·`,-1),F(`span`,{class:O([`filter`,{off:r.value}])},[s[7]||=I(`filter: `,-1),F(`span`,xL,[qn(F(`input`,{ref_key:`filterEl`,ref:Js,"onUpdate:modelValue":s[1]||=e=>sn(Fs)?Fs.value=e:null,class:`val`,type:`text`,autocomplete:`off`,spellcheck:`false`,disabled:r.value,placeholder:`keywords…`,title:`space ANDs, comma ORs fuzzy matched keywords or effort:<size> (/)`,onKeydown:[s[2]||=Vo((...e)=>j(Kc)&&j(Kc)(...e),[`esc`]),s[3]||=Vo(e=>j(Js)?.blur(),[`enter`])]},null,40,SL),[[Io,j(Fs)]]),qn(F(`button`,{class:`clear`,title:`clear filter (ESC)`,onClick:s[4]||=(...e)=>j(Kc)&&j(Kc)(...e)},`✕`,512),[[eo,j(Fs)!==``&&!r.value]])])],2)])]),F(`div`,CL,[ua(SP),ua(EP),ua(eF),ua(iF),ua(mI)]),F(`div`,wL,[F(`button`,{style:be({visibility:j(B)===`lanes`&&!j(As).all&&!j(wc)?`visible`:`hidden`}),onClick:s[5]||=e=>j(Ec)(-240)},`◀`,4),j(wc)?(N(),P(`span`,TL,[s[19]||=I(`lane `,-1),F(`b`,null,k(j(z)?.groups[j(U).g]?.lanes[j(U).l]?.status),1),s[20]||=I(` of group `,-1),F(`b`,null,k(j(z)?.groups[j(U).g]?.title),1),s[21]||=I(` grown`,-1),s[22]||=F(`span`,{class:`sep`},`·`,-1),s[23]||=I(`g shrinks`,-1)])):j(B)===`lanes`&&j(As).info!==``?(N(),P(`span`,EL,[I(k(j(As).info),1),s[24]||=F(`span`,{class:`sep`},`·`,-1),I(k(j(As).all?`all visible`:`scroll or ◀/▶`),1)])):j(B)===`graph`&&o.value!==null?(N(),P(`span`,DL,[s[25]||=I(`task: `,-1),F(`b`,null,k(j(U).id),1),s[26]||=F(`span`,{class:`sep`},`·`,-1),s[27]||=I(`status: `,-1),F(`b`,null,k(o.value),1)])):j(B)===`stats`&&j(V)!==null?(N(),P(`span`,OL,[s[29]||=I(`statistics of `,-1),F(`b`,null,k(n.value),1),I(` `+k(j(Fs)===``?``:`filtered `)+`tasks`,1),j(V).range===`total`?L(``,!0):(N(),P(M,{key:0},[s[28]||=I(k(` `),-1),F(`b`,null,k(j(jc).find(e=>e.range===j(V)?.range)?.label),1)],64))])):j(B)===`agents`&&j(rc)!==null?(N(),P(`span`,kL,[s[32]||=I(`agent: `,-1),F(`b`,null,k(j(mc)(j(rc))),1),j(rc).title?(N(),P(M,{key:0},[s[30]||=F(`span`,{class:`sep`},`·`,-1),s[31]||=I(`operation: `,-1),F(`b`,null,k(j(rc).title),1)],64)):L(``,!0)])):j(B)===`flow`&&a.value!==null?(N(),P(`span`,AL,[s[35]||=I(`state: `,-1),F(`b`,null,k(a.value.state),1),s[36]||=F(`span`,{class:`sep`},`·`,-1),s[37]||=I(`observed by: `,-1),F(`b`,null,k(a.value.input),1),s[38]||=F(`span`,{class:`sep`},`·`,-1),s[39]||=I(`written by: `,-1),F(`b`,null,k(a.value.output),1),a.value.gate===``?L(``,!0):(N(),P(M,{key:0},[s[33]||=F(`span`,{class:`sep`},`·`,-1),s[34]||=I(`gate of: `,-1),F(`b`,null,k(a.value.gate),1)],64))])):j(B)===`flow`&&i.value!==null?(N(),P(`span`,jL,[s[50]||=I(`agent: `,-1),F(`b`,null,k(i.value.label),1),i.value.states===void 0?(N(),P(M,{key:0},[s[40]||=F(`span`,{class:`sep`},`·`,-1),s[41]||=I(`requests: `,-1),F(`b`,null,k(i.value.request),1)],64)):(N(),P(M,{key:1},[s[46]||=F(`span`,{class:`sep`},`·`,-1),s[47]||=I(`input: `,-1),F(`b`,null,k(i.value.states.input.join(`, `)||`none`),1),i.value.states.activity===void 0?L(``,!0):(N(),P(M,{key:0},[s[42]||=F(`span`,{class:`sep`},`·`,-1),s[43]||=I(`activity: `,-1),F(`b`,null,k(i.value.states.activity),1)],64)),s[48]||=F(`span`,{class:`sep`},`·`,-1),s[49]||=I(`output: `,-1),F(`b`,null,k(i.value.states.output.join(`, `)||`none`),1),i.value.states.gate===void 0?L(``,!0):(N(),P(M,{key:1},[s[44]||=F(`span`,{class:`sep`},`·`,-1),s[45]||=I(`gate: `,-1),F(`b`,null,k(i.value.states.gate),1)],64))],64))])):L(``,!0),F(`button`,{style:be({visibility:j(B)===`lanes`&&!j(As).all&&!j(wc)?`visible`:`hidden`}),onClick:s[6]||=e=>j(Ec)(240)},`▶`,4)]),F(`footer`,null,[(N(!0),P(M,null,Fr(j(sc).keys?l.value:[],(e,t)=>(N(),P(`div`,{key:t,class:`hints`},[(N(!0),P(M,null,Fr(e,(e,t)=>(N(),P(M,{key:e.key},[t>0?(N(),P(`span`,ML,`·`)):L(``,!0),(N(!0),P(M,null,Fr(e.key===`/`?[`/`]:e.key.split(`/`),(e,t)=>(N(),P(M,{key:t},[t>0?(N(),P(M,{key:0},[I(`/`)],64)):L(``,!0),F(`kbd`,null,k(e),1)],64))),128)),F(`span`,NL,k(e.action),1)],64))),128))]))),128)),c.value===``?(N(),P(`div`,FL,[j(z)===null?L(``,!0):(N(),P(M,{key:0},[s[57]||=I(`⧉ ASE: `,-1),s[58]||=F(`b`,null,`Task Board`,-1),s[59]||=F(`span`,{class:`sep`},`·`,-1),s[60]||=I(`server: `,-1),F(`b`,{class:O({off:!j(el)})},k(j(el)?`online`:`offline`),3),s[61]||=I(),F(`span`,{class:O({off:!j(el)})},k(j(el)?`●`:`○`),3),j(tl)===null?L(``,!0):(N(),P(M,{key:0},[s[51]||=F(`span`,{class:`sep`},`·`,-1),s[52]||=I(`store: `,-1),F(`b`,null,k(j(tl).kind),1),s[53]||=I(),F(`span`,{class:O({off:!j(el)||!j(tl).connected})},k(j(el)&&j(tl).connected?`●`:`○`),3)],64)),j(Xs)===null?L(``,!0):(N(),P(M,{key:1},[s[54]||=F(`span`,{class:`sep`},`·`,-1),s[55]||=I(`agents: `,-1),F(`b`,null,k(j(Xs).agents.length),1),s[56]||=I(),F(`span`,{class:O({off:!j(el)||!j(Xs).connected})},k(j(el)&&j(Xs).connected?`●`:`○`),3)],64)),s[62]||=F(`span`,{class:`sep`},`·`,-1),s[63]||=I(`version: `,-1),F(`b`,null,`ASE `+k(j(z).version),1)],64))])):(N(),P(`div`,PL,k(c.value),1))]),ua(NI),ua(_L)],64))}})).mount(`#app`);
|